fix(options): option label always above the control, incl. checkboxes (Prompt G)

The generic form-label is now rendered for every option type; the
checkbox branch no longer emits an inline form-check-label (only the
form-check wrapper around the input remains). Classes/id/name/for and
data-parent wiring are unchanged, so options.js keeps working.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-24 22:32:57 +01:00
commit 2d3715da4c

View file

@ -214,9 +214,8 @@
<div class="col-12 col-md-{{ attr.width|default(2) }} {% if attr.parent != '' %}option-visibility{% endif %}"
{% if attr.parent != '' %}data-show-if-parent="{{ attr.parent }}" data-show-if-value="on"{% endif %}>
<div class="mb-3">
{% if attr.type != 'checkbox' %}
<label for="simple_edit_options_{{ key }}" id="lbl_simple_edit_options_{{ key }}" class="form-label">{{ gT(attr.title) }}</label>
{% endif %}
{# label ALWAYS above the control, for every type incl. checkbox (Prompt G) #}
<label for="simple_edit_options_{{ key }}" id="lbl_simple_edit_options_{{ key }}" class="form-label">{{ gT(attr.title) }}</label>
{% if attr.type == 'buttons' %}
{# buttons type: one radio per value of options="a|b", labels from optionlabels="A|B" #}
@ -238,9 +237,10 @@
</div>
{% elseif attr.type == 'checkbox' %}
{# checkbox: checked = "on", unchecked = "off". The label is inline
(form-check-label), so the generic label above is skipped for this
type. With survey-level inherit, an untouched box keeps the value
{# 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. #}
<div class="form-check">
@ -250,7 +250,6 @@
{% if attr.parent != '' %}data-parent="{{ attr.parent }}"{% endif %}
data-inheritvalue="{{ oParentOptions[key] }}"
id="simple_edit_options_{{ key }}" name="{{ key }}">
<label class="form-check-label" for="simple_edit_options_{{ key }}">{{ gT(attr.title) }}</label>
</div>
{% elseif attr.type == 'dropdown' %}