{% extends 'adminlte2/layouts/login.html' %}

{% load i18n %}

{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock title %}

{% block body_class %}{{ block.super }} login{% endblock body_class %}

{% block login_logo_href %}
    {% url 'admin:index' %}
{% endblock login_logo_href %}

{% block login_logo_text %}{{ site_header|default:_('Django administration') }}{% endblock login_logo_text %}

{% block login_custom_messages %}
    {% if form.errors and not form.non_field_errors %}
        <div class="alert alert-danger alert-dismissible">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
            <h4><i class="icon fa fa-ban"></i> Alert!</h4>
            <p class="errornote">
                {% if form.errors.items|length == 1 %}
                    {% trans "Please correct the error below." %}
                {% else %}
                    {% trans "Please correct the errors below." %}
                {% endif %}
            </p>
        </div>
    {% endif %}

    {% if user.is_authenticated %}
        <div class="alert alert-warning alert-dismissible">
            <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <h4><i class="icon fa fa-warning"></i> Alert!</h4>
            <p class="errornote">
                {% blocktrans trimmed %}
                    You are authenticated as <b>{{ username }}</b>, but are not authorized to
                    access this page. Would you like to login to a different account?
                {% endblocktrans %}
            </p>
        </div>
    {% endif %}
{% endblock login_custom_messages %}

{% block login_form_action %}{{ app_path }}{% endblock login_form_action %}

{% block login_links %}
    {% url 'admin_password_reset' as password_reset_url %}
    {% if password_reset_url %}
        <div class="password-reset-link">
            <a href="{{ password_reset_url }}">{% trans 'Forgotten your password or username?' %}</a>
        </div>
    {% endif %}
{% endblock login_links %}
