{% extends 'layout.html' %}
{% block content %}
<div class="row justify-content-center mt-5">
    <div class="col-sm-12 col-md-6 col-lg-4">
        <div class="card shadow">
            <div class="card-body">
                {% if context.reset_url_error == True %}
                    <div class="text-danger text-center">
                        <i class="ri-alert-fill"></i> ILS Reset URL not valid. Please contact your system administrator.
                    </div>
                {% else %}
                    {% if context.reset == False %}
                        <p class="lead">
                            Provide your {{ context.domain }} user account to start the password reset process.
                        </p>
                        <div class="text-center">
                            <form action="/" method="post">
                                {% if context.error %}
                                    <div class="text-danger text-center">
                                        <i class="ri-alert-fill"></i> {{ context.error }}
                                    </div>
                                {% endif %}

                                <div class="mb-3 text-center mt-2">
                                    <input type="text" class="form-control" id="username" name="username" placeholder="ILS user account" required>
                                </div>
                                <div class="text-center mb-1">
                                    <button type="submit" class="btn btn-primary w-100">Start ILS Password Reset</button>
                                </div>
                            </form>
                        </div>
                        {% else %}
                            <div class="text-center">
                                <h3>Steps to complete</h3>
                                <p>A new tab should have opened to the {{ context.domain }} terminal website. If not, click  <a href="{{ context.reset_url }}" target="_blank">here</a> to open the terminal page to complete the following steps:</p>
                            </div>
                            <ol>
                                <li class="mb-3">Log into the {{ context.domain }} terminal web page using your current credentials.</li>
                                <li class="mb-3">Once logged in, click on the link to reset your password.</li>
                                <li class="mb-3">Submit the required form to complete the password reset process.
                                    <br><b>Note:</b> <i>domain/user name</i> field needs to be in the following format: <div class="text-center"><code style="display:block; padding-top:10px; font-size:1.25em;">{{ context.domain }}/username</code></div></li>
                            </ol>
                            <p class="text-center">
                                This window can be closed.
                            </p>
                        {% endif %}
                {% endif %}
            </div>
        </div>
    </div>
</div>
{% endblock %}