{% load i18n authentic2 staticfiles %}

<div class="columns small-12 loginform">
    <form method="post" action="">
        {% csrf_token %}
        {% for hidden in form.hidden_fields %}
            {{ hidden }}
        {% endfor %}
        {% if form.errors %}
        <div class="row">
            <div class="columns small-10 small-centered">
                {% for error in form.non_field_errors %}
                    <small class="error">{{ error }}</small>
                {% endfor %}
            </div>
        </div>
        {% endif %}
        <div class="row">
            <div class="columns small-10 small-centered">
                <div class="columns small-12 medium-4">{{ form.username.label_tag }}</div>
                <div class="columns small-12 medium-8">
                    {{ form.username }}
                    {% for error in form.username.errors %}
                        <small class="error">{{ error }}</small>
                    {% endfor %}
                </div>
                <div class="columns small-12"></div>
            </div>
        </div>
        <div class="row">
            <div class="columns small-10 small-centered">
                <div class="columns small-12 medium-4">{{ form.password.label_tag }}</div>
                <div class="columns small-12 medium-8">
                    {{ form.password }}
                    {% for error in form.password.errors %}
                        <small class="error">{{ error }}</small>
                    {% endfor %}
                </div>
            </div>
        </div>

        {% if can_reset_password %}
            <div class="columns small-12 text-center">
                <a href="{% url 'password_reset' %}{% if request.GET.next %}?next={{ request.GET.next|urlencode }}{% endif %}">{% trans "Mot de passe oublié ?" %}</a>
            </div>
        {% endif %}
        <div class="columns small-12 text-center">
            <button type="submit" class="submit radius large inverted-button" name="{{ submit_name }}" value="{% trans "Log in" %}"><span class="icon-cadenas"></span> <span class="text">{%  trans "SE CONNECTER" %}</span></button>
        </div>
        {% comment %}
        {% if cancel %}
            <input type="submit" name="cancel" value="{% trans 'Cancel' %}"/>
        {% endif %}
        {{ form.as_p }}
        {% endcomment %}
    </form>

{% comment %}
    <div class="columns small-12 line"></div>

    <div class="columns small-12 createbox text-center">
        <h4>{% trans "Pas encore inscrit ?" %}</h4>
        <a id="account_create" class="submit white large button radius red-button"><span class="icon-paper"></span> <span class="text">{%  trans "CRÉER UN COMPTE" %}</span></a>
        {% comment %}
        {% if registration_authorized %}
            <p>→ {% trans "Not a member?" %} <a href="{{ registration_url }}"{% if request.GET.next %}?next={{ request.GET.next|urlencode }}{% endif %}>{% trans "Register!" %}</a></p>
        {% endif %}
        {% encomment %}
    </div>
{% endcomment %}
</div>


{% addtoblock "js-endpage" %}
<script type="text/javascript" src="{% static "authentic2/js/js_seconds_until.js" %}"></script>
{% endaddtoblock %}
