{% extends "base.htm" %}
{% from 'bs_page_header.htm' import bs_page_header with context %}
{% from 'bs_form_body.htm' import bs_form_body with context %}

{% block main %}
{% if token_fail %}
    {% set title=_("Bad Token") %}
{% else %}
    {% set title=_("Change Password") %}
{% endif %}
{{ bs_page_header(title) }}

{% if token_fail %}
    <div class="alert alert-error vmargin">
    {{ _(
        'The password reset link was invalid, possibly because it has already been used.  Please request a <a href="%(passwd_reset_url)s">new password reset</a>.',
        passwd_reset_url=url('account_reset_password')
    ) }}
    </div>
{% else %}
    {% if form %}
        <form role="form" method="POST" action=".">
            {{ bs_form_body(form) }}
            <input class="btn btn-primary" type="submit" name="action" value="{{ _('change password') }}"/>
        </form>
    {% else %}
        <div class="alert alert-info vmargin">{{ _('Your password is now changed.') }}</div>
    {% endif %}
{% endif %}

{% endblock main %}
