{% extends "admin/base.html" %}
{% load i18n static admin_urls %}

{% block extrastyle %}{{ block.super }}{% endblock %}

{% block bodyclass %}{{ block.super }} {{ opts.app_label }}-{{ opts.model_name }} change-form{% endblock %}

{% block breadcrumbs %}
  {% if not is_popup %}
    <div class="breadcrumbs">
      <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
      &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
      &rsaquo; <a href="{% url opts|admin_urlname:'change' original.pk|admin_urlquote %}">{{ original|truncatewords:"18" }}</a>
      &rsaquo; {% translate 'Change password' %}
    </div>
  {% endif %}
{% endblock %}

{% block content %}
<div id="content-main" class="lucus-content">
  <form method="post" id="user_change_password_form" novalidate>{% csrf_token %}{% block form_top %}{% endblock %}
    {% if is_popup %}<input type="hidden" name="{{ is_popup_var }}" value="1">{% endif %}
    {% if to_field %}<input type="hidden" name="{{ to_field_var }}" value="{{ to_field }}">{% endif %}

    {% if form.errors %}
      <p class="errornote">
        {% blocktranslate count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktranslate %}
      </p>
    {% endif %}

    <p>{% blocktranslate with username=original %}Enter a new password for the user {{ username }}.{% endblocktranslate %}</p>

    <fieldset class="module aligned">
      <div class="form-row">
        {{ form.password1.errors }}
        {{ form.password1.label_tag }} {{ form.password1 }}
        {% if form.password1.help_text %}
          <div class="help">{{ form.password1.help_text|safe }}</div>
        {% endif %}
      </div>
      <div class="form-row">
        {{ form.password2.errors }}
        {{ form.password2.label_tag }} {{ form.password2 }}
        {% if form.password2.help_text %}
          <div class="help">{{ form.password2.help_text|safe }}</div>
        {% endif %}
      </div>
    </fieldset>

    <div class="submit-row">
      <input type="submit" value="{% translate 'Change password' %}" class="default">
      <a href="{% url opts|admin_urlname:'change' original.pk|admin_urlquote %}">{% translate 'Cancel' %}</a>
    </div>
  </form>
</div>
{% endblock %}
