{% extends "registration/registration_base.html" %}

{% block page-title %}Reset password - {{ block.super }}{% endblock %}

{% block body-class %}{{ block.super }} static{% endblock %}

{% block content %}
    {% if form %}
        <form class="form-horizontal static-box" method="post" action="">
            {% if form.errors %}
                {% if form.non_field_errors %}
                    <div class="alert alert-error">
                        {{ form.non_field_errors }}
                    </div>
                {% else %}
                    <div class="alert alert-error">
                        Please fix the errors below.
                    </div>
                {% endif %}
            {% endif %}
            <fieldset>
                <legend>Reset password</legend>
                <div class="control-group {% if form.new_password1.errors %}error{% endif %}">
                    <label class="control-label" for="id_new_password1">New password</label>
                    <div class="controls">
                        {{ form.new_password1 }}
                        {% if form.errors.new_password1 %}
                            <span class="help-inline">
                                {% for error in form.errors.new_password1  %}
                                    {{ error }}
                                {% endfor %}
                            </span>
                        {% endif %}
                    </div>
                </div>
                <div class="control-group {% if form.new_password2.errors %}error{% endif %}">
                    <label class="control-label" for="id_new_password2">Confirm new password</label>
                    <div class="controls">
                        {{ form.new_password2 }}
                        {% if form.errors.new_password2 %}
                            <span class="help-inline">
                                {% for error in form.errors.new_password2  %}
                                    {{ error }}
                                {% endfor %}
                            </span>
                        {% endif %}
                    </div>
                </div>
            <div class="form-actions group">
                <button class="btn btn-primary" type="submit">Set Password</button>
            </div>
            {% csrf_token %}
        </form>
    {% else %}
        <div class="static-box">
            <div class="alert alert-error alert-alone">
                This password reset URL is no longer valid.
            </div>
        </div>
    {% endif %}
{% endblock %}
