Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
{#
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Theme override for a fieldset element and its children.
|
|
|
|
*
|
Issue #2396145 by dww, Dom., mgifford, Pancho, idebr, vdanielpop, specky_rum, vprocessor, DuaelFr, lucastockmann, cwoky, Munavijayalakshmi, dutchyoda, Gauravmahlawat, paulocs, TheodorosPloumis, Arla, lauriii, Kristen Pol, quietone, larowlan, jhedstrom, mherchel: Option #description_display for form element fieldset is not changing anything
2021-06-10 09:28:22 +00:00
|
|
|
* Available variables:
|
|
|
|
* - attributes: HTML attributes for the fieldset element.
|
|
|
|
* - errors: (optional) Any errors for this fieldset element, may not be set.
|
|
|
|
* - required: Boolean indicating whether the fieldset element is required.
|
|
|
|
* - legend: The legend element containing the following properties:
|
|
|
|
* - title: Title of the fieldset, intended for use as the text of the legend.
|
|
|
|
* - attributes: HTML attributes to apply to the legend.
|
|
|
|
* - description: The description element containing the following properties:
|
|
|
|
* - content: The description content of the fieldset.
|
|
|
|
* - attributes: HTML attributes to apply to the description container.
|
|
|
|
* - description_display: Description display setting. It can have these values:
|
|
|
|
* - before: The description is output before the element.
|
|
|
|
* - after: The description is output after the element (default).
|
|
|
|
* - invisible: The description is output after the element, hidden visually
|
|
|
|
* but available to screen readers.
|
|
|
|
* - children: The rendered child elements of the fieldset.
|
|
|
|
* - prefix: The content to add before the fieldset children.
|
|
|
|
* - suffix: The content to add after the fieldset children.
|
|
|
|
*
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
* @see template_preprocess_fieldset()
|
|
|
|
* @see claro_preprocess_fieldset()
|
|
|
|
*/
|
|
|
|
#}
|
|
|
|
{%
|
|
|
|
set classes = [
|
|
|
|
'fieldset',
|
|
|
|
attributes.hasClass('fieldgroup') ? 'fieldset--group',
|
|
|
|
'js-form-item',
|
|
|
|
'form-item',
|
|
|
|
'js-form-wrapper',
|
|
|
|
'form-wrapper',
|
|
|
|
]
|
|
|
|
%}
|
|
|
|
{%
|
|
|
|
set wrapper_classes = [
|
|
|
|
'fieldset__wrapper',
|
|
|
|
attributes.hasClass('fieldgroup') ? 'fieldset__wrapper--group',
|
|
|
|
]
|
|
|
|
%}
|
|
|
|
{%
|
|
|
|
set legend_span_classes = [
|
|
|
|
'fieldset__label',
|
|
|
|
attributes.hasClass('fieldgroup') ? 'fieldset__label--group',
|
|
|
|
required ? 'js-form-required',
|
|
|
|
required ? 'form-required',
|
|
|
|
]
|
|
|
|
%}
|
|
|
|
{%
|
|
|
|
set legend_classes = [
|
|
|
|
'fieldset__legend',
|
|
|
|
attributes.hasClass('fieldgroup') and not attributes.hasClass('form-composite') ? 'fieldset__legend--group',
|
|
|
|
attributes.hasClass('form-composite') ? 'fieldset__legend--composite',
|
|
|
|
title_display == 'invisible' ? 'fieldset__legend--invisible' : 'fieldset__legend--visible',
|
|
|
|
]
|
|
|
|
%}
|
|
|
|
{%
|
|
|
|
set description_classes = [
|
|
|
|
'fieldset__description',
|
|
|
|
]
|
|
|
|
%}
|
|
|
|
|
|
|
|
<fieldset{{ attributes.addClass(classes) }}>
|
|
|
|
{# Always wrap fieldset legends in a <span> for CSS positioning. #}
|
|
|
|
{% if legend.title %}
|
|
|
|
<legend{{ legend.attributes.addClass(legend_classes) }}>
|
|
|
|
<span{{ legend_span.attributes.addClass(legend_span_classes) }}>{{ legend.title }}</span>
|
|
|
|
</legend>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
<div{{ content_attributes.addClass(wrapper_classes) }}>
|
Issue #2396145 by dww, Dom., mgifford, Pancho, idebr, vdanielpop, specky_rum, vprocessor, DuaelFr, lucastockmann, cwoky, Munavijayalakshmi, dutchyoda, Gauravmahlawat, paulocs, TheodorosPloumis, Arla, lauriii, Kristen Pol, quietone, larowlan, jhedstrom, mherchel: Option #description_display for form element fieldset is not changing anything
2021-06-10 09:28:22 +00:00
|
|
|
{% if description_display == 'before' and description.content %}
|
|
|
|
<div{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</div>
|
|
|
|
{% endif %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
{% if inline_items %}
|
|
|
|
<div class="container-inline">
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if prefix %}
|
|
|
|
<span class="fieldset__prefix">{{ prefix }}</span>
|
|
|
|
{% endif %}
|
|
|
|
{{ children }}
|
|
|
|
{% if suffix %}
|
|
|
|
<span class="fieldset__suffix">{{ suffix }}</span>
|
|
|
|
{% endif %}
|
|
|
|
{% if errors %}
|
|
|
|
<div class="fieldset__error-message">
|
|
|
|
{{ errors }}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
Issue #2396145 by dww, Dom., mgifford, Pancho, idebr, vdanielpop, specky_rum, vprocessor, DuaelFr, lucastockmann, cwoky, Munavijayalakshmi, dutchyoda, Gauravmahlawat, paulocs, TheodorosPloumis, Arla, lauriii, Kristen Pol, quietone, larowlan, jhedstrom, mherchel: Option #description_display for form element fieldset is not changing anything
2021-06-10 09:28:22 +00:00
|
|
|
{% if description_display in ['after', 'invisible'] and description.content %}
|
Issue #3079738 by lauriii, saschaeggi, webchick, xjm, andrewmacpherson, shimpy, effulgentsia, Wim Leers, DyanneNova, svettes, rainbreaw, fhaeberle, ckrina, AaronMcHale, justafish, catch, charlieweb82, AntoineH, lot007, pzajacz, kostyashupenko, jasonbarrie, antonellasevero, finnsky, worldlinemine, bnjmnm, RobLoach, Dennis Cohn, huzooka, Archita Arora, joachim, jrockowitz, benjifisher, shaal, Gábor Hojtsy, quiron, L2G2, ccasals, hampercm, if-jds, abhisekmazumdar, Kami Amiga, pivica, zrpnr, BrightBold, imalabya, jhedstrom, Neslee Canil Pinto, maliknaik, junaidmasoodi, Maithri Shetty, pranav73, mandclu, modulist, nod_, philosurfer, phenaproxima, mherchel, mlncn, rafuel92, leymannx, kiboman, Swapnil_Kotwal, anevins, evankay, rfmarcelino, thamas, brianperry, idebr, joelpittet, boulaffasae, alexpott, volkerk, DuneBL, Eli-T, Mahenkvyas22: Add Claro administration theme to core
2019-10-13 20:42:58 +00:00
|
|
|
<div{{ description.attributes.addClass(description_classes) }}>{{ description.content }}</div>
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% if inline_items %}
|
|
|
|
</div>
|
|
|
|
{% endif %}
|
|
|
|
</div>
|
|
|
|
</fieldset>
|