{% extends "base_extra.html" %}
{% block title %}Password Reset Confirm{% endblock %}
{% load content_widgets %}

{% block content %}
<div class="card card-outline card-primary">
    <div class="card-header text-center">
        {% logo False %}
    </div>
    <div class="card-body">
        {% if validlink %}
        <p>Please enter your new password twice so we can verify you typed it in correctly.</p>
        <form method="post">{% csrf_token %}
            <input class="hidden" type="hidden" autocomplete="username" value="{{ form.user.get_username }}">
            <div class="input-group">
                <input name="new_password1" type="password" class="form-control {% if form.new_password1.errors %}is-invalid{% endif %}" placeholder="New Password">
                <div class="input-group-append">
                    <div class="input-group-text">
                        <span class="fas fa-lock"></span>
                    </div>
                </div>
            </div>
            {{ form.new_password1.errors }}
            <div class="input-group mt-3">
                <input name="new_password2" type="password" class="form-control {% if form.new_password2.errors %}is-invalid{% endif %}" placeholder="Confirm Password">
                <div class="input-group-append">
                    <div class="input-group-text">
                        <span class="fas fa-lock"></span>
                    </div>
                </div>
            </div>
            {{ form.new_password2.errors }}
            <div class="row mt-3">
                <div class="col-lg-12">
                    <button type="submit" class="btn btn-primary btn-block">Change my password</button>
                </div>
            </div>
        </form>
        {% else %}
        The password reset link was invalid, possibly because it has already been used.  Please request a new password reset.
        {% endif %}
    </div>
</div>
{% endblock %}