{% extends '_base.html' %}
{% load form_helpers %}

{% block title %}Change Password{% endblock %}

{% block content %}
<div class="row">
    <div class="col-md-8 col-md-offset-2">
        <h1>Change Password</h1>
    </div>
</div>
<div class="row">
    <div class="col-md-2 col-md-offset-2">
        {% include 'users/inc/profile_nav.html' with active_tab="change_password" %}
    </div>
	<div class="col-md-6">
        <form action="." method="post" class="form form-horizontal">
            {% csrf_token %}
            {% if form.non_field_errors %}
                <div class="panel panel-danger">
                    <div class="panel-heading"><strong>Errors</strong></div>
                    <div class="panel-body">
                        {{ form.non_field_errors }}
                    </div>
                </div>
            {% endif %}
            <div class="panel panel-default">
                <div class="panel-heading"><strong>Password</strong></div>
                <div class="panel-body">
                    {% render_field form.old_password %}
                    {% render_field form.new_password1 %}
                    {% render_field form.new_password2 %}
                </div>
            </div>
            <div class="row">
                <div class="form-group">
                    <div class="col-md-12 text-center">
                        <button type="submit" name="_update" class="btn btn-primary">Update</button>
                        <a href="{% url 'users:profile' %}" class="btn btn-default">Cancel</a>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>
{% endblock %}
