From cf4ce9f785953d9c4651255d262f635f0f2e70d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?benjamin=20melan=C3=A7on?= Date: Tue, 11 Dec 2018 12:09:01 -0500 Subject: [PATCH] Override Bulma's fieldset template to add form-label class to form label --- agaric/templates/elements/fieldset.html.twig | 64 ++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 agaric/templates/elements/fieldset.html.twig diff --git a/agaric/templates/elements/fieldset.html.twig b/agaric/templates/elements/fieldset.html.twig new file mode 100644 index 0000000..e46d0b1 --- /dev/null +++ b/agaric/templates/elements/fieldset.html.twig @@ -0,0 +1,64 @@ +{# +/** + * @file + * Default theme implementation for a fieldset element and its children. + * + * Available variables: + * - attributes: HTML attributes for the
element. + * - errors: (optional) Any errors for this
element, may not be set. + * - required: Boolean indicating whether the element is required. + * - legend: The element containing the following properties: + * - title: Title of the
, intended for use as the text + of the . + * - attributes: HTML attributes to apply to the element. + * - description: The description element containing the following properties: + * - content: The description content of the
. + * - attributes: HTML attributes to apply to the description container. + * - children: The rendered child elements of the
. + * - prefix: The content to add before the
children. + * - suffix: The content to add after the
children. + * + * @see template_preprocess_fieldset() + * + * @ingroup themeable + */ +#} +{% + set classes = [ + 'panel', + 'js-form-item', + 'form-item', + 'js-form-wrapper', + 'form-wrapper', + ] +%} + + {% + set legend_span_classes = [ + 'form-label', + 'panel-heading', + 'fieldset-legend', + required ? 'js-form-required', + required ? 'form-required', + ] + %} + {{ legend.title }}

+ +
+ {% if errors %} +
+ {{ errors }} +
+ {% endif %} + {% if prefix %} + {{ prefix }} + {% endif %} + {{ children }} + {% if suffix %} + {{ suffix }} + {% endif %} + {% if description.content %} + {{ description.content }}
+ {% endif %} + +