{% extends "iconolab_base.html" %}

{% block content %}

{% if form.errors %}
<p>Your username and password didn't match. Please try again.</p>
{% endif %}

{% if next %}
    {% if user.is_authenticated %}
    <p>Your account doesn't have access to this page. To proceed,
    please login with an account that has access.</p>
    {% else %}
    <p>Please login to see this page.</p>
    {% endif %}
{% endif %}

<div class='col-md-6 center centerer'>
    <h3>Se connecter</h3>
    <form class="form" action="{% url 'account:login' %}" method="POST">
      {% csrf_token %}
      {% for field in form %}
      <fieldset class="form-group">
        <label class="control-label" for="id_{{ field.name }}">{{ field.label }}</label>
        <input type="{% if field.label == "Username" %}text{% else %}password{% endif %}" class="form-control"
          name="{{ field.name }}"
          id="id_{{ field.name }}" > 
        {% if field.errors %}{{ field.errors }}{% endif %}
      </fieldset>
      {% endfor %}
      <input type="hidden" name="next" value="{{next}}">
      <input type="submit" value="Submit"  class="btn btn-primary">
    </form>
</div>

{% endblock %}