{% extends "layouts/base.html" %}
{% load static %}
{% load i18n %}

{% block content %}
    {% include 'header.html' %}
    <main>
        <section>
            <div class="form-view">
                <div>
                    {% if validlink %}
                        <h1>{% translate "Confirm reset password" %}</h1>
                        <p>
                            {% translate "Use the form below to confirm resetting your password" %}
                        </p>
                        <form name="reset-password"
                              id="form-reset-password"
                              class="help"
                              method="post">
                            {% csrf_token %}
                            {% translate "Confirm password" as fieldset_legend %}
                            {% include "partials/form/fieldset.html" with legend=fieldset_legend fieldset="new_password1 new_password2" fields=form %}
                            <p>
                                <a href="{% url 'login' %}" class="button ghost">{% translate "Back" %}</a>
                                <button type="submit">{% translate "Send" %}</button>
                            </p>
                        </form>
                    {% else %}
                        <div id="explanation-invalid-link" class="explanation">
                            <h1>{% translate "The link is invalid" %}</h1>
                            <p>
                                {% translate "The password reset link was invalid, possibly because it has already been used.  Please request a new password reset." %}
                            </p>
                        </div>
                    {% endif %}
                </div>
            </div>
        </section>
    </main>
{% endblock %}
