{% extends "adminlte2/base_anonymous.html" %}
{% load i18n static %}


{% block anonymous_form %}

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

    <form method="post">
      {% csrf_token %}
      <fieldset class="module aligned">

        {% block anonymous_password1 %}
          <div class="form-group has-feedback {% if form.new_password1.errors|length > 0 %} has-error {% endif %}">
            {% block anonymous_password1_input %}
              <input type="password" name="new_password1" class="form-control" placeholder="{% trans 'New Password' %}">
            {% endblock anonymous_password1_input %}
            <span class="glyphicon glyphicon-lock form-control-feedback"></span>
            <div class="text-danger error-list">
              {{ form.new_password1.errors }}
            </div>
          </div>
        {% endblock anonymous_password1 %}

        {% block anonymous_password2 %}
          <div class="form-group has-feedback {% if form.new_password2.errors|length > 0 %} has-error {% endif %}">
            {% block anonymous_password2_input %}
              <input type="password" name="new_password2" class="form-control" placeholder="{% trans 'Confirm Password' %}">
            {% endblock anonymous_password2_input %}
            <span class="glyphicon glyphicon-log-in form-control-feedback"></span>
            <div class="text-danger error-list">
              {{ form.new_password2.errors }}
            </div>
          </div>
        {% endblock anonymous_password2 %}

        {% block anonymous_form_button %}
          <input type="submit" value="{% trans 'Change my password' %}" class="btn btn-flat btn-primary" />
        {% endblock anonymous_form_button %}
      </fieldset>
    </form>

  {% else %}

    <p>
      {% trans "The password reset link was invalid, possibly because it has already been used.  Please request a new password reset." %}
    </p>
    <a href="{% url 'password_reset' %}">Return to password reset page</a>
    <br>
    <a href="{% url 'login' %}">Return to login page</a>

  {% endif %}

{% endblock anonymous_form %}
