feat(options): new Buttons tab after Questions with per-button color choosers (row 178 plan P6)

- config.xml: new 'Buttons' category directly after Questions — buttonsfont
  (full width) + 12 per-button options (Previous/Next/Submit x background+
  text, 6-way mode dropdown + custom picker, width 4); old global
  buttonstextcolor(+custom) removed (row-178 decision 7)
- options.twig: Buttons pane = h2+intro, full-width font row, one row of three
  col-md-4 columns (Previous/Next/Submit, border-start dividers); 6 new keys
  in aColorChooserKeys; OPTIONS_JS_TOKEN 20261129.4
- options.js + build.php: chooser key lists synced (+6)
- navigator.twig: respondage-btn-prev/-next/-submit classes, old global text
  color inline style removed; custom_header.twig: cmbg() macro (mode 'default'
  = no override) + per-button bg/text rules with decision-7 defaults
  (Next/Submit bg=Color 1 + text #ffffff, Previous bg=#ffffff + default font
  color)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-29 15:48:26 +01:00
commit aae3112981

View file

@ -26,14 +26,14 @@
option "buttonsfont", type fontselect. The class goes on the navigator container,
the buttons inherit it. "base" = same as the base font: no extra class. #}
{% set sButtonsFont = aSurveyInfo.options.buttonsfont|default('base') %}
{# Prompt U: per-element text color — mode default -> fontcolor, primary ->
primarycolor, secondary -> secondarycolor, other -> buttonstextcolorcustom.
Emitted as an inline style on the element below. #}
{% set sButtonsTextColorMode = aSurveyInfo.options.buttonstextcolor|default('default') %}
{% set sButtonsTextColor = sButtonsTextColorMode == 'primary' ? aSurveyInfo.options.primarycolor|default('') : (sButtonsTextColorMode == 'secondary' ? aSurveyInfo.options.secondarycolor|default('') : (sButtonsTextColorMode == 'other' ? aSurveyInfo.options.buttonstextcolorcustom|default('') : aSurveyInfo.options.fontcolor|default(''))) %}
{# Row 191 / row 178 plan P6: per-button colors. Each button gets a theme class
(respondage-btn-prev / -next / -submit); custom_header.twig emits the per-button
background/text color rules for these classes from the previousbutton*/nextbutton*/
submitbutton* chooser options. The old global buttonstextcolor inline style on the
container is gone. #}
<!-- PRESENT THE NAVIGATOR -->
<div class="{{ aSurveyInfo.class.navigatorcontainer }} row navigator space-col {% if sButtonsFont != 'base' %}font-{{ sButtonsFont }}{% endif %}" {% if sButtonsTextColor != '' %}style="color: {{ sButtonsTextColor }};"{% endif %} id="{{ aSurveyInfo.id.navigatorcontainer }}" {{ aSurveyInfo.attr.navigatorcontainer }}>
<div class="{{ aSurveyInfo.class.navigatorcontainer }} row navigator space-col {% if sButtonsFont != 'base' %}font-{{ sButtonsFont }}{% endif %}" id="{{ aSurveyInfo.id.navigatorcontainer }}" {{ aSurveyInfo.attr.navigatorcontainer }}>
<!-- Previous button container -->
<div class="{{ aSurveyInfo.class.navigatorbuttonl }} col-6 text-start" {{ aSurveyInfo.attr.navigatorbuttonl }}>
@ -41,7 +41,7 @@
{# Previous button must be set to ON in survey settings (and it's not shown in first page, in All in One survey mode, etc) #}
{% if (not aSurveyInfo.popupPreview) and aNavigator.aMovePrev.show %}
<!-- Button previous -->
<button {{ aSurveyInfo.attr.navigatorbuttonprev }} accesskey="p" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonprev }} btn btn-lg btn-outline-secondary " >
<button {{ aSurveyInfo.attr.navigatorbuttonprev }} accesskey="p" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonprev }} btn btn-lg btn-outline-secondary respondage-btn-prev" >
{{ gT("Previous") }}
</button>
{% endif %}
@ -54,12 +54,12 @@
{# On last page, Next button become submit button. #}
{% if aNavigator.aMoveNext.value == "movesubmit" %}
<!-- Button submit -->
<button {{ aSurveyInfo.attr.navigatorbuttonsubmit }} accesskey="n" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonsubmit }} btn btn-lg btn-primary">
<button {{ aSurveyInfo.attr.navigatorbuttonsubmit }} accesskey="n" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonsubmit }} btn btn-lg btn-primary respondage-btn-submit">
{{ gT("Submit") }}
</button>
{% else %}
<!-- Button Next -->
<button {{ aSurveyInfo.attr.navigatorbuttonnext }} accesskey="n" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonnext }} btn btn-lg btn-primary " >
<button {{ aSurveyInfo.attr.navigatorbuttonnext }} accesskey="n" class=" {{ aNavigator.disabled }} {{ aSurveyInfo.class.navigatorbuttonnext }} btn btn-lg btn-primary respondage-btn-next" >
{{ gT("Next") }}
</button>
{% endif %}