{% extends "admin/base_site.html" %}
{% load i18n admin_static admin_modify admin_urls %}
{% load url from suit_compat %}

{% block extrahead %}{{ block.super }}
  {% url 'admin:jsi18n' as jsi18nurl %}
  <script type="text/javascript" src="{{ jsi18nurl|default:"../../../../jsi18n/" }}"></script>
{% endblock %}

{% block extrastyle %}{{ block.super }}
  {#    <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}"/>#}
{% endblock %}

{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}

{% if not is_popup %}
  {% block breadcrumbs %}
    <div class="breadcrumb">
      <li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
        <span class="divider">&raquo;</span></li>
      <li>
        <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_label|capfirst|escape }}</a>
        <span class="divider">&raquo;</span></li>
      <li>
        <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
        <span class="divider">&raquo;</span></li>
      <li><a href="

              {% url opts|admin_urlname:'changelist' %}{{ original.pk }}">{{ original|truncatewords:"18" }}</a>
        <span class="divider">&raquo;</span></li>

      <li class="active">{% trans 'Change password' %}</li>
    </div>
  {% endblock %}
{% endif %}

{% block content %}
  <div id="content-main">
    <form action="{{ form_url }}" method="post" id="{% firstof opts.model_name opts.module_name %}_form" class="form-horizontal">
      {% csrf_token %}{% block form_top %}{% endblock %}
      <div>
        {% if is_popup %}
          <input type="hidden" name="_popup" value="1"/>{% endif %}
        {% if form.errors %}
          <div class="alert alert-error">{% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %} Please correct the errors below.{% endblocktrans %}</div>
        {% endif %}

        <div class="alert alert-info">{% blocktrans with username=original.username %}Enter a new password for the user <strong>{{ username }}</strong>.{% endblocktrans %}</div>

        <fieldset class="module aligned">

          <div class="control-group{{ form.password1.errors|yesno:' error,' }}">
            <div class="control-label">
              <label for="id_password1" class="required">{% trans 'Password' %}:</label>
            </div>
            <div class="controls">
              {{ form.password1 }}
              <div class="help-inline">{{ form.password1.errors }}</div>
            </div>
          </div>

          <div class="control-group{{ form.password2.errors|yesno:' error,' }}">
            <div class="control-label">
              <label for="id_password2" class="required">{% trans 'Password (again)' %}:</label>
            </div>
            <div class="controls">
              {{ form.password2 }}
              <div class="help-inline">{{ form.password2.errors }}{% trans 'Enter the same password as above, for verification.' %}</div>
            </div>
          </div>

        </fieldset>

        <div class="submit-row submit-row-bottom">
          <input type="submit" value="{% trans 'Change password' %}" class="default btn btn-info"/>
        </div>

        <script type="text/javascript">document.getElementById("id_password1").focus();</script>
      </div>
    </form>
  </div>
{% endblock %}
