{% extends 'portal/form_shapes.html' %}
{% load static %}

{% block form_content %}
    <!-- #TODO: Merge this if/else when we get rid of the indep username -->
    {% if usertype == "TEACHER" %}
        <div id="reset_password_teacher_page"></div>
        <h4 class="center-block">Reset password</h4>
        <h5>Please enter your email address</h5>
        <p class="text-left">We will send an email with a link to reset your password.</p>
        <form method="post" autocomplete="off">
            {% csrf_token %}

            {{ form.non_field_errors }}

            <div class="form--row">
                {{ form.email }}
                <small>{{ form.email.help_text }}</small>
                {{ form.email.error }}
            </div>

            {% if should_use_recaptcha %}
                {{ form.captcha }}
            {% endif %}

            <div>
                <a id="cancel_button" class="button button--secondary button--secondary--light" href="{% url 'teacher_login' %}">Cancel</a>
                <button id="reset_button" type="submit" class="button button--primary">Reset password</button>
            </div>
        </form>
    {% else %}
        <div id="reset_password_student_page"></div>
        <h4 class="center-block">Reset password</h4>
        <h5>Please enter your username</h5>
        <p class="text-left">We will send an email with a link to reset your password.</p>
        <form method="post" autocomplete="off">
            {% csrf_token %}

            {{ form.non_field_errors }}

            <div class="form--row">
                {{ form.username }}
                <small>{{ form.username.help_text }}</small>
                {{ form.username.error }}
            </div>

            {% if should_use_recaptcha %}
                {{ form.captcha }}
            {% endif %}

            <div>
                <a id="cancel_button" class="button button--secondary button--secondary--light" href="{% url 'independent_student_login' %}">Cancel</a>
                <button id="reset_button" type="submit" class="button button--home">Reset password</button>
            </div>
        </form>
    {% endif %}
{% endblock form_content %}
