{% load i18n coop_utils %}

{% if field.is_hidden %}
    {{ field }}
{% else %}
  <div class="form-group">
    <div class="row">
      {% if field|is_checkbox %}
        <div class="col-sm-8 col-sm-offset-4">
          <div class="checkbox">
          {{ field }} {{field.label}}
          </div>
          {{ field.errors }}
          {% if field.help_text %}<div class="help-block">{{ field.help_text }}</div>{% endif %}
        </div>
      {% else %}
        {% if field.label %}
          <div class="col-sm-4">
            <label class="control-label" for="{{ field.name }}">
              {{ field.label }} {% if allow_required_sign and field.field.required %}*{% endif %}
            </label>
          </div>
        {% else %}
          <div class="col-sm-4"></div>
        {% endif %}
        <div class="col-sm-8">
          {{ field }}
          {% if field.errors %}
          <div class="field-error"><div class="label label-danger">{{field.errors|join:", "}}</div></div>
          {% endif %}
          {% if field.help_text %}<div class="help-block">{{ field.help_text }}</div>{% endif %}
          </div>
      {% endif %}
    </div>
  </div>
{% endif %}
