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

{% load crispy_forms_tags %}
{% load i18n %}
{% load url from future %}


{% block title %}
    {% if validlink %}
        {% trans "Enter New Password" %}
    {% else %}
        {% trans "Password Reset Unsuccessful" %}
    {% endif %}
{% endblock title %}

{% block page_main_title %}
    {% if validlink %}
        {% trans "Enter New Password" %}
    {% else %}
        {% trans "Password Reset Unsuccessful" %}
    {% endif %}
{% endblock page_main_title %}

{% block content %}
    {% if validlink %}
        <p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>

        {% block form %}
            <form class="{% block form_class %}{% endblock form_class %}" action="" method="post">
                {% csrf_token %}

                {% block form_inner %}
                    {{ form|crispy }}
                {% endblock %}

                {% block form_actions %}
                    <div class="form-actions">
                        {% block form_actions_inner %}
                            <input type="submit" class="button" value="{% trans "Change my password" %}">
                        {% endblock form_actions_inner %}
                    </div>
                {% endblock form_actions %}
            </form>
        {% endblock %}
    {% else %}
        <p>{% trans "The password reset link was invalid, possibly because it has already been used." %}</p>

        {% url 'auth_password_reset' as password_reset_url %}
        {% if password_reset_url %}
            <p>{% blocktrans %}Please <a href="{{ password_reset_url }}">request a new password</a> reset.{% endblocktrans %}</p>
        {% else %}
            <p>{% trans "Please request a new password reset." %}</p>
        {% endif %}
    {% endif %}
{% endblock content %}
