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

{% block title %}Admin Panel{% endblock %}

{% block body %}
    <div class="container mt-3 mt-md-4">
        <div class="row">
            <div class="col-md-6 offset-md-3">
                <div class="card">
                    <h4 class="card-header font-weight-bold text-danger">
                        {{- 'trans.Admin Panel Sign In' | trans -}}
                    </h4>

                    <div class="card-body">
                        <form method="post" class="formAdminLogin">
                            {% if error %}
                                <div class="alert alert-danger">
                                    {{ error.messageKey|trans(error.messageData, 'security') }}
                                </div>
                            {% endif %}

                            {% include 'form/_flash_above_form.html.twig' %}

                            <h1 class="h3 mb-3 font-weight-normal">{{ 'trans.Login as admin' | trans }}</h1>

                            <div class="form-group">
                                <label for="inputEmail" class="sr-only">{{ 'trans.Email' | trans }}</label>
                                <input {{- ' ' -}}
                                        type="email" {{- ' ' -}}
                                        value="{{ last_username }}" {{- ' ' -}}
                                        name="email" {{- ' ' -}}
                                        id="inputEmail" {{- ' ' -}}
                                        class="form-control" {{- ' ' -}}
                                        placeholder="{{ 'trans.Email' | trans }}" {{- ' ' -}}
                                        required {{- ' ' -}}
                                        autofocus {{- ' ' -}}
                                        tabindex="0" {{- ' ' -}}
                                        autocomplete="username" {{- ' ' -}}
                                >
                            </div>

                            <div class="form-group">
                                <label for="inputPassword" class="sr-only">{{ 'trans.Password' | trans }}</label>
                                <input
                                        type="password" {{- ' ' -}}
                                        name="password" {{- ' ' -}}
                                        id="inputPassword" {{- ' ' -}}
                                        class="form-control" {{- ' ' -}}
                                        placeholder="{{ 'trans.Password' | trans }}" {{- ' ' -}}
                                        required {{- ' ' -}}
                                        tabindex="0" {{- ' ' -}}
                                        autocomplete="current-password" {{- ' ' -}}
                                >
                            </div>

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

                            <div class="form-group">
                                <button class="btn btn-primary btn-block" type="submit">
                                    {{- 'trans.Sign in' | trans -}}
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}
