{% extends "auth_base.html" %}
{% block title %}Reset password{% endblock %}
{% block page %}
{% if ok %}
    <form>
    <div class="ok">Email sent. Please check your email.</div>
    </form>
{% else %} 
    <form action="{{ url_for('auth.reset_password') }}" method="post" accept-charset="utf-8">
    {% if error == 'NOT FOUND' %}
    <div class="error">We couldn't find an account for that username. 
    Maybe you used a different one?</div>
    {% elif error == 'WRONG TOKEN' %}
    <div class="error">Something is wrong with the link to reset your password.<br>
    Try to copy and paste it from the email or to reset your password again.
    </div>
    {% endif %}

    <h1>Reset your password</h1>
    <p>Enter your user name and a verification token will be sent to you. 
    You will be able to choose a new password for your account.</p>

    <label>User<br>
    <input type="text" name="login" id="auth_login" value="{{ credentials.login|e }}" 
    size="20" maxlength="254" tabindex="1">
    </label>

    <fieldset>
    <a href="{{ url_for('auth.sign_in') }}" tabindex="5">Log in</a>
    <button type="submit" tabindex="4">Reset password &raquo;</button>
    </fieldset> 

    </form>
{% endif %}
{% endblock %}
