{% extends "admin/base_site.html" %}
{% load i18n static %}
{% load url from suit_compat %}

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

{% block userlinks %}

  {% url 'django-admindocs-docroot' as docsroot %}

  {% if docsroot %}
  <a href="{{ docsroot }}">
  {% trans 'Documentation' %}</a>
    <span class="separator">|</span>
  {% endif %}

  {% trans 'Change password' %}
  <span class="separator">|</span>
  <a href="{% url 'admin:logout' %}">{% trans 'Log out' %}</a>
{% endblock %}

{% block breadcrumbs %}
  <div class="breadcrumb">
    <li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a>
      <span class="divider">&raquo;</span></li>
    <li class="active">{% trans 'Password change' %}</li>
  </div>
{% endblock %}

{% block title %}{% trans 'Password change' %}{% endblock %}

{% block content %}
  <div id="content-main">

    <form action="" method="post" class="form-horizontal">{% csrf_token %}
      <div>

        <div class="alert alert-info">{% trans "Please enter your old password, for security's sake, and then enter your new password twice so we can verify you typed it in correctly." %}</div>

        {% 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 %}

        {#            <h1>{% trans 'Password change' %}</h1>#}


        <fieldset class="module aligned wide">

          <div class="control-group{{ form.old_password.errors|yesno:' error,' }}">
            <div class="control-label">
              <label for="id_old_password" class="required">{% trans 'Old password' %}:</label>
            </div>

            <div class="controls">
              {{ form.old_password }}
              <div class="help-inline">{{ form.old_password.errors }}</div>
            </div>
          </div>

          <div class="control-group{{ form.new_password1.errors|yesno:' error,' }}">
            <div class="control-label">
              <label for="id_new_password1" class="required">{% trans 'New password' %}:</label>
            </div>

            <div class="controls">
              {{ form.new_password1 }}
              <div class="help-inline">{{ form.new_password1.errors }}</div>
            </div>
          </div>

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

        </fieldset>

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

        <script type="text/javascript">document.getElementById("id_old_password").focus();</script>
      </div>
    </form>
  </div>

{% endblock %}
