{% load crispy_forms_field %}

{% if field.is_hidden %}
	{{ field }}
{% else %}
	<div id="div_{{ field.auto_id }}" class="clearfix control-group{% if form_show_errors%}{% if field.errors %} error{% endif %}{% endif %}{% if field.css_classes %} {{ field.css_classes }}{% endif %}">
		{% if field.label and not field|is_checkbox %}
			<label for="{{ field.id_for_label }}" class="control-label {% if field.field.required %}requiredField{% endif %}">
				{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %}
			</label>
		{% endif %}
    
        {% if field|css_class == "checkboxselectmultiple" %}
            {% include 'bootstrap/layout/checkboxselectmultiple.html' %}
        {% endif %} 

        {% if field|css_class == "radioselect" %}
            {% include 'bootstrap/layout/radioselect.html' %}
        {% endif %}

        {% if field|css_class != "checkboxselectmultiple" and field|css_class != "radioselect" %}
            <div class="controls">
                {% if field|is_checkbox %}
                    <label for="{{ field.id_for_label }}" class="checkbox {% if field.field.required %}requiredField{% endif %}">
                        {% crispy_field field %}
                        {{ field.label|safe }}
                        {% include 'bootstrap/layout/help_text_and_errors.html' %}
                    </label>
                {% else %}
                    {% include 'bootstrap/layout/help_text_and_errors.html' %}
                    {% crispy_field field %}
                {% endif %}
            </div>
        {% endif %}
	</div>
{% endif %}
