{% extends 'base.html.twig' %}

{% block pagewrapper %}
    <style>
        #page-wrapper { max-width: 1000px; margin:auto !important;}
    </style>

{{ form_start(form) }}
    <h1 class="page-title">
    Réinitialisation du mot de passe
    </h1>

    {{ form_widget(form.submit) }} 

    {% if form.captcha is defined %}
        {{ form_label(form.captcha) }}
        {{ form_widget(form.captcha) }}
    {% endif %}

    <br><br>
    
    {% if app.session.flashbag.has('error') %}
        <div class='alert alert-danger' style='margin: 5px 0px'>
            <strong>Erreur</strong><br>
            {% for flashMessage in app.session.flashbag.get('error') %}
                {{ flashMessage }}<br>
            {% endfor %}
        </div>
    {% endif %}

    {% if app.session.flashbag.has('notice') %}
        <div class='alert alert-info' style='margin: 5px 0px'>
            <strong>Information</strong><br>
            {% for flashMessage in app.session.flashbag.get('notice') %}
                {{ flashMessage }}<br>
            {% endfor %}
        </div>
    {% endif %}

    <div class="card">
        <div class="card-header">
            <i class="fa fa-key fa-fw"></i> Etape 02
        </div>

        <div class="card-body">
            {{ form_row(form.password) }}

            <div class='alert alert-info' style='font-size: 80%;padding: 5px;margin-top: -10px;'>
                Le mot de passe doit comporter au moins {{ minpassword }} caractères, avec obligatoirement des lettres, chiffres et caractères spéciaux.
            </div
        </div>
    </div>
{{ form_end(form) }}
{% endblock %}

{% block localjavascript %}
    $(document).ready(function() {
        $("body").removeClass("body");
        $("body").addClass("simple");
        $("#page-wrapper").css("margin","auto");
        $("#page-wrapper").css("max-width","1000px");
        $("#page-wrapper").css("border-left","none");
    });
{% endblock %}
