Mercurial > hg > isophonics-drupal-site
annotate core/themes/stable/templates/misc/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 * Theme override 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 #} |
Chris@18 | 22 <div data-drupal-messages> |
Chris@0 | 23 {% for type, messages in message_list %} |
Chris@0 | 24 <div role="contentinfo" aria-label="{{ status_headings[type] }}"{{ attributes|without('role', 'aria-label') }}> |
Chris@0 | 25 {% if type == 'error' %} |
Chris@0 | 26 <div role="alert"> |
Chris@0 | 27 {% endif %} |
Chris@0 | 28 {% if status_headings[type] %} |
Chris@0 | 29 <h2 class="visually-hidden">{{ status_headings[type] }}</h2> |
Chris@0 | 30 {% endif %} |
Chris@0 | 31 {% if messages|length > 1 %} |
Chris@0 | 32 <ul> |
Chris@0 | 33 {% for message in messages %} |
Chris@0 | 34 <li>{{ message }}</li> |
Chris@0 | 35 {% endfor %} |
Chris@0 | 36 </ul> |
Chris@0 | 37 {% else %} |
Chris@0 | 38 {{ messages|first }} |
Chris@0 | 39 {% endif %} |
Chris@0 | 40 {% if type == 'error' %} |
Chris@0 | 41 </div> |
Chris@0 | 42 {% endif %} |
Chris@0 | 43 </div> |
Chris@0 | 44 {% endfor %} |
Chris@18 | 45 </div> |