{% extends 'admin/base_site.html' %}

{% load i18n static %}
{% load adminlte2_tags %}

{% block stylesheets %}
    <link rel="stylesheet" type="text/css" href="{% static 'admin/css/forms.css' %}">

    {{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static 'adminlte2_admin/css/forms.css' %}">
{% endblock stylesheets %}

{% block breadcrumbs %}
    <li><a href="{% url 'admin:index' %}">{% trans 'Home' %}</a></li>
    <li>{% trans 'Password change' %}</li>
{% endblock %}

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

        {% csrf_token %}

        <div>
            {% if form.errors %}
                <div class="alert alert-danger alert-dismissible">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    <p class="errornote">
                        <i class="icon fa fa-ban"></i>
                        {% if form.errors.items|length == 1 %}
                            {% trans "Please correct the error below." %}
                        {% else %}
                            {% trans "Please correct the errors below." %}
                        {% endif %}
                    </p>
                </div>
            {% endif %}

            <p>{% 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.' %}</p>

            <fieldset class="module aligned wide">

                <div class="form-row form-group">
                    {{ form.old_password.errors }}
                    {{ form.old_password.label_tag }} {{ form.old_password|add_class:'form-control' }}
                </div>

                <div class="form-row form-group">
                    {{ form.new_password1.errors }}
                    {{ form.new_password1.label_tag }} {{ form.new_password1|add_class:'form-control' }}
                    {% if form.new_password1.help_text %}
                    <span class="help-block">{{ form.new_password1.help_text|safe }}</span>
                    {% endif %}
                </div>

                <div class="form-row form-group">
                    {{ form.new_password2.errors }}
                    {{ form.new_password2.label_tag }} {{ form.new_password2|add_class:'form-control' }}
                    {% if form.new_password2.help_text %}
                    <span class="help-block">{{ form.new_password2.help_text|safe }}</span>
                    {% endif %}
                </div>

            </fieldset>

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

        </div>
    </form>
</div>

{% endblock %}
