feat(options): Questions tab 'Question title and body' section with 6-way color choosers (row 178 plan P2)

config.xml: new section keys questiontitlefont/textcolor(+custom)/fontsize/
fontoptions + legacy fontcolor (col 1), questiontitlebackgroundcolor(+custom)
(col 2), questionbackgroundcolor(+custom) (col 3); old width-12 Prompt-U keys
and plain colorpickers replaced; questiontitlefontweight -> questiontitlefontoptions.
options.twig: title section slots (were prepared in P1), 3 keys join
aColorChooserKeys, OPTIONS_JS_TOKEN 20261129.1. options.js: same 3 keys in its
aColorChooserKeys. Views: choosers resolved via cm() (chooser wins; legacy hex
and primary/secondary modes pass through; legacy picker used when the mode key
is absent); fontoptions mapped to weight/style with legacy fontweight fallback.
build.php: chooser migration list + questiontitle fontweight migration.
All 3 variants rebuilt (defensie legacy hex -> other+custom), example config synced.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-29 14:45:57 +01:00
commit 14eb1c2a99

View file

@ -21,10 +21,11 @@
headerbackgroundcolor, the progress bar colors and bodybackgroundcolor below
(navbarfontcolor keeps its own inline expression further down). Modes: default|defaultbackgroundcolor|
color1|color2|color3|other, or a raw hex (legacy stored value) which passes
through directly. #}
through directly. Row 180 / plan P2: legacy modes "primary"/"secondary" of the
old 4-way <el>textcolor dropdowns map to color1/color2 as well. #}
{% macro cm(mode, custom, opts) -%}
{%- set m = mode|default('') -%}
{{- m matches '/^#[0-9a-fA-F]{3,8}$/' ? m : (m == 'color1' ? opts.primarycolor|default('') : (m == 'color2' ? opts.secondarycolor|default('') : (m == 'color3' ? opts.tertiarycolor|default('') : (m == 'defaultbackgroundcolor' ? opts.defaultbackgroundcolor|default('') : (m == 'other' ? custom|default('') : opts.fontcolor|default('')))))) -}}
{{- m matches '/^#[0-9a-fA-F]{3,8}$/' ? m : (m == 'color1' or m == 'primary' ? opts.primarycolor|default('') : (m == 'color2' or m == 'secondary' ? opts.secondarycolor|default('') : (m == 'color3' ? opts.tertiarycolor|default('') : (m == 'defaultbackgroundcolor' ? opts.defaultbackgroundcolor|default('') : (m == 'other' ? custom|default('') : opts.fontcolor|default('')))))) -}}
{%- endmacro %}
{% import _self as cmm %}
@ -56,11 +57,25 @@
color: {{ aSurveyInfo.options.fontcolor }};
}
{# Row 180 / plan P2: the question title now uses the color-chooser scheme —
questiontitletextcolor + questiontitletextcolorcustom (text) and
questiontitlebackgroundcolor + questiontitlebackgroundcolorcustom
(background), resolved via cm() (default modes: text "other" per row 178,
background "color1"; legacy stored hex passes through). The CHOOSER wins
when the mode key exists in the stored options; a row from before P2 (no
questiontitletextcolor key) falls back to the legacy plain picker
questiontitlefontcolor. questiontitlefontoptions (normal|bold|italic|
bolditalic) replaces questiontitlefontweight (400|700) — a legacy stored
weight is mapped like the group title/description (row 157). #}
{% set sQTitleFontOptions = aSurveyInfo.options.questiontitlefontoptions|default(aSurveyInfo.options.questiontitlefontweight|default('700') == '700' ? 'bold' : 'normal') %}
{% set sQTitleBackgroundColor = cmm.cm(aSurveyInfo.options.questiontitlebackgroundcolor|default('color1'), aSurveyInfo.options.questiontitlebackgroundcolorcustom|default(''), aSurveyInfo.options) %}
{% set sQTitleTextColor = aSurveyInfo.options.questiontitletextcolor is defined ? cmm.cm(aSurveyInfo.options.questiontitletextcolor, aSurveyInfo.options.questiontitletextcolorcustom|default(''), aSurveyInfo.options) : aSurveyInfo.options.questiontitlefontcolor|default('') %}
.question-title-container {
font-size: {{ aSurveyInfo.options.questiontitlefontsize }};
font-weight: {{ aSurveyInfo.options.questiontitlefontweight }};
background: {{ aSurveyInfo.options.questiontitlebackgroundcolor }};
color: {{ aSurveyInfo.options.questiontitlefontcolor }};
font-weight: {{ sQTitleFontOptions == 'bold' or sQTitleFontOptions == 'bolditalic' ? '700' : '400' }};
font-style: {{ sQTitleFontOptions == 'italic' or sQTitleFontOptions == 'bolditalic' ? 'italic' : 'normal' }};
background: {{ sQTitleBackgroundColor }};
color: {{ sQTitleTextColor }};
}
{# Row 157: group title/description font OPTIONS (config.xml <el>fontoptions:
@ -271,8 +286,12 @@
color: {{ sProgressBarFontColor }};
}
{# Row 180 / plan P2: the question body background is a color chooser now
(questionbackgroundcolor, default mode "defaultbackgroundcolor", +
questionbackgroundcolorcustom for "other"); a legacy stored hex passes
through cm() directly. #}
.question-container, #welcome-container {
background: {{ aSurveyInfo.options.questionbackgroundcolor }};
background: {{ cmm.cm(aSurveyInfo.options.questionbackgroundcolor|default('defaultbackgroundcolor'), aSurveyInfo.options.questionbackgroundcolorcustom|default(''), aSurveyInfo.options) }};
}
.question-help-container, .question-valid-container {
@ -289,8 +308,8 @@
}
.bg-primary{
background-color: {{ aSurveyInfo.options.questiontitlebackgroundcolor }};
color: {{ aSurveyInfo.options.questiontitlefontcolor }};
background-color: {{ sQTitleBackgroundColor }};
color: {{ sQTitleTextColor }};
}
.btn-primary:hover, .btn-primary:focus {