{% extends "@templates/"~template~"/view/base.html.twig" %}

{% block content %}
    <section class="resetPassword">
        <div class="grid-container">
            <div class="grid-x align-middle">
                <div class="cell header text-center">
                    <h1>Zresetuj swoje hasło</h1>
                </div>
            </div>
            {% for message in app.flashes('user.reset.success') %}
                <div class="grid-x messageNewAcount">
                    <div class="cell">
                        <div class="success callout">
                            <div class="flash-notice">
                                {{ message }}
                            </div>
                        </div>
                    </div>
                </div>
            {% else %}
                <div class="grid-x align-center">
                    <div class="cell text-center">
                        <p class="messagesResetPassword">Wpisz dwukrotnie nowe hasło do Twojego konta.</p>
                        {{ form_start(form) }}
                        {% if form_errors(form) is not empty %}
                            <div class="callout alert">
                                {{ form_errors(form) }}
                            </div>
                        {% endif %}
                        <div class="fieldPassword">
                            {% if form_errors(form.password.first) is not empty %}
                                <div class="callout alert">
                                    {{ form_errors(form.password.first) }}
                                </div>
                            {% endif %}
                            {{ form_widget(form.password.first, {'attr': {'class': 'float-center'}}) }}
                        </div>
                        <div class="fieldPassword">
                            {% if form_errors(form.password.second) is not empty %}
                                <div class="callout alert">
                                    {{ form_errors(form.password.second) }}
                                </div>
                            {% endif %}
                            {{ form_widget(form.password.second, {'attr': {'class': 'float-center'}}) }}
                        </div>
                        <div class="formLoginButton text-center">
                            <button type="submit" class="button">
                                <span>ZRESETUJ HASŁO</span>
                            </button>
                        </div>
                        {{ form_end(form) }}
                    </div>
                </div>
            {% endfor %}
            <div class="grid-x forgotPassword">
                <div class="cell text-center">
                    <a href="{{ path('wi_front_user_login') }}" title="zaloguj się">
                        <span>Przypomniałeś sobie hasło? <strong>Zaloguj się.</strong></span>
                    </a>
                </div>
            </div>
        </div>
    </section>
{% endblock %}