{% extends "admin/base_site.html" %}
{% load i18n admin_static %}

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

{% block usertools %}{% endblock %}

{% block nav-global %}{% endblock %}

{% block content_title %}{% endblock %}

{% block breadcrumbs %}{% endblock %}

{% block body %}
    <div class="login-title">
        {% blocktrans %}<span class="bright">Admin</span> Site{% endblocktrans %}
    </div>

    <div class="login-container" id="content-main">
        <div class="login-container-header">
            {% trans "Log in" %}
        </div>
        <div class="login-container-content">
            <form action="{{ app_path }}" method="post" class="login-form" id="login-form">{% csrf_token %}
                {% if form.errors and not form.non_field_errors %}
                    <p class="errornote">
                        {% if form.errors.items|length == 1 %}{% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}{% endif %}
                    </p>
                {% endif %}

                {% if form.non_field_errors %}
                    {% for error in form.non_field_errors %}
                        <p class="errornote">
                            {{ error }}
                        </p>
                    {% endfor %}
                {% endif %}
                <div class="form-row{% if form.username.errors %} errors{% endif %}">
                    {{ form.username.errors }}
                    <label{% if form.username.field.required %} class="required"{% endif %} for="{{ form.username.id_for_label }}">{{ form.username.label }}</label> {{ form.username }}
                </div>
                <div class="form-row{% if form.password.errors %} errors{% endif %}">
                    {{ form.password.errors }}
                    <label{% if form.password.field.required %} class="required"{% endif %} for="{{ form.password.id_for_label }}">{{ form.password.label }}</label> {{ form.password }}
                    <input type="hidden" name="next" value="{{ next }}" />
                </div>
                {% 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 %}
                <div class="login-container-submit-row">
                <label>&nbsp;</label><input type="submit" value="{% trans 'Log in' %}" />
                </div>
            </form>
        </div>
    </div>
    <img src="//jet.geex-arts.com/ping.gif" style="display: none;">

    <script type="text/javascript">
        document.getElementById('id_username').focus()
    </script>
{% endblock %}
