{% extends 'base.html' %}
{% load i18n staticfiles tz stats %}
{% block title %}{% trans 'Login' %} / {{ block.super }}{% endblock title %}

{% block content %}
    <section id="content">
        <div class="wrapper">
            <div class="content_head">
                <div class="content_title">
                    {% trans 'Login' %}
                </div>
            </div>
            <form class="form" action="" method="post" onsubmit="this.submit.disabled=true;">
                {% if form.non_field_errors %}
                    <div class="non_field_errors">
                        {% for error in form.non_field_errors %}
                            <div class="error">{{ error }}</div>
                        {% endfor %}
                    </div>
                {% endif %}
                {% csrf_token %}
                <input type="hidden" name="next" value="{{ next }}"/>
                {% for field in form %}
                    <div class="form_field {{ field|widget_type }}">
                        <label for="{{ field.id_for_label }}">{{ field.label }}</label>
                        {% if field.help_text %}
                            <div class="help_text">{{ field.help_text }}</div>
                        {% endif %}
                        <div class="field_wrapper">{{ field }}</div>
                        {% if field.errors %}
                            {% for error in field.errors %}
                                <div class="error">{{ error }}</div>
                            {% endfor %}
                        {% endif %}
                    </div>
                {% endfor %}
                <div class="buttons">
                    <button type="submit" class="green">{% trans 'Login' context 'action' %}</button>
                </div>
            </form>
            {% if SEND_EMAIL %}
            <div class="form_links">
                <a href="{% url 'users:password_reset' %}">{% trans 'Forgot password' %}</a>
{#                <a href="#">{% trans 'Confirm registration' %}</a>#}
            </div>
            {% endif %}
        </div>
    </section>
{% endblock content %}

{% block bottom %}
    {{ block.super }}
    <script src="{% static 'js/form.js' %}"></script>
{% endblock bottom %}
