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

{% block content %}

  {% if form.errors %}
    <p>{% trans "Wrong username or/and password" %}</p>
  {% endif %}

  {% if next %}
    {% if user.is_authenticated %}
      <p>{% trans "You don't have access to this page" %}</p>
    {% else %}
      <p>{% trans "Connect to see this page" %}</p>
    {% endif %}
  {% endif %}
<div style="display: block; margin-left: auto; margin-right: auto;">
  <form method="post" action="{% url 'login' %}" style="display: block; margin-left: auto; margin-right: auto;">
    {% csrf_token %}
    <table>
      <tr>
        <td>{{ form.username.label_tag }}</td>
        <td>{{ form.username }}</td>
      </tr>
      <tr>
        <td>{{ form.password.label_tag }}</td>
        <td>{{ form.password }}</td>
      </tr>
    </table><br>
    <div style="padding-left: 12.5em;"><input class="button-link" type="submit" value="Connexion" /></div>
    <input type="hidden" name="next" value="{{ next }}" />
  </form>
</div><br>

  {# Assumes you setup the password_reset view in your URLconf #}
  <div style="padding-left: 10.5em;"><p><a href="{% url 'password_reset' %}">{% trans "Forgotten password" %}?</a></p></div>

{% endblock %}