{% extends "site_base.html" %}

{% load account_tags %}
{% load i18n %}
{% load bootstrap %}

{% block body_class %}account account-login{% endblock %}
{% block head_title %}{% trans "Log in" %}{% endblock %}

{% block body %}
    <form method="POST" action="{% url "account_login" %}" autocapitalize="off" {% if form.is_multipart %} enctype="multipart/form-data"{% endif %}>
        <legend>{% trans "Log in to your account" %}</legend>
        {% csrf_token %}
        {{ form|bootstrap }}
        {% if redirect_field_value %}
            <input type="hidden" name="{{ redirect_field_name }}" value="{{ redirect_field_value }}" />
        {% endif %}
        <div class="form-actions">
            <button>{% trans "Log in" %}</button>
        </div>

        <a href="{% url "account_password_reset" %}" class="forgot-password">{% trans "Forgot your password?" %}</a>

        {% if ACCOUNT_OPEN_SIGNUP %}
            <p class="login-signup">
                {% trans "Don't have an account?" %}
                <a href="{% urlnext 'account_signup' %}">{% trans "Sign up" %}</a>
            </p>
        {% endif %}
    </form>
{% endblock %}

{% block scripts %}
    {{ block.super }}
    <script type="text/javascript">
        $(document).ready(function() {
            $('#id_username').focus();
        });
    </script>
{% endblock %}
