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:
parent
af3b408768
commit
aae3112981
2 changed files with 212 additions and 63 deletions
|
|
@ -27,6 +27,14 @@
|
|||
{%- set m = mode|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 %}
|
||||
{# Row 191 / row 178 plan P6: like cm(), but for BACKGROUND choosers — mode
|
||||
"default" means "no override" (empty string), so the Bootstrap button default
|
||||
(btn-primary / btn-outline-secondary) stays; all other modes resolve the same
|
||||
way as cm(). Used for the per-button background colors of the navigator. #}
|
||||
{% macro cmbg(mode, custom, opts) -%}
|
||||
{%- set m = mode|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('') : ''))))) -}}
|
||||
{%- endmacro %}
|
||||
{% import _self as cmm %}
|
||||
|
||||
<style>
|
||||
|
|
@ -320,16 +328,51 @@
|
|||
background: {{ aSurveyInfo.options.primarycolor }};
|
||||
}
|
||||
|
||||
.btn-check:active+.btn-primary,
|
||||
.btn-check:checked+.btn-primary,
|
||||
.btn-primary.active,
|
||||
.btn-primary:active,
|
||||
.show>.btn-primary.dropdown-toggle,
|
||||
.show > .btn-primary.dropdown-toggle,
|
||||
.btn-check:active+.btn-primary,
|
||||
.btn-check:checked+.btn-primary,
|
||||
.btn-primary.active,
|
||||
.btn-primary:active,
|
||||
.show>.btn-primary.dropdown-toggle,
|
||||
.show > .btn-primary.dropdown-toggle,
|
||||
.btn-primary:focus {
|
||||
background: {{ aSurveyInfo.options.primarycolor }};
|
||||
}
|
||||
|
||||
{# Row 191 / row 178 plan P6: per-button colors for the navigator buttons
|
||||
(classes respondage-btn-prev/-next/-submit from navigator.twig).
|
||||
Backgrounds resolve via cmbg() (mode "default" = no rule = Bootstrap
|
||||
default button background), text colors via cm() (mode "default" = the
|
||||
default font color). Row-178 decision 7 defaults: Next/Submit background =
|
||||
Color 1, text = Other ... #ffffff; Previous background = Other ... #ffffff,
|
||||
text = Default font color. Legacy stored hex values pass through both
|
||||
macros. The :hover/:focus/:active variants keep the same specificity as
|
||||
Bootstrap's .btn-primary:hover rules above and win because this style
|
||||
block is emitted later. #}
|
||||
{% set sPrevBtnBg = cmm.cmbg(aSurveyInfo.options.previousbuttonbackgroundcolor|default('other'), aSurveyInfo.options.previousbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% set sPrevBtnColor = cmm.cm(aSurveyInfo.options.previousbuttontextcolor|default('default'), aSurveyInfo.options.previousbuttontextcolorcustom|default(''), aSurveyInfo.options) %}
|
||||
{% set sNextBtnBg = cmm.cmbg(aSurveyInfo.options.nextbuttonbackgroundcolor|default('color1'), aSurveyInfo.options.nextbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% set sNextBtnColor = cmm.cm(aSurveyInfo.options.nextbuttontextcolor|default('other'), aSurveyInfo.options.nextbuttontextcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% set sSubmitBtnBg = cmm.cmbg(aSurveyInfo.options.submitbuttonbackgroundcolor|default('color1'), aSurveyInfo.options.submitbuttonbackgroundcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% set sSubmitBtnColor = cmm.cm(aSurveyInfo.options.submitbuttontextcolor|default('other'), aSurveyInfo.options.submitbuttontextcolorcustom|default('#ffffff'), aSurveyInfo.options) %}
|
||||
{% if sPrevBtnBg != '' or sPrevBtnColor != '' %}
|
||||
.respondage-btn-prev, .respondage-btn-prev:hover, .respondage-btn-prev:focus, .respondage-btn-prev:active {
|
||||
{% if sPrevBtnBg != '' %}background: {{ sPrevBtnBg }}; border-color: {{ sPrevBtnBg }};{% endif %}
|
||||
{% if sPrevBtnColor != '' %}color: {{ sPrevBtnColor }};{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
{% if sNextBtnBg != '' or sNextBtnColor != '' %}
|
||||
.respondage-btn-next, .respondage-btn-next:hover, .respondage-btn-next:focus, .respondage-btn-next:active {
|
||||
{% if sNextBtnBg != '' %}background: {{ sNextBtnBg }}; border-color: {{ sNextBtnBg }};{% endif %}
|
||||
{% if sNextBtnColor != '' %}color: {{ sNextBtnColor }};{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
{% if sSubmitBtnBg != '' or sSubmitBtnColor != '' %}
|
||||
.respondage-btn-submit, .respondage-btn-submit:hover, .respondage-btn-submit:focus, .respondage-btn-submit:active {
|
||||
{% if sSubmitBtnBg != '' %}background: {{ sSubmitBtnBg }}; border-color: {{ sSubmitBtnBg }};{% endif %}
|
||||
{% if sSubmitBtnColor != '' %}color: {{ sSubmitBtnColor }};{% endif %}
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
{% set checkicon = '"\\' ~ aSurveyInfo.options.checkicon ~ '"' %}
|
||||
.checkbox-item input[type="checkbox"]:checked + label::after, .checkbox-item input[type="radio"]:checked + label::after {
|
||||
content: {{ checkicon }};
|
||||
|
|
|
|||
|
|
@ -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 %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue