{% if non_field_errors or field_errors %}
  <div class="error-summary" aria-labelledby="error-summary-heading-{{ random_string }}" role="alert" tabindex="-1">
    <h2 class="heading-medium error-summary-heading" id="error-summary-heading-{{ random_string }}">
      {{ error_summary_title }}
    </h2>
    <ul class="error-summary-list">
      {% for error in non_field_errors %}
        <li class="non-field-error">{{ error }}</li>
      {% endfor %}

      {% for field, field_errors in field_errors.items %}
        <li class="field-error {% if field.is_hidden %}hidden-field-error{% endif %}">
          <a {% if not field.is_hidden %}href="#{{ field.auto_id }}-label"{% endif %}>{{ field.label }}</a>
          <ul>
            {% for field_error in field_errors %}
              <li>{{ field_error }}</li>
            {% endfor %}
          </ul>
        </li>
      {% endfor %}
    </ul>
  </div>
{% endif %}
