{% extends 'base_security.html.twig' %}
{% block title %}Přihlášení{% endblock %}
{% block body %}
    <div class="login-box">
        <div class="login-logo">
            <a href="{{ path('login') }}">Měření teplot</a>
        </div>
        <div class="card">
            {% for message in app.flashes('good') %}
                <div class="flash-notice pull-right col-xs-12 " style="padding:0;">
                    <div class="alert alert-success alert-dismissible fade show" role="alert">
                        <strong>{{ message|raw }}</strong>
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                </div>
            {% endfor %}
            {% for message in app.flashes('bad') %}
                <div class="flash-notice pull-right col-xs-12 " style="padding:0;">
                    <div class="alert alert-danger alert-dismissible fade show" role="alert">
                        <strong>{{ message|raw }}</strong>
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                </div>
            {% endfor %}
            {% if error %}
                <div class="flash-notice pull-right col-xs-12 " style="padding:0;">
                    <div class="alert alert-danger alert-dismissible fade show" role="alert">
                        <strong>{{ error.messageKey|trans(error.messageData, 'security') }}</strong>
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                </div>
            {% endif %}
            <div class="card-body login-card-body">
                <p class="login-box-msg">Přihlášení</p>
                <form action="{{ path('login') }}" method="post">
                    <div class="input-group mb-3">
                        <input type="text" class="form-control" placeholder="Uživatelské jméno" id="username" name="_username" autocomplete="username">
                        <div class="input-group-append">
                            <div class="input-group-text">
                                <span class="fas fa-user"></span>
                            </div>
                        </div>
                    </div>
                    <div class="input-group mb-3">
                        <input type="password" class="form-control" placeholder="Heslo" id="password" name="_password">
                        <div class="input-group-append">
                            <div class="input-group-text">
                                <span class="fas fa-lock"></span>
                            </div>
                        </div>
                    </div>
                    <div class="row">
                        <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
                        <!-- /.col -->
                        <div class="col-12">
                            <button type="submit" class="btn btn-primary btn-block">Přihlásit se</button>
                        </div>
                        <!-- /.col -->
                    </div>
                </form>
            </div>
            <!-- /.login-card-body -->
        </div>
    </div>
    <!-- /.login-box -->
{% endblock %}
