{% extends "core/base.html" %}
{% load i18n %}
{% load settings_value %}

{% block pagetitle %}{% trans 'Password Reset' %} - {% settings_value 'PRODUCT_NAME' %}{% endblock %}
{% block title %}{% trans 'Password Reset' %}{% endblock %}

{% block content %}
{% settings_value 'PRODUCT_NAME' as product_name %}

{% if validlink %}

<form method="post" class="form">{% csrf_token %}
    <fieldset>
        <p class="text-center">{% blocktrans %}Use the form below to reset your {{ product_name }} password.{% endblocktrans %}</p>

        {{ password_policy | safe }}

        {% if form.new_password1.errors %}
        <div class="alert error">
            {{ form.new_password1.errors }}
        </div>
        {% endif %}
        <div class="form-item">
            <label>{% trans 'New password:' %}</label>
            {{ form.new_password1 }}
        </div>

        {% if form.new_password2.errors %}
        <div class="alert error">
            {{ form.new_password2.errors }}
        </div>
        {% endif %}
        <div class="form-item">
            <label>{% trans 'Confirm password:' %}</label>
            {{ form.new_password2 }}
        </div>

        <div class="form-item end">
            <button>{% trans 'Reset my password' %}</button>
        </div>
    </fieldset>
</form>

{% else %}

<p class="text-center">
    {% trans "This password reset link is invalid, possibly because it has already been used. Please request a new password reset." %}
</p>

{% endif %}
{% endblock %}
