datetime-wrapper.html.twig 879 Bytes
Newer Older
1 2 3 4 5 6 7 8
{#
/**
 * @file
 * Default theme implementation of a datetime form wrapper.
 *
 * Available variables:
 * - content: The form element to be output, usually a datelist, or datetime.
 * - title: The title of the form element.
9
 * - title_attributes: HTML attributes for the title wrapper.
10
 * - description: Description text for the form element.
11
 * - required: An indicator for whether the associated form element is required.
12 13 14 15 16 17
 *
 * @see template_preprocess_datetime_wrapper()
 *
 * @ingroup themeable
 */
#}
18 19
{%
  set title_classes = [
20
    required ? 'js-form-required',
21 22 23
    required ? 'form-required',
  ]
%}
24
{% if title %}
25
  <h4{{ title_attributes.addClass(title_classes) }}>{{ title }}</h4>
26 27
{% endif %}
{{ content }}
28 29 30 31 32
{% if errors %}
  <div>
    {{ errors }}
  </div>
{% endif %}
33 34 35 36 37
{% if description %}
  <div{{ description_attributes }}>
    {{ description }}
  </div>
{% endif %}