
{% extends "base.html" %}

{% load i18n widget_tweaks %}


{% block content %}

    <div class="container">
        <div class="row">
            <div class="col-xs-12">
                <h1>{% if token_fail %}{% trans "Bad Token" %}{% else %}{% trans "Change Password" %}{% endif %}</h1>

                {% if token_fail %}
                    {% url 'account_reset_password' as passwd_reset_url %}
                    <p>{% blocktrans %}The password reset link was invalid, possibly because it has already been used.  Please request a <a href="{{ passwd_reset_url }}">new password reset</a>.{% endblocktrans %}</p>
                {% else %}
                    {% if form %}
                        <form method="POST" action="{{ action_url }}">
                            {% csrf_token %}

                            <div class="form-group {% if form.password1.errors %}has-error{% endif %}">
                                <label for="{{ form.password1.auto_id }}">
                                    {{ form.password1.label }}
                                </label>
                                {{ form.password1|add_class:"form-control unicase-form-control text-input" }}
                            </div>

                            <div class="form-group {% if form.password2.errors %}has-error{% endif %}">
                                <label for="{{ form.password2.auto_id }}">
                                    {{ form.password2.label }}
                                </label>
                                {{ form.password2|add_class:"form-control unicase-form-control text-input" }}
                            </div>

                            <input type="submit" class="btn btn-success" name="action" value="{% trans 'change password' %}"/>
                        </form>
                    {% else %}
                        <p>{% trans 'Your password is now changed.' %}</p>
                    {% endif %}
                {% endif %}
            </div>
        </div>
    </div>

{% endblock %}
