{% extends "website/base.html" %}

{% block titleblock %}
Forgot Password
{% 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">Forgot Password</h1>
          <hr />
          {% if user.is_authenticated %}
          <div class="alert alert-info" role="alert">You are already logged in!</div>
          {% else %}
            {% if form.errors %}
            <div class="alert alert-danger" role="alert">The email address provided is incorrect.</div>
            {% endif %}
          {% endif %}
  
          {% if not user.is_authenticated %}
          <form method="post" action=".">
            {% csrf_token %}
  
            <div class="form-group">
              <label for="id_username">Email address:</label>
              {{ form.email | addclass:"form-control" }}
              <small id="emailHelp" class="form-text text-muted">The email address you provided at registration. If you left it blank, your password cannot be reset through this form.</small>
            </div>
            
            <hr />
            <div class="form-group">
              <input class="form-control btn btn-outline-secondary" type="submit" value="Submit" />
              <input type="hidden" name="next" value="{{ next }}" />
            </div>
          </form>
          
          {% endif %}
        </div>
      </div>
    </div>
  </div>
</div>
{% endblock %}
