Mercurial > hg > isophonics-drupal-site
annotate core/themes/classy/templates/form/datetime-wrapper.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 of a datetime form wrapper. |
Chris@0 | 5 * |
Chris@0 | 6 * Available variables: |
Chris@0 | 7 * - content: The form element to be output, usually a datelist, or datetime. |
Chris@0 | 8 * - title: The title of the form element. |
Chris@0 | 9 * - title_attributes: HTML attributes for the title wrapper. |
Chris@0 | 10 * - description: Description text for the form element. |
Chris@0 | 11 * - required: An indicator for whether the associated form element is required. |
Chris@0 | 12 * |
Chris@0 | 13 * @see template_preprocess_datetime_wrapper() |
Chris@0 | 14 */ |
Chris@0 | 15 #} |
Chris@0 | 16 {% |
Chris@0 | 17 set title_classes = [ |
Chris@0 | 18 'label', |
Chris@0 | 19 required ? 'js-form-required', |
Chris@0 | 20 required ? 'form-required', |
Chris@0 | 21 ] |
Chris@0 | 22 %} |
Chris@0 | 23 {% if title %} |
Chris@0 | 24 <h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4> |
Chris@0 | 25 {% endif %} |
Chris@0 | 26 {{ content }} |
Chris@0 | 27 {% if errors %} |
Chris@0 | 28 <div class="form-item--error-message"> |
Chris@0 | 29 <strong>{{ errors }}</strong> |
Chris@0 | 30 </div> |
Chris@0 | 31 {% endif %} |
Chris@0 | 32 {% if description %} |
Chris@0 | 33 <div{{ description_attributes.addClass('description') }}> |
Chris@0 | 34 {{ description }} |
Chris@0 | 35 </div> |
Chris@0 | 36 {% endif %} |