{% load form_helpers %}

<div class="form-group{% if field.errors %} has-error{% endif %} {{ field.css_classes }}">
  <label class="control-label col-sm-3 {% if field.field.required %}{{ form.required_css_class }}{% endif %}" for="{{ field.id_for_label }}">
    <span class="field-label">{{ field.label }}</span>
    {% include "horizon/common/_form_field_decorator.html" %}
  </label>
  <div class="col-sm-9 {{ classes.value }} {{ field|wrapper_classes }}">
    {% if field|is_checkbox %}
      {% with is_horizontal=1 %}
      {% include 'horizon/common/fields/_themable_checkbox.html' %}
      {% endwith %}
    {% elif field|is_number %}
      {% include 'horizon/common/fields/_themable_spinner.html' %}
    {% elif field|is_radio %}
      {% with is_horizontal=1 %}
      {% include 'horizon/common/fields/_themable_radiobutton.html' %}
      {% endwith %}
    {% else %}
      {{ field|add_bootstrap_class }}
    {% endif %}
    {% for error in field.errors %}
      <span class="help-block {{ form.error_css_class }}">{{ error }}</span>
    {% endfor %}
  </div>
</div>
