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

{% block title %}Login | ArCOA{% endblock %}

{% block body %}

<div class="container mt-6 mb-6">
    <div class="has-text-centered">
        <img width="200px" src="{{ asset('img/Logo-ArCOA-def.png') }}" />
    </div>
    <h1 class="is-size-1 mt-6 mb-6 has-text-centered">ArCOA Digital Archive</h1>

    <div class="card" style="max-width: 40vw; margin: 0 auto;">
        {% if error %}
            <article class="message is-danger">
                <div class="message-body">Wrong user name and/or password. Please retry</div>
            </article>
        {% endif %}
        <form class="card-content pl-5 pr-5 pt-6" action="{{ path('app_login') }}" id="login" method="post">
            <div class="field">
                <h2 class="label is-size-3 has-text-centered">Sign in</h2>
            </div>
            <div class="field">
                <label class="label">User name</label>
                <p class="control">
                    <input class="input" name="_username" required type="text" placeholder="User name">
                </p>
            </div>
            <div class="field mt-5">
                <label class="label">Password</label>
                <p class="control has-icons-right">
                <input class="input" type="password" name="_password" required placeholder="Password" id="pass-field">
                <span class="icon is-small is-right is-clickable" id="show-pw">
                    <i class="fa fa-eye-slash"></i>
                </span>
                </p>
            </div>
            <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}">
            <div class="field mt-5">
                <p class="control" id="submit">
                    <button class="button is-link is-fullwidth" type="submit">
                        Sign in
                    </button>
                </p>
            </div>
        </form>
    </div>

</div>
{% endblock %}
