From 858359ac71e07314c4be93c46e8435719ca13572 Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Wed, 25 Nov 2026 19:21:35 +0100 Subject: [PATCH] feat(options): label above the control for every option, incl. checkboxes On the custom options page (Simple options) the label now always renders above the control. The checkbox exception (label right of the box via form-check/form-check-label, incl. the 9 logo device checkboxes) is removed; the generic form-label keeps the same id (lbl_simple_edit_options_) so JS/tests anchors are unchanged. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- options/options.twig | 40 +++++++++++++++------------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/options/options.twig b/options/options.twig index 0536a34..da0a764 100644 --- a/options/options.twig +++ b/options/options.twig @@ -351,13 +351,13 @@ {% set ckey = pos ~ 'showon' ~ dev %} {% set cattr = aOptionAttributes.optionAttributes[ckey] %} {% set ccv = bGeneralInherit ? 'inherit' : (aCurrentOptions[ckey] is defined ? aCurrentOptions[ckey] : (oParentOptions[ckey] is defined ? oParentOptions[ckey] : '')) %} -
+
+ -
{% endfor %}
@@ -405,12 +405,8 @@
- {# label ALWAYS above the control, for every type EXCEPT checkbox - (checkboxes carry their label to the RIGHT - of the box, rendered in the checkbox branch below) #} - {% if attr.type != 'checkbox' %} + {# label ALWAYS above the control, for every option type #} - {% endif %} {% if key == 'headersticky' %} {% elseif attr.type == 'buttons' %} @@ -435,24 +431,18 @@
{% elseif attr.type == 'checkbox' %} - {# checkbox: checked = "on", unchecked = "off". EXCEPTION to the - label-above rule: for checkboxes the label stands to - the RIGHT of the box (classic .form-check with the label after - the input) — so the generic form-label at the top of this block - is skipped for checkboxes and the label is rendered here with - the same id (lbl_simple_edit_options_) so tests/JS anchors - keep working. With survey-level inherit, an untouched box keeps - the value "inherit" (options.js: data was-inherit). Children of - a parent switch get selector_radio_childfield + data-parent. #} -
- - -
+ {# checkbox: checked = "on", unchecked = "off". The label sits above + the box via the generic form-label at the top of this block (same + id lbl_simple_edit_options_, so tests/JS anchors keep working). + With survey-level inherit, an untouched box keeps the value + "inherit" (options.js: data was-inherit). Children of a parent + switch get selector_radio_childfield + data-parent. #} + {% elseif attr.type == 'dropdown' %} {% set ddClasses = 'form-select selector_option_value_field' %}