{% load twitter_bootstrap widget_tweaks %}

<div class="form-group{% if field.errors %} has-error{% endif %}">
    {% if field|is_checkbox %}
    <div class="{{ lbl_size_offset_class }} {{ ipt_size_class }}">
        <div class="checkbox">
            <label for="{{ field.auto_id }}">
                {{ field }} {{ field.label }}{% if field.field.required %}{{ required_suffix }}{% endif %}
            </label>
        </div>
    </div>
    {% else %}
    <label class="{{ lbl_size_class }} control-label" for="{{ field.auto_id }}">{{ field.label }}{% if field.field.required %}{{ required_suffix }}{% endif %}</label>
    <div class="{{ ipt_size_class }}">
        {{ field|add_class:"form-control" }}

        {% for error in field.errors %}
            <span class="help-inline text-danger">{{ error }}</span>
        {% endfor %}

        {% if field.help_text %}
            <p class="help-block">{{ field.help_text|safe }}</p>
        {% endif %}
    </div>
    {% endif %}
</div>

