{% extends "base.html" %}

{% block titleblock %}
Forgot Password - Reset
{% endblock %}

{% block body %}

{% load addclass %}
<div class="container main-content mt-4" id="main-copy">
  <div class="row">
    <div class="col-lg-5 offset-lg-3 col-sm-12">
      <div class="card mt-3">
        <div class="card-body">
          <h1 class="card-title">Reset Password</h1>
          <hr />
          {% if not validlink %}
          <div class="alert alert-danger" role="alert">The password reset link has expired. Please request another to proceed.</div>
          {% else %}
          
            {% if form.errors %}
              {% for field in form %}
                {% for error in field.errors %}
                  <div class="alert alert-danger" role="alert">{{ error }}</div>
                {% endfor %}
              {% endfor %}
            {% endif %}
  
            <form method="post" action=".">
              {% csrf_token %}
    
              <div class="form-group">
                <label for="id_username">Enter new password:</label>
                {{ form.new_password1 | addclass:"form-control" }}
              </div>
              
              <div class="form-group">
                <label for="id_username">Confirm password:</label>
                {{ form.new_password2 | addclass:"form-control" }}
              </div>
              
              <hr />
              <div class="form-group">
                <input class="form-control btn btn-outline-secondary" type="submit" value="Login" />
                <input type="hidden" name="next" value="{{ next }}" />
              </div>
            </form>
              
          {% endif %}
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}
