{#
.. screenshot:: |canaille|/reset-code/user
   :align: right
   :width: 275px

   The password reinitialization code page.

Password forgotten code page.

This page displays a form asking for the code sent to the email address of users who cannot remember their password.

#}
{% extends theme('base.html') %}
{% import 'macro/form.html' as fui %}
{% import 'core/partial/login_field.html' as login_field %}

{%- block title -%}
    {%- trans -%}Forgotten password{%- endtrans -%}
{%- endblock -%}

{% block content %}
    <div class="loginform">
        {% block header %}
            <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>
        {% endblock %}

        {% block message %}
            <div class="ui attached message">
                {% trans %}
                    Please enter the reset password code you received via email.
                {% endtrans %}
            </div>
        {% endblock %}

        <div class="ui attached clearing segment">
            {% call fui.render_form(form) %}
                {% block fields %}
                    {{ login_field.render_field(form.code, class="autofocus") }}
                {% endblock %}

                {% block buttons %}
                    <div class="ui right aligned container">
                        <div class="ui stackable buttons">
                            {% if features.has_registration %}
                                <a type="button" class="ui right floated button" href="{{ url_for('core.account.join') }}">{{ _("Create an account") }}</a>
                            {% endif %}
                            <a type="button" class="ui right floated button" href="{{ url_for('core.auth.login') }}">{{ _("Login page") }}</a>
                            <button type="submit" class="ui right floated {% if request.method != "POST" or form.errors %}primary {% endif %}button">
                                {{ _("Submit") }}
                            </button>
                        </div>
                    </div>
                {% endblock %}
            {% endcall %}
        </div>
    </div>
{% endblock %}
