annotate core/modules/system/templates/status-messages.html.twig @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents af1871eacc83
children
rev   line source
Chris@0 1 {#
Chris@0 2 /**
Chris@0 3 * @file
Chris@0 4 * Default theme implementation for status messages.
Chris@0 5 *
Chris@0 6 * Displays status, error, and warning messages, grouped by type.
Chris@0 7 *
Chris@0 8 * An invisible heading identifies the messages for assistive technology.
Chris@0 9 * Sighted users see a colored box. See http://www.w3.org/TR/WCAG-TECHS/H69.html
Chris@0 10 * for info.
Chris@0 11 *
Chris@0 12 * Add an ARIA label to the contentinfo area so that assistive technology
Chris@0 13 * user agents will better describe this landmark.
Chris@0 14 *
Chris@0 15 * Available variables:
Chris@0 16 * - message_list: List of messages to be displayed, grouped by type.
Chris@0 17 * - status_headings: List of all status types.
Chris@0 18 * - attributes: HTML attributes for the element, including:
Chris@0 19 * - class: HTML classes.
Chris@0 20 *
Chris@0 21 * @ingroup themeable
Chris@0 22 */
Chris@0 23 #}
Chris@18 24 <div data-drupal-messages>
Chris@0 25 {% for type, messages in message_list %}
Chris@0 26 <div role="contentinfo" aria-label="{{ status_headings[type] }}"{{ attributes|without('role', 'aria-label') }}>
Chris@0 27 {% if type == 'error' %}
Chris@0 28 <div role="alert">
Chris@0 29 {% endif %}
Chris@18 30 {% if status_headings[type] %}
Chris@18 31 <h2 class="visually-hidden">{{ status_headings[type] }}</h2>
Chris@18 32 {% endif %}
Chris@18 33 {% if messages|length > 1 %}
Chris@18 34 <ul>
Chris@18 35 {% for message in messages %}
Chris@18 36 <li>{{ message }}</li>
Chris@18 37 {% endfor %}
Chris@18 38 </ul>
Chris@18 39 {% else %}
Chris@18 40 {{ messages|first }}
Chris@18 41 {% endif %}
Chris@0 42 {% if type == 'error' %}
Chris@0 43 </div>
Chris@0 44 {% endif %}
Chris@0 45 </div>
Chris@0 46 {% endfor %}
Chris@18 47 </div>