From fb560bef62f5f774ae5d12d38a850738206570bc Mon Sep 17 00:00:00 2001 From: Tammo ter Hark Date: Wed, 25 Nov 2026 13:06:22 +0100 Subject: [PATCH] feat(options): checkbox labels right of the box + explanatory h2/p header on Top-of-page tab (Prompt W) Label-above stays the rule for every option type, with one exception: checkboxes now render their label to the RIGHT of the box (classic .form-check, label after the input, same lbl_ id so JS/tests keep anchoring). Applies to the generic checkbox branch (headersticky*) and the logo-block showon* checkboxes. New experiment for explanatory text on the options pages: the 'Top of the page' pane starts with

Header

and a

explaining what the header is, both wrapped in gT() so they are translatable. (Owner's source typos fixed: distinguishable, you can choose.) Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe --- options/options.twig | 50 ++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 16 deletions(-) diff --git a/options/options.twig b/options/options.twig index ec27c9e..848efdb 100644 --- a/options/options.twig +++ b/options/options.twig @@ -260,6 +260,17 @@ {% endif %}

+ {% if tab.id == 'top-of-page' %} + {# Prompt W: experiment with explanatory text on the options pages — above the + FIRST element of the "Top of the page" pane a header + explanation. Wrapped + in gT() so the strings are picked up for translation into other languages. + (Typo's in the owner's source text fixed: "ditinguishable" -> "distinguishable", + "you van choose" -> "you can choose".) #} +
+

{{ gT("Header") }}

+

{{ gT("The header is the top part of the page, possibly containing the name of the survey, logo's and a menu. In this part of the options you can make this header more or less distinguishable from the rest of the page and you can choose if the logo should stay on top of the page after scrolling (sticky) or not.") }}

+
+ {% endif %}
{# Prompt P: in the Images pane use the three-column grid like the logo block (Prompt M), but fill ONLY column 1 — all Images options stack @@ -321,15 +332,14 @@ {% 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] : '')) %} -
- -
- -
+ {# Prompt W: checkbox label to the RIGHT of the box #} +
+ +
{% endfor %}
@@ -417,8 +427,12 @@
- {# label ALWAYS above the control, for every type incl. checkbox (Prompt G) #} + {# label ALWAYS above the control, for every type EXCEPT checkbox + (Prompt G; Prompt W: checkboxes carry their label to the RIGHT + of the box, rendered in the checkbox branch below) #} + {% if attr.type != 'checkbox' %} + {% endif %} {% if key == 'headersticky' %} {# Prompt L: the master switch is rendered as a STATIC LABEL only @@ -447,12 +461,15 @@
{% elseif attr.type == 'checkbox' %} - {# checkbox: checked = "on", unchecked = "off". The label is rendered - above like every other type (generic form-label at the top of this - block, Prompt G); only the box itself is wrapped in .form-check. - 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 like the rest. #} + {# checkbox: checked = "on", unchecked = "off". EXCEPTION to the + label-above rule (Prompt W): 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. #}
+
{% elseif attr.type == 'dropdown' %}