{% extends "base.html" %}
{% load i18n %}

{% block main %}

    <form action="" method="post" class="registration">
        {% csrf_token %}

        <div>

            {% if form.errors %}
            <p class="errorlist">
                {% if form.errors.items|length == 1 %}
                    {% trans "Please correct the error below." %}
                {% else %}
                    {% trans "Please correct the errors below." %}
                {% endif %}
                <br>
                {% for error in form.non_field_errors %}
                    {{ error }}
                {% endfor %}
            </p>
            {% 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>

            <ul>
                <li>
                    {{ form.old_password.errors }}
                    <label for="id_old_password" class="required">{% trans "Old password" %}:</label>
                    {{ form.old_password }}
                </li>
                <li>
                    {{ form.new_password1.errors }}
                    <label for="id_new_password1" class="required">{% trans "New password" %}:</label>
                    {{ form.new_password1 }}
                </li>
                <li>
                    {{ form.new_password2.errors }}
                    <label for="id_new_password2" class="required">{% trans "New password (again)" %}:</label>
                    {{ form.new_password2 }}
                </li>
            </ul>

            <input type="submit" value="{% trans 'OK' %}" class="btn btn-primary" />
            <input type="hidden" name="next" value="{{ next }}" />

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

{% endblock %}
