{% extends "registration/base_site.html" %}
{% load i18n %}
{% block bodyclass %}{{ block.super }}login{% endblock %}
{% block header-align %}center{% endblock %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
    <div id="confirm-form">
        {% if validlink %}
            <div class="card-content center">
                <span class="card-title darken-1">{% if title %}{{ title }}{% endif %}</span>
                <p>{% trans "Please enter your new password twice so we can verify you typed it in correctly." %}</p>
            </div>
            <div class="card-action darken-2">
                <form method="post">{% csrf_token %}
                    <div class="row center">
                        <div class="input-field col l12">
                            {{ form.new_password1 }}
                            <label for="id_new_password1">{% trans 'New password:' %}</label>
                            <small class="error">{{ form.new_password1.errors }}</small>
                        </div>
                    </div>

                    <div class="row center">
                        <div class="input-field col l12">
                            {{ form.new_password2 }}
                            <label for="id_new_password2">{% trans 'Confirm password:' %}</label>
                            <small class="error">{{ form.new_password2.errors }}</small>
                        </div>
                    </div>
                    <div class="row center">
                        <div class="input-field col l12">
                            <button type="submit" class="waves-effect waves-light {{ request.ADMIN_COLOR_THEME }}  btn white-text">{% trans 'Change my password' %}</button>
                        </div>
                    </div>
                </form>
            </div>
        {% else %}
            <div class="card-content center">
                <p>{% trans "The password reset link was invalid, possibly because it has already been used.  Please request a new password reset." %}</p>
                <div class="row center">
                    <div class="input-field col l12">
                        <a href="{% url 'admin:index' %}"
                           class="waves-effect waves-light {{ request.ADMIN_COLOR_THEME }}  btn white-text">{% trans 'Log In' %}</a>
                    </div>
                </div>
            </div>
        {% endif %}
    </div>
{% endblock %}
