{% extends "@ChamiloUser/layout.html.twig" %}

{% block fos_user_content %}
    {% block sonata_user_login %}
        {% block sonata_user_login_error %}
            {% if error %}
                <div class="alert alert-danger alert-danger">
                    {{ error.messageKey|trans(error.messageData, 'security') }}
                </div>
            {% endif %}
        {% endblock %}

        <div class="login-box-body">
            {% block sonata_user_login_form %}
                <form id="form-login-user" action="{{ path("login") }}" method="post" role="form">

                    <div class="wrap-input validate-input m-b-23" data-validate = "{{ 'Username is required' | trans }}">
                        {{ form_label(form._username, 'Username' | trans , {'label_attr': {'class': 'label-input'}}) }}
                        {{ form_widget(form._username, {'attr': {'placeholder': 'Type your username', 'class': 'input-login'}}) }}
                        <i class="focus-input fas fa-user fa-lg"></i>
                    </div>

                    <div class="wrap-input validate-input" data-validate="Password is required">
                        {{ form_label(form._password, 'Password' | trans , {'label_attr': {'class': 'label-input'}})}}
                        {{ form_widget(form._password, {'attr': {'placeholder': 'Type your password', 'class': 'input-login'}}) }}
                        <i class="focus-input fas fa-lock fa-lg"></i>
                    </div>

                    {{ form_widget(form,{ 'attr': {'class': 'login'} }) }}
                    <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
                    <div class="form-group has-feedback">
                        <div class="checkbox control-group">
                            <label for="remember_me">
                                <input type="checkbox" id="remember_me"
                                       name="_remember_me" value="on"/>
                                {{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}
                            </label>
                        </div>
                    </div>

                    <div class="form-group has-feedback">
                        {#<a href="{{ path('fos_user_resetting_request') }}">#}
                        <a href="{{ path('legacy_main', { 'name' : 'auth/lostPassword.php'}) }}">

                            {{ 'forgotten_password'|trans({}, 'SonataUserBundle') }}
                        </a>
                    </div>

                    <div class="form-group">
                        <input type="submit" id="_submit" name="_submit"
                                   class="btn btn-lg btn-primary btn-block"
                                   value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}"/>
                    </div>
                </form>
            {% endblock %}
        </div>
    {% endblock %}

{% endblock fos_user_content %}
