<span class="help-block">{{ form.non_field_errors }}</span>
{% for field in form.hidden_fields %}
    {{ field }}
{% endfor %}
{% for field in form.visible_fields %}
    {% comment %}
        We use a separate template for each field so that forms can be rendered
        field-by-field easily #}
    {% endcomment %}
    {% include 'partials/form_field.html' with field=field %}
{% endfor %}

{% if form.is_bound and not form.is_valid %}
    <div class="alert alert-error">
        <strong>Oops! We found some errors</strong> - please check the error messages below and try again
    </div>
{% endif %}

{% if form.non_field_errors %}
    {% for error in form.non_field_errors %}
        <div class="alert alert-error control-group error">
            <span class="help-inline"><i class="icon-exclamation-sign"></i> {{ error }}</span>
        </div>
    {% endfor %}
{% endif %}

{% for field in form.hidden_fields %}
    {{ field }}
{% endfor %}
{% for field in form.visible_fields %}
    {% comment %}
        We use a separate template for each field so that forms can be rendered
        field-by-field easily #}
    {% endcomment %}
    {% include 'partials/form_field.html' with field=field %}
{% endfor %}

Adjust handling of invalid forms
Adjust handling of invalid forms

- Non-field errors render in separate alert blocks (including the
  exclamation icon)
- We also show a generic "there are errors" block at the top of an
  invalid form.
