{% extends "@MapbenderCore/Login/info_box.html.twig" %}
{%- set title = 'fom.user.login.login.title' | trans -%}
{%- set submit_text = 'fom.user.login.login.login' -%}

{% block box_content_main %}
    {% if error %}
        <div class="alert alert-danger">
            <ul class="list-unstyled">
                <li>
                    <span class="glyphicon glyphicon-exclamation-sign"></span> {{ error.messageKey|trans(error.messageData, 'security') }}
                </li>
            </ul>
        </div>
    {% endif %}

    <form name="login" method="post" action="login/check">
        <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
        <div class="mb-3">
            <label class="form-label required" for="username">
                {{ 'fom.user.login.login.username' | trans }}
            </label>
            <input type="text" id="username" name="_username" required="required" autofocus="autofocus"
                   class="form-control form-control-lg" value="{{ last_username }}">
        </div>
        <div class="mb-3">
            <label class="form-label required" for="password">
                {{ 'fom.user.login.login.password' | trans }}
            </label>
            <input type="password" id="password" name="_password" required="required" class="form-control form-control-lg">
        </div>

        {{ parent() }}

        <div class="text-center">
            <input type="submit" data-test="mb-submit" class="btn btn-primary btn-lg login-button"
                   value="{{ (submit_text | default('mb.actions.save')) | trans }}"/>
        </div>
    </form>
{% endblock %}



{% block extra_links %}
    {% if selfregister == true %}
        <a class="linkButton" href="{{ path('fom_user_registration_form') }}"><i class="fas fa-caret-right"></i>&nbsp;{{ 'fom.user.login.login.register' | trans }}
        </a>
    {% endif %}
    {% if reset_password == true %}
        <a class="linkButton" href="{{ path('fom_user_password_form') }}"><i
                class="fas fa-caret-right"></i>&nbsp;{{ 'fom.user.login.login.forgot_password' | trans }}?</a>
    {% endif %}
{% endblock %}
