{% extends "iconolab_base.html" %}

{% load iconolab_tags %}

{% block content %}

<div class="col-md-6 col-md-offset-3">
    <h3 class="text-center">Créer un compte</h3>
    <form action="{% url 'account:register' %}" method="POST">
      {% csrf_token %}
      {% for field in form %}
      <fieldset class="form-group {% if field.errors %}has-error{% endif %}">

        {% if field.name == 'accept_terms' %}
        <div class="checkbox">
          <label>
            <input type="checkbox" name="{{ field.name }}"> {{ field.label }}
          </label>
        </div>
        {% else %}
        <label class="control-label" for="id_{{ field.name }}">{{ field.label }}</label>
        <input type="{{ field.field.widget.input_type }}" class="form-control"
          name="{{ field.name }}"
          id="id_{{ field.name }}" >
        {% endif %}

        {% if field.errors %}
          <span class="help-block">{{ field.errors.as_text | safe }}</span>
        {% else %}
          <span class="help-block">{{ field.help_text | safe }}</span>
        {% endif %}
      </fieldset>
      {% endfor %}
      <input type="submit" value="S'enregistrer"  class="btn btn-block btn-primary">
    </form>
</div>

{% endblock %}
