{% extends "base.html" %}
{% load i18n %}

{% block content %}

<div class="row">
    <div class="medium-7 columns">
        <h2>Connexion</h2>

        <form method="post" action="{% url 'members:django.contrib.auth.views.login' %}">
            {% csrf_token %}
            {% if form.errors %}
        	<div class="alert-box alert">
                {% if form.errors.items|length == 1 %}
                    {% trans "Please correct the error below." %}{% else %}{% trans "Please correct the errors below." %}
                {% endif %}<br/>
                {% for error in form.non_field_errors %}{{ error|escape }}{% endfor %}
            </div>
        	{% endif %}

        	<table width="100%">
            	<tr>
            		<td>{{ form.username.label_tag }}</td>
            		<td>{{ form.username }}
                        {% if form.username.errors %}
                            <span class="error">{% for error in form.username.errors %}{{ error|escape }}{% endfor %}</span>
                        {% endif %}
                    </td>
            	</tr>
            	<tr>
            		<td>{{ form.password.label_tag }}
                    <small><a href="{% url 'members:password_reset' %}">Mot de passe oublié ?</a></small></td>
            		<td>{{ form.password }}
                        {% if form.password.errors %}
                            <span class="error">{% for error in form.password.errors %}{{ error|escape }}{% endfor %}</span>
                        {% endif %}
                    </td>
            	</tr>
        	</table>
        	<input type="submit" value="Coinnexion" class="button radius"/>
        	<input type="hidden" name="next" value="{{ next }}" />
    	</form>
    </div>
    <div class="medium-5 columns">
        <div class="panel callout" id="newcomers">
            <h3>Nouvel adhérent ?</h3>
            <p>Pour votre première connexion, il faut définir votre mot de passe.<br />
            <a href="{% url 'members:password_reset' %}"><i class="fa fa-arrow-right"></i>
 Initialiser mon mot de passe</a></p>
        </div>
    </div>

</div>

{% endblock %}
