{% extends "authentic2/base-page.html" %}
{% load i18n %}

{% block title %}
{% trans "Resetting password" %}
{% endblock %}

{% block content %}

    {% if validlink %}
        <div class="columns small-12 text-center greybox">
            <h3>{% trans "Resetting password" %}</h3>
        </div>

    <div class="columns small-12 loginbox">
        <div class="columns small-12 loginform">
            <form method="post">
                {% csrf_token %}
                {% for hidden in form.hidden_fields %}
                    {{ hidden }}
                {% endfor %}
                {% if form.errors %}
                <div class="row">
                    <div class="columns small-12 medium-10 small-centered">
                        {% for error in form.non_field_errors %}
                            <small class="error">{{ error }}</small>
                        {% endfor %}
                    </div>
                </div>
                {% endif %}
                <div class="row">
                    <div class="columns small-10 small-centered">
                        {% if form.new_password1.help_text %}
                            <div class="columns small-12 text-justify panel callout radius">
                                <p>{{ form.new_password1.help_text }}</p>
                            </div>
                        {% endif %}
                        <div class="columns small-12 medium-4">{{ form.new_password1.label_tag }}</div>
                        <div class="columns small-12 medium-8">
                            {{ form.new_password1 }}
                            {% for error in form.new_password1.errors %}
                                <small class="error">{{ error }}</small>
                            {% endfor %}
                        </div>
                    </div>
                </div>
                <div class="row">
                    <div class="columns small-10 small-centered">
                        <div class="columns small-12 medium-4">{{ form.new_password2.label_tag }}</div>
                        <div class="columns small-12 medium-8">
                            {{ form.new_password2 }}
                            {% for error in form.new_password2.errors %}
                                <small class="error">{{ error }}</small>
                            {% endfor %}
                        </div>
                    </div>
                </div>

                <div class="columns small-12 text-center">
                    <button type="submit" class="submit radius large inverted-button" name="{{ submit_name }}" value="{%  trans 'Submit' %}"><span class="text">{%  trans "SUBMIT" %}</span></button>
                </div>
            </form>
        </div>
    </div>

    {% else %}
        <div class="columns small-12 text-center greybox">
            <h3>{% trans "Password reset failed" %}</h3>
        </div>
    {% endif %}

{% endblock %}
