{% extends "security/panel.html" %}
{% block panel_image %}
<div class="pr-4">
 <img src="{{ url_for('static', filename='img/login.svg') }}" alt="{{ _('Login') }}">
</div>
{% endblock %}
{% block panel_title %}{{ _('Login') }}{% endblock %}
{% block panel_body %}
{% if config.SERVER_MODE %}
<form action="{{ url_for('authenticate.login') }}" method="POST" name="login_user_form">
    {{ login_user_form.hidden_tag() }}
    {% set user_language = request.cookies.get('PGADMIN_LANGUAGE') or 'en' %}
    {{ render_username_with_errors(login_user_form.email, "text") }}
    {{ render_field_with_errors(login_user_form.password, "password") }}
    <button class="btn btn-primary btn-block btn-login" type="submit" value="{{ _('Login') }}">{{ _('Login') }}</button>
    <div class="form-group row mb-3 c user-language">
        <div class="col-7"><span class="help-block">{{ _('<a href="%(url)s" class="text-white">Forgotten your password</a>?', url=url_for('browser.forgot_password')) }}</span></div>
        <div class="col-5">
            <select class="form-control" name="language" value="{{user_language}}">
                {% for key, lang in config.LANGUAGES.items() %}
                <option value="{{key}}" {% if user_language == key %}selected{% endif %}>{{lang}}</option>
                {% endfor %}
             </select>
        </div>
    </div>
</form>
{% endif %}
{% endblock %}
