{% load form_helpers %}

<div class="form-group{% if field.errors %} has-error{% endif %}">
    <label class="col-md-3 control-label{% if field.field.required %} required{% endif %}" for="{{ field.id_for_label }}">
        {{ field.label }}
    </label>
    <div class="col-md-3">
        <div class="checkbox{% if override_field.errors %} has-error{% endif %}">
            <label for="{{ override_field.id_for_label }}">
                {{ override_field }}
                <i>Override default value</i>
            </label>
            {% if override_field.help_text %}
                <span class="help-block">{{ override_field.help_text|safe }}</span>
            {% endif %}
        </div>
    </div>
    <div class="col-md-6">
        {% if field|widget_type == 'checkboxinput' %}
            <div class="checkbox{% if field.errors %} has-error{% endif %}">
                <label for="{{ field.id_for_label }}">
                    {{ field }} {{ field.label }}
                </label>
                {% if field.help_text %}<span class="help-block">{{ field.help_text|safe }}</span>{% endif %}
            </div>
        {% else %}
            {{ field }}
            {% if field.help_text %}<span class="help-block">{{ field.help_text|safe }}</span>{% endif %}
        {% endif %}
        {% if field.errors %}
            <ul>
                {% for error in field.errors %}
                    {# Embed an HTML comment indicating the error for extraction by tests #}
                    <!-- FORM-ERROR {{ field.name }}: {{ error }} -->
                    <li class="text-danger">{{ error }}</li>
                {% endfor %}
            </ul>
        {% endif %}
    </div>
</div>
