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

@ -47,7 +47,7 @@
heuristically cached copy (the file has only Last-Modified/ETag, no Cache-Control).
Re-register it with a version token: bump OPTIONS_JS_TOKEN below whenever
options/options.js changes, so every browser fetches the new file once. #}
{% set OPTIONS_JS_TOKEN = '20261129.3' %}
{% set OPTIONS_JS_TOKEN = '20261129.4' %}
{{ unregisterScriptFile(optionsPath ~ '/options.js') }}
{{ registerScriptFile(optionsPath ~ '/options.js?v=' ~ OPTIONS_JS_TOKEN, 'POS_END') }}
@ -293,7 +293,7 @@
row 184 / plan P3: answerstextcolor as well; row 186 / plan P4:
questionhelpbackgroundcolor as well. Must stay in sync with
aColorChooserKeys in options/options.js. #}
{% set aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor', 'questionhelpbackgroundcolor'] %}
{% set aColorChooserKeys = ['navbarfontcolor', 'headerbackgroundcolor', 'progressbarcolor', 'progressbarbackgroundcolor', 'progressbarfontcolor', 'bodybackgroundcolor', 'grouptitletextcolor', 'groupdescriptiontextcolor', 'questiontitletextcolor', 'questiontitlebackgroundcolor', 'questionbackgroundcolor', 'answerstextcolor', 'questionhelpbackgroundcolor', 'previousbuttonbackgroundcolor', 'previousbuttontextcolor', 'nextbuttonbackgroundcolor', 'nextbuttontextcolor', 'submitbuttonbackgroundcolor', 'submitbuttontextcolor'] %}
{% set aShowIfValues = { 'questionborder': 'box|top', 'navbarfontcolor': 'other' } %}
{% for el in aFontElements %}{% set aShowIfValues = aShowIfValues|merge({ (el ~ 'textcolor'): 'other' }) %}{% endfor %}
@ -364,6 +364,14 @@
{% set aGroupCol1 = ['grouptitlefont', 'grouptitletextcolor', 'grouptitletextcolorcustom', 'grouptitlefontsize', 'grouptitlefontoptions'] %}
{% set aGroupCol2 = ['groupdescriptionfont', 'groupdescriptiontextcolor', 'groupdescriptiontextcolorcustom', 'groupdescriptionfontsize', 'groupdescriptionfontoptions'] %}
{# row 191 / row 178 plan P6: the Buttons pane — a full-width font row at the top
(buttonsfont), then ONE row with three col-md-4 columns: col 1 = Previous,
col 2 = Next, col 3 = Submit (row-178 decision 1); each column holds that
button's background color chooser (+custom) and text color chooser (+custom). #}
{% set aButtonsCol1 = ['previousbuttonbackgroundcolor', 'previousbuttonbackgroundcolorcustom', 'previousbuttontextcolor', 'previousbuttontextcolorcustom'] %}
{% set aButtonsCol2 = ['nextbuttonbackgroundcolor', 'nextbuttonbackgroundcolorcustom', 'nextbuttontextcolor', 'nextbuttontextcolorcustom'] %}
{% set aButtonsCol3 = ['submitbuttonbackgroundcolor', 'submitbuttonbackgroundcolorcustom', 'submitbuttontextcolor', 'submitbuttontextcolorcustom'] %}
{# Tab list: FIRST the "Default font and colors" tab (where the default/base font
and the default colors are chosen), then the "Header" tab
tab (keys = aTopOfPageKeys), then row 147: the "Page background" tab (the
@ -514,6 +522,13 @@
<p>{{ gT("Questions are the core of a survey. Here you create your own design of how questions are displayed to your respondent.") }}</p>
</div></div>
{% endif %}
{% if tab.category == 'Buttons' %}
{# row 191 / plan P6: h2 + intro of the Buttons tab #}
<div class="row action_hide_on_inherit buttons-intro"><div class="col-12">
<h2>{{ gT("Buttons") }}</h2>
<p>{{ gT("The buttons at the bottom of each page of the survey: Previous, Next and Submit. Here you choose the font and the colors of each of them.") }}</p>
</div></div>
{% endif %}
<div class="row action_hide_on_inherit">
{% set qLastSlot = '' %}
{% set fLastSlot = 0 %}
@ -529,6 +544,7 @@
{% set bTopPane = tab.id == 'top-of-page' %}
{% set bImagesPane = tab.category == 'Page background' %}
{% set bGroupsPane = tab.id == 'groups' %}
{% set bButtonsPane = tab.category == 'Buttons' %}
{% set fSlot = 'rest' %}
{% if bFontsPane %}
{# row 174: one row, three col-md-4 columns — col 1 (fc1) =
@ -578,8 +594,16 @@
{% if key in aGroupCol1 %}{% set fSlot = 'g1' %}
{% elseif key in aGroupCol2 %}{% set fSlot = 'g2' %}
{% endif %}
{% elseif bButtonsPane %}
{# row 191 / plan P6: Buttons pane — bfont = the full-width font
row (buttonsfont), b1/b2/b3 = the Previous/Next/Submit columns #}
{% if key == 'buttonsfont' %}{% set fSlot = 'bfont' %}
{% elseif key in aButtonsCol1 %}{% set fSlot = 'b1' %}
{% elseif key in aButtonsCol2 %}{% set fSlot = 'b2' %}
{% elseif key in aButtonsCol3 %}{% set fSlot = 'b3' %}
{% endif %}
{% endif %}
{% if fSlot != fLastSlot and (bFontsPane or bTopPane or bImagesPane or bGroupsPane) %}
{% if fSlot != fLastSlot and (bFontsPane or bTopPane or bImagesPane or bGroupsPane or bButtonsPane) %}
{% if bFontsPane %}
{# row 174: column change inside the single fonts row —
close the previous col-md-4, open the next one #}
@ -615,6 +639,16 @@
col 2 (border-start); the first g1 key opens col 1 #}
{% if fLastSlot == 'g1' %}</div><div class="col-md-6 border-start groups-col-2">{% endif %}
{% if fSlot == 'g1' %}<div class="col-md-6 groups-col-1">{% endif %}
{% elseif bButtonsPane %}
{# row 191 / plan P6: Buttons transitions — bfont -> b1 closes the
font row (row+col) and opens the buttons row + col 1 (Previous);
b1 -> b2 -> b3 move to the next col-md-4 with a border-start
divider (row-178 decision 4 style, like the Groups columns) #}
{% if fLastSlot == 'bfont' %}</div></div>{% endif %}
{% if fLastSlot == 'b1' %}</div><div class="col-md-4 border-start buttons-col-2 buttons-col-next">{% endif %}
{% if fLastSlot == 'b2' %}</div><div class="col-md-4 border-start buttons-col-3 buttons-col-submit">{% endif %}
{% if fSlot == 'bfont' %}<div class="row action_hide_on_inherit buttons-font-row"><div class="col-12">{% endif %}
{% if fSlot == 'b1' %}<div class="row action_hide_on_inherit buttons-row"><div class="col-md-4 buttons-col-1 buttons-col-prev">{% endif %}
{% endif %}
{% set fLastSlot = fSlot %}
{% endif %}
@ -755,7 +789,7 @@
plain grid panes. Without bImagesPane here the wrappers rendered
col-12 col-md-<width> INSIDE the col-md-6 slot column, i.e. only
the left part of each column was used. #}
{% if bQuestionsPane or bTopPane or bGroupsPane or bImagesPane or (bFontsPane and fSlot != 'rest') %}{% set wrapClass = 'col-12' %}{% else %}{% set wrapClass = 'col-12 col-md-' ~ attr.width|default(2) %}{% endif %}
{% if bQuestionsPane or bTopPane or bGroupsPane or bImagesPane or bButtonsPane or (bFontsPane and fSlot != 'rest') %}{% set wrapClass = 'col-12' %}{% else %}{% set wrapClass = 'col-12 col-md-' ~ attr.width|default(2) %}{% endif %}
{# row 188 / plan P5: inside the "Question border" section's radius
subcolumn the four radius options form two rows of two — their
wrappers are half the column (col-md-6) instead of col-12 #}
@ -1014,6 +1048,9 @@
{# row 157: close the open Groups column (each groups slot opens exactly
one div: the col-md-6) #}
{% if tab.id == 'groups' and fLastSlot in ['g1', 'g2'] %}</div>{% endif %}
{# row 191 / plan P6: close the open Buttons slot (bfont opened row+col-12,
b1/b2/b3 opened one col inside the buttons row — both close two divs) #}
{% if tab.category == 'Buttons' and fLastSlot in ['bfont', 'b1', 'b2', 'b3'] %}</div></div>{% endif %}
{# close an open slot container at the end of a Fonts/Top-of-page pane
(every non-logo, non-rest slot has exactly two open divs: row + col) #}
{% if (tab.category == 'Default font and colors' or tab.id == 'top-of-page') and fLastSlot != 0 and fLastSlot != 'rest' and fLastSlot != 'logo' %}</div></div>{% endif %}