{% extends "login/layout/sidebar-layout.html.twig" %}

{% import "login/common/macros.html.twig" as auth_macro %}

{% block title %}
    {{ "Forgotten password" | trans }}
{% endblock %}

{% block sidebar %}
    <div class="well-large sidebar-block">
        <div class="row-fluid">
            <div class="span12">
                <div class="text-title">
                    {{ "Forgot your password?" | trans }}
                </div>
                <div class="sidebar-hint">
                    {{ "Enter your e-mail address to retrieve your password" | trans }}
                </div>
            </div>
        </div>
        <div class="row-fluid">
            <div class="span12">
                {{ auth_macro.flashes() }}
                <form
                    novalidate
                    name="forgottenPasswordForm"
                    action="{{ path("login_forgot_password") }}"
                    method="POST"
                >
                    {% if form.vars.errors|length > 0 %}
                        <div class="row-fluid">
                            <div class="span12">
                                {{ form_errors(form) }}
                            </div>
                        </div>
                    {% endif %}
                    <div class="row-fluid">
                        <div class="span12">
                            {{ auth_macro.fieldInput(form.email, "forgottenPasswordForm", "fa fa-envelope") }}
                        </div>
                    </div>
                    {{ form_rest(form) }}
                    <div class="row-fluid">
                        <div class="span12">
                            <button type="submit" class="btn btn-success btn-trigger">
                                {{ "Send" | trans }}
                            </button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
{% endblock %}

{% block scripts %}
    {{ parent() }}
    <script>
        authenticateApp.bootstrap({
            state: 'forgotPassword'
        });
    </script>
{% endblock %}
