annotate core/themes/classy/templates/form/details.html.twig @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 4c8ae668cc8c
children
rev   line source
Chris@0 1 {#
Chris@0 2 /**
Chris@0 3 * @file
Chris@0 4 * Theme override for a details element.
Chris@0 5 *
Chris@0 6 * Available variables
Chris@0 7 * - attributes: A list of HTML attributes for the details element.
Chris@0 8 * - errors: (optional) Any errors for this details element, may not be set.
Chris@0 9 * - title: (optional) The title of the element, may not be set.
Chris@0 10 * - description: (optional) The description of the element, may not be set.
Chris@0 11 * - children: (optional) The children of the element, may not be set.
Chris@0 12 * - value: (optional) The value of the element, may not be set.
Chris@0 13 *
Chris@0 14 * @see template_preprocess_details()
Chris@0 15 */
Chris@0 16 #}
Chris@0 17 <details{{ attributes }}>
Chris@0 18 {%- if title -%}
Chris@0 19 {%
Chris@0 20 set summary_classes = [
Chris@0 21 required ? 'js-form-required',
Chris@0 22 required ? 'form-required',
Chris@0 23 ]
Chris@0 24 %}
Chris@0 25 <summary{{ summary_attributes.addClass(summary_classes) }}>{{ title }}</summary>
Chris@0 26 {%- endif -%}
Chris@0 27 <div class="details-wrapper">
Chris@0 28 {% if errors %}
Chris@0 29 <div class="form-item--error-message">
Chris@0 30 <strong>{{ errors }}</strong>
Chris@0 31 </div>
Chris@0 32 {% endif %}
Chris@0 33 {%- if description -%}
Chris@0 34 <div class="details-description">{{ description }}</div>
Chris@0 35 {%- endif -%}
Chris@0 36 {%- if children -%}
Chris@0 37 {{ children }}
Chris@0 38 {%- endif -%}
Chris@0 39 {%- if value -%}
Chris@0 40 {{ value }}
Chris@0 41 {%- endif -%}
Chris@0 42 </div>
Chris@0 43 </details>