login.html 1.34 KB
{% extends "base.html" %}
{% load i18n %}
{% load url from future %}

{% block text-content %}
    {% if form.errors and not form.non_field_errors and not form.this_is_the_login_form.errors %}
        <p class="errornote">
            {% blocktrans count form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
        </p>
    {% endif %}

    {% if form.non_field_errors or form.this_is_the_login_form.errors %}
        {% for error in form.non_field_errors|add:form.this_is_the_login_form.errors %}
            <p class="errornote">
                {{ error }}
            </p>
        {% endfor %}
    {% endif %}

    <div id="content-main">
        <div id="login-box">
            <form action="" method="post" id="login-form">{% csrf_token %}
                <table>
                    {{ form.as_table }}
                </table>
                <div class="submit-row">
                    <label>&nbsp;</label>
                    <input type="submit" value="{% trans 'Log in' %}"/>
                </div>
            </form>

            <a href="{% url 'auth_password_reset' %}">{% trans 'I forgot my password' %}</a>
        </div>

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