{% extends "admin/base_site.html" %}
{% load i18n admin_static admin_urls %}

{% block breadcrumbs %}
    {% if not is_popup %}
        <ul class="grp-horizontal-list">
            <li><a href="{% url 'admin:index' %}">{% trans "Home" %}</a></li>
            <li><a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_label|capfirst|escape }}</a></li>
            <li><a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a></li>
            <li><a href="{% url opts|admin_urlname:'changelist' %}{{ original.pk }}">{{ original|truncatewords:"18" }}</a></li>
            <li>{% trans 'Change password' %}</li>
        </ul>
    {% endif %}
{% endblock %}
{% block title %}{% trans 'Password change' %}{% endblock %}
{% block content-class %}{% endblock %}

{% block content %}
{# TODO: French translations are all mixed up with change "MY" password form ... #}
{#<h1>{% trans 'Password change' %}</h1>#}
<div class="g-d-c">
    <div class="g-d-12">
        <div class="grp-rte">
            <p>{% blocktrans with original.username as username %}Enter a new password for the user <strong>{{ username }}</strong>.{% endblocktrans %}</p>
        </div>
        {% if form.errors %}
            <p class="errornote">{% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}</p>
        {% endif %}
        <form action="{{ form_url }}" method="post" id="{{ opts.model_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %}
            {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
            <fieldset class="grp-module">
                <div class="grp-row{% if form.password1.errors %} grp-errors{% endif %}">
                    <div class="l-2c-fluid l-d-4">
                        <div class="c-1"><label for="id_new_password1" class="required">{% trans 'New password' %}</label></div>
                        <div class="c-2">
                            {{ form.password1 }}
                            {{ form.password1.errors }}
                            {% if form.password1.help_text %}
                                <p class="grp-help">{{ form.password1.help_text|safe }}</p>
                            {% endif %}
                        </div>
                    </div>
                </div>
                <div class="grp-row{% if form.password2.errors %} grp-errors{% endif %}">
                    <div class="l-2c-fluid l-d-4">
                        <div class="c-1"><label for="id_new_password2" class="required">{% trans 'Password (again)' %}</label></div>
                        <div class="c-2">
                            {{ form.password2 }}
                            {{ form.password2.errors }}
                            <p class="grp-help">{% trans 'Enter the same password as above, for verification.' %}</p>
                        </div>
                    </div>
                </div>
            </fieldset>
            <div class="grp-module grp-submit-row">
                <ul>
                    <li><input type="submit" value="{% trans 'Change password' %}" class="grp-default" /></li>
                </ul>
            </div>
        </form>
    </div>
</div>
{% endblock %}
