{% extends '/admin/menu_left_admin.html.twig' %}

{% block title %} Modifier votre mot de passe {% endblock %}

{% block main %}

            {% if errors|length > 1 %}
                <div class="alert alert-danger">
                    Erreurs :
                    <ul>
                    {% for flashMessage in errors %}
                        <li>{{ flashMessage }}</li>
                    {% endfor %}
                    </ul>
                </div>
            {% else %}
                {% for flashMessage in errors %}
                    <div class="alert alert-danger">
                        Erreur :  {{ flashMessage }}
                    </div>
                {% endfor %}
            {% endif %}

            <div class="bloc-title mb-16">
                <h2 class="align-middle">Modifier mon mot de passe</h2>
            </div>
            <div class="row m-0">
                <div class="col-xs-5 plr-16 pt-16 pb-16 background-white">

                {{ form_start(form, { 'attr': { 'novalidate': 'novalidate' }}) }}
                    <div class="form-group mb-16">
                        {{ form_label(form.current) }}
                        {{ form_widget(form.current, { 'attr': { 'class': 'inscription plr-16' }}) }}
                        {{ form_errors(form.current) }}
                    </div>
                    <div class="form-group mb-16">
                        {{ form_label(form.new) }}
                        {{ form_widget(form.new, { 'attr': { 'class': 'inscription plr-16' }}) }}
                        {{ form_errors(form.new) }}
                        <p class="help-block">Minimum 8 caractères, une majuscule, une minuscule et un chiffre.</p>
                    </div>
                    <div class="form-group mb-24">
                        {{ form_label(form.confirmation) }}
                        {{ form_widget(form.confirmation, { 'attr': { 'class': 'inscription plr-16' }}) }}
                        {{ form_errors(form.confirmation) }}
                    </div>

                    <button type="submit" class="button-square" >Changer mot de passe</button>
                {{ form_end(form) }}

                </div>
            </div>

{% endblock %}