{% load bootstrap %}

{% if form.non_field_errors %}
    {% for e in form.non_field_errors %}
        <div class="alert alert-danger alert-dismissible fade show" role="alert">
            {{ e }}
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
    {% endfor %}
{% endif %}

{% for field in form.hidden_fields %}
    {{ field }}
{% endfor %}

{% block fields %}
    {% for field in form.visible_fields %}
        {% bootstrap_field field form=form %}
    {% endfor %}
{% endblock fields %}
