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

{% block title %}Přihlášení{% endblock %}

{% block body %}
    <form method="post" style="max-width: 400px;" class="needs-validation" novalidate>
        {% if error %}
            <div class="alert alert-danger">{{ error.messageKey|trans(error.messageData, 'security') }}</div>
        {% endif %}

        <h2 class="h2 card-title mb-3 font-weight-normal">Prosím, přihlašte se</h2>
        <hr>

        {% if app.user %}
            <div class="mb-3">
                Jste přihlášený jako {{ app.user.username }}, <a href="{{ path('app_logout') }}">Odhlásit</a>
            </div>
        {% endif %}



            <label for="inputUsername" class="sr-only">Přihlašovací jméno</label>
            <input type="text" value="{{ last_username }}" name="username" id="inputUsername" class="form-control" required autofocus
                   style="border-bottom-right-radius: 0; border-bottom-left-radius: 0;" placeholder="Přihlašovací jméno">
            <label for="inputPassword" class="sr-only">Heslo</label>
            <input type="password" name="password" id="inputPassword" class="form-control" required style="border-top-left-radius: 0;
                   border-top-right-radius: 0;" placeholder="Heslo">

        <div class="invalid-feedback">
            Prosím, zadejte korektní údaje
        </div>

        <input type="hidden" name="_csrf_token"
               value="{{ csrf_token('authenticate') }}"
        >

        {#
            Uncomment this section and add a remember_me option below your firewall to activate remember me functionality.
            See https://symfony.com/doc/current/security/remember_me.html

            <div class="checkbox mb-3">
                <label>
                    <input type="checkbox" name="_remember_me"> Remember me
                </label>
            </div>
        #}

        <br>

        <button class="btn btn-lg btn-outline-primary btn-block" type="submit">
            Přihlásit
        </button>
    </form>

{% endblock %}
