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

{% block content %}
    <section class="login">
        <div class="grid-container">
            <div class="grid-x">
                <div class="cell">
                    <h1>Zaloguj się</h1>
                </div>
            </div>
            {% if error %}
                <div class="grid-x messagesCallout">
                    <div class="cell">
                        <div class="callout alert">
                            {{ error.message|trans }}
                        </div>
                    </div>
                </div>
            {% endif %}
            {% for message in app.flashes('activate.success') %}
                <div class="grid-x messagesCallout">
                    <div class="cell">
                        <div class="callout success">
                            {{ message }}
                        </div>
                    </div>
                </div>
            {% endfor %}
            <div class="grid-x align-center">
                <div class="cell">
                    <form action="{{ path('wi_front_user_login') }}" method="post" class="loginUserForm">
                        <div class="fieldLogin">
                            {% if app.request.get('relocate') is not empty %}
                                <input type="hidden" name="relocate" value="{{ app.request.get('relocate') }}">
                            {% endif %}
                            <input type="hidden" name="_user_csrf_security_token" value="{{ csrf_token('user_authenticate') }}">
                            <input type="text" id="username" name="_user_username" placeholder="WPISZ E-MAIL" value="{{ lastUsername }}" class="float-center" />
                        </div>
                        <div class="fieldPassword">
                            <input type="password" id="password" placeholder="WPISZ HASŁO" name="_user_password" class="float-center" />
                        </div>
                        <div class="formLoginButton text-center">
                            <button type="submit" class="button">
                                <span>ZALOGUJ SIĘ</span>
                            </button>
                        </div>
                    </form>
                </div>
            </div>
            <div class="grid-x forgotPassword">
                <div class="cell text-center">
                    <a href="{{ path('wi_front_user_forgot_password') }}" title="nie pamiętam hasła">
                        <span>nie pamiętam hasła</span>
                    </a>
                </div>
            </div>
        </div>
    </section>
    <section class="notAccount">
        <div class="grid-container">
            <div class="grid-x">
                <div class="cell">
                    <h3>Nie masz jeszcze konta?</h3>
                    <div class="boxRegisterButton">
                        <a href="{{ path('wi_front_user_register') }}" title="Zarejestruj się" class="button">
                            <span>ZAREJESTRUJ SIĘ</span>
                        </a>
                    </div>
                </div>
            </div>
        </div>
    </section>
{% endblock %}