{% extends "iconolab_base.html" %}

{% block content %}

<div class="col-md-6 col-md-offset-3">
    <h3 class="text-center">Se connecter</h3>
    {% if form.errors %}
    <div class="alert alert-danger">Combinaison identifiant/mot de passe incorrecte. Veuillez réessayer.</div>
    {% endif %}
    <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.name == "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}}">
      <p><a href="{% url 'password_reset' %}">Mot de passe oublié ?</a></p>
      <input type="submit" value="S'identifier"  class="btn btn-block btn-primary">
    </form>
</div>

{% endblock %}
