{% extends "base.html" %}
{% block comments %}
<!--
# Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License").  This software is distributed "AS IS"
# as set forth in the License.
-->
{% endblock %}

{% load i18n static %}
{% load url from future %}
{% load add_attrs %}

{% block title %}App Framework: Password change{% endblock %}

{% block login %}{% endblock %}

{% block content %}

<div class="container-fluid">
    <div class="row">
        <div class="col-xs-3"></div>
        <div class="col-xs-6">
            <form class="form-horizontal" action="" method="post">
                {% csrf_token %}
                    <legend>Change User Password</legend>
                    {% if form.errors %}
                        <p class="text-danger">
                        {% blocktrans count counter=form.errors.items|length %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
                        </p>
                    {% endif %}

                    <p>{% trans "Please enter your old password, and then your new password twice." %}</p>

                    <div class="control-group">
                        <div class="control-label">
                            <label for="id_old_password" class="sr-only">Old password</label>
                        </div>
                        <div class="controls">
                            <input class="form-control" id="id_old_password" placeholder="Old password" name="old_password" type="password">
                            {% if form.old_password.errors %}
                                {% for err in form.old_password.errors %}
                                    <p class="text-danger">{{ err }}</p>
                                {% endfor %}
                            {% endif %}
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="control-label">
                            <label for="id_new_password1" class="sr-only">New Password</label>
                        </div>
                        <div class="controls">
                            <input class="form-control" id="id_new_password1" placeholder="New password" name="new_password1" type="password">
                            {% if form.new_password1.errors %}
                                {% for err in form.new_password1.errors %}
                                    <p class="text-danger">{{ err }}</p>
                                {% endfor %}
                            {% endif %}
                        </div>
                    </div>

                    <div class="control-group">
                        <div class="control-label">
                            <label for="id_new_password2" class="sr-only">New Password (again)</label>
                        </div>
                        <div class="controls">
                            <input class="form-control" id="id_new_password2" placeholder="New password (again)" name="new_password2" type="password">
                            {% if form.new_password2.errors %}
                                {% for err in form.new_password2.errors %}
                                    <p class="text-danger">{{ err }}</p>
                                {% endfor %}
                            {% endif %}
                        </div>
                    </div>

                    <div class="block-centered">
                        <button type="submit" id="submit" class="btn btn-primary button-loading">Change my password</button>
                    </div>

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

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

{% endblock %}
