{% extends 'uniauth/base-site.html' %}

<!-- Page-specific headers -->
{% block head %}

<title>Uniauth | Reset</title>

<style>
</style>

{% endblock %}

<!-- Page Content -->
{% block content %}

<!-- If the password reset URL was valid -->
{% if validlink %}

<div id="password-reset-verify-success-form-spacer" class="spacer"></div>

<div id="password-reset-verify-success-form-wrapper" class="uniauth-wrapper wrapper wrapper-content">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins shadow-lg">
                <div class="ibox-content">

                    {% if form.errors %}
                    <div class="row">
                        <div class="col-lg-12">
                            <div class="form-group has-error">
                                <span id="error-text" class="form-error help-block">
                                    {% for key, value in form.errors.items %}
                                        {% if forloop.counter == 1 %}
                                            {{ value.as_text|slice:"2:" }}
                                        {% endif %}
                                    {% endfor %}
                                </span>
                            </div>
                        </div>
                    </div>
                    {% endif %}

                    <div class="row">
                        <div class="col-lg-12">
                            <span id="password-reset-verify-success-title" class="simple-title centered-title">Set a new password</span>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-lg-12">
                            <form method="POST" class="post-form">
                                {% csrf_token %}

                                <div class="row">
                                    <div class="col-lg-12">
                                        <div class="form-group signup-row">
                                            <label for="id_new_password1">New Password:</label>
                                            <input id="id_new_password1" name="new_password1" type="password" class="form-control input-block" value="" required />
                                            <span>Make sure it's at least 8 characters. Numbers and special characters recommended.</span>
                                        </div>
                                    </div>
                                </div>

                                <div class="row">
                                    <div class="col-lg-12">
                                        <div class="form-group signup-row">
                                            <label for="new_id_password2">Confirm Password:</label>
                                            <input id="new_id_password2" name="new_password2" type="password" class="form-control input-block" value="" required />
                                            <span>Enter the same password again, to confirm it.</span>
                                        </div>
                                    </div>
                                </div>

                                <button id="submit-btn" type="submit" class="save btn btn-action">Change my password</button>

                            </form>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>
</div>

<!-- If the password reset URL was invalid -->
{% else %}

<div id="password-reset-verify-failure-form-spacer" class="spacer"></div>

<div id="password-reset-verify-failure-form-wrapper" class="uniauth-wrapper wrapper wrapper-content">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox float-e-margins shadow-lg">
                <div class="ibox-content">
                    <div class="row">
                        <div class="col-lg-12">
                            <span class="simple-title">Reset link is invalid</span>
                            <br/><br/>
                            <span class="simple-followup">Check that the link was copied correctly, and was sent recently. Links will expire within a few days of being sent.</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

{% endif %}

{% endblock %}

<!-- Page specific JS -->
{% block script %}
{% endblock %}
