{#
 * Copyright (C) 2014-2015, Champs Libres Cooperative SCRLFS,
 <info@champs-libres.coop> / <http://www.champs-libres.coop>
 *
 * This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 *  License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
#}
<!DOCTYPE html>
<html lang="{{ app.request.locale }}">
    <head>
        <meta charset="UTF-8" />
        <title>
            {{ 'Login to %installation_name%' | trans({ '%installation_name%' : installation.name } ) }}
        </title>
        <link rel="shortcut icon" href="{{ asset('build/images/favicon.ico') }}" type="image/x-icon">
        {{ encore_entry_link_tags('page_login') }}
    </head>
    <body>
        <div id="content">
            {{ include('@ChillMain/Login/_login-logo.html.twig') }}

            {% if error is not null %}
                <p>{{ error.message|trans }}</p>
            {% endif %}

            <form method="POST" action="{{ path('login_check') }}">
                <label for="_username">{{ 'Username'|trans }}</label>
                <input type="text" name="_username" value="{{ last_username }}" id="_username" />
                <br/>
                <label for="_password">{{ 'Password'|trans }}</label>
                <input type="password" name="_password" id="_password" />
                <input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}" />
                <br/>
                <button type="submit" name="login">{{ 'Login'|trans }}</button>
            </form>

            <p class="forgot-password-link"><a href="{{ path('password_request_recover') }}">{{ 'Forgot your password ?'|trans }}</a></p>

            {{ include('@ChillMain/Login/_footer.html.twig') }}
        </div>

        {{ encore_entry_script_tags('page_login') }}
    </body>
</html>
