{% extends 'base.html' %}
{% import 'fomanticui.j2' as sui %}
{% import 'flask.j2' as flask %}

{% block content %}
<div class="loginform">
    <h3 class="ui top attached header">
        {% if logo_url %}
            <img class="ui image" src="{{ logo_url }}">
        {% endif %}
        <div class="content">
        {% trans %}Forgotten password{% endtrans %}
        </div>
    </h3>

    {{ flask.messages() }}

    <div class="ui attached message">
        {% trans %}
        After this form is sent, if the email address or the login you provided
        exists, you will receive an email containing a link that will allow you
        to reset your password.
        {% endtrans %}
    </div>
    <div class="ui attached clearing segment">
        <form method="POST"
          id="{{ form.id or form.__class__.__name__|lower }}"
          action="{{ request.url }}"
          role="form"
          class="ui form"
          >

            {{ form.hidden_tag() if form.hidden_tag }}
            {{ sui.render_field(form.login, icon="user") }}

            <button type="submit" class="ui right floated {% if request.method != "POST" or form.errors %}primary {% endif %}button">
            {% if request.method == "POST" %}
                {{ _("Send again") }}
            {% else %}
                {{ _("Send") }}
            {% endif %}
            </button>
            <a type="button" class="ui right floated button" href="{{ url_for('canaille.account.login') }}">{{ _("Login page") }}</a>
        </form>
    </div>
</div>
{% endblock %}

