med/users/templates/users/user.html

53 lines
1.9 KiB
HTML

{% extends "base_form.html" %}
{% comment %}
SPDX-License-Identifier: GPL-3.0-or-later
{% endcomment %}
{% load i18n %}
{% block content %}
<form method="post" onsubmit="window.onbeforeunload=null">{% csrf_token %}
{% if form.non_field_errors %}
<p class="errornote">
{% for error in form.non_field_errors %}
{{ error }}
{% endfor %}
</p>
{% endif %}
<fieldset class="module aligned">
{% for field in form %}
<div class="form-row{% if field.errors %} errors{% endif %}">
{{ field.errors }}
<div>
{{ field.label_tag }}
{% if field.is_readonly %}
<div class="readonly">{{ field.contents }}</div>
{% else %}
{{ field }}
{% endif %}
{% if field.field.help_text %}
<div class="help">{{ field.field.help_text|safe }}</div>
{% endif %}
</div>
</div>
{% endfor %}
{% if password_change %}
<div class="form-row">
<div>
<label>Mot de passe</label>
<div class="readonly">
{% if user.has_usable_password %}
<a class="button" href="{% url 'password_change' %}">{% trans 'Change password' %}</a>
{% endif %}
</div>
</div>
</div>
{% endif %}
</fieldset>
<div class="submit-row">
<input class="default" type="submit" value="{% trans 'Save' %}">
</div>
</form>
{% endblock %}