refactor(options): rename the 'Top of the page' tab to 'Header'

Row 161. Tab label and config.xml category both become 'Header' (standing
rule row 160: category = tab label), so the core options renderer also
shows a 'Header' tab. The tab id stays 'top-of-page' so stored tab
preferences and the options.js #top-of-page hook keep working.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-27 03:17:57 +01:00
commit d05b5ce226
3 changed files with 49 additions and 49 deletions

View file

@ -175,8 +175,8 @@
<secondarycolor type="colorpicker" category="Default fonts and colors" width="3" title="Color 2" options="on|off" optionlabels="Yes|No">#888888</secondarycolor>
<tertiarycolor type="colorpicker" category="Default fonts and colors" width="3" title="Color 3" options="on|off" optionlabels="Yes|No">#dddddd</tertiarycolor>
<!-- Top of the page tab (options.twig tab 2, keys in aTopOfPageKeys order): header font + menu text color, header background color, sticky per device + header height, then the three logos, then the progress bar position/font/colors. -->
<headerfont type="fontselect" category="Top of the page" width="4" title="Font for the header / top menu">base</headerfont>
<!-- Header tab (options.twig tab 2, keys in aTopOfPageKeys order): header font + menu text color, header background color, sticky per device + header height, then the three logos, then the progress bar position/font/colors. -->
<headerfont type="fontselect" category="Header" width="4" title="Font for the header / top menu">base</headerfont>
<!-- Working example (row 115, reordered + relabelled row 125): menu item color
as a preset dropdown. The KEY navbarfontcolor is kept (stored DB values
stay attached); the type changes colorpicker -> dropdown with modes
@ -201,7 +201,7 @@
"Default background color", "Color 1", "Color 2", "Color 3",
"Other ..." — options.js appends each entry's live hexcode in brackets
(for "Other ..." the custom color's hex) and bolds the default. -->
<navbarfontcolor type="dropdown" category="Top of the page" width="4" title="Text color in header" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">default
<navbarfontcolor type="dropdown" category="Header" width="4" title="Text color in header" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">default
<dropdownoptions>
<option value="default" data-default="1">[Default font color]</option>
<option value="defaultbackgroundcolor">Default background color</option>
@ -210,8 +210,8 @@
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></navbarfontcolor>
<navbarfontcolorcustom type="colorpicker" category="Top of the page" width="4" title="Custom text color in header (for 'Other ...')" parent="navbarfontcolor">#444444</navbarfontcolorcustom>
<!-- Color choosers of the Top of the page tab (rows 115/135/149): HOUSE-STYLE colors, set per
<navbarfontcolorcustom type="colorpicker" category="Header" width="4" title="Custom text color in header (for 'Other ...')" parent="navbarfontcolor">#444444</navbarfontcolorcustom>
<!-- Color choosers of the Header tab (rows 115/135/149): HOUSE-STYLE colors, set per
variant via variants/<client>.json. sliderhandlecolor + privacybackgroundcolor remain in
the Colors category (no custom tab yet — Prompt T). -->
@ -228,7 +228,7 @@
carries the [ ] marker of that option's own default. A legacy stored HEX
value migrates client-side to mode "other" + hex into the <key>custom
child (options.js colorModeUI), and the views accept a raw hex directly. -->
<headerbackgroundcolor type="dropdown" category="Top of the page" width="4" title="Header background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">defaultbackgroundcolor
<headerbackgroundcolor type="dropdown" category="Header" width="4" title="Header background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">defaultbackgroundcolor
<dropdownoptions>
<option value="default">Default font color</option>
<option value="defaultbackgroundcolor" data-default="1">[Default background color]</option>
@ -237,8 +237,8 @@
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></headerbackgroundcolor>
<headerbackgroundcolorcustom type="colorpicker" category="Top of the page" width="4" title="Custom header background color (for 'Other ...')" parent="headerbackgroundcolor">#ffffff</headerbackgroundcolorcustom>
<!-- Header sticky per screen size (shown in the "Top of the page" tab).
<headerbackgroundcolorcustom type="colorpicker" category="Header" width="4" title="Custom header background color (for 'Other ...')" parent="headerbackgroundcolor">#ffffff</headerbackgroundcolorcustom>
<!-- Header sticky per screen size (shown in the "Header" tab).
Breakpoints are Bootstrap's default ones: phone < md (768px),
tablet = md..lg (768-991px), computer >= lg (992px). nav_bar.twig no
longer hardcodes fixed-top; custom_header.twig emits the media
@ -250,17 +250,17 @@
visible, stacked as a list via width=12). Migration note: an old row
with headersticky=off no longer disables sticky — only the checkboxes
count (defaults on/on/off). -->
<headersticky type="buttons" category="Top of the page" width="4" title="Make header sticky" options="on|off" optionlabels="Yes|No">on</headersticky>
<headerstickycomputer type="checkbox" category="Top of the page" width="4" title="Computer screen">on</headerstickycomputer>
<headerstickytablet type="checkbox" category="Top of the page" width="4" title="Tablet">on</headerstickytablet>
<headerstickymobile type="checkbox" category="Top of the page" width="4" title="Mobile phone">off</headerstickymobile>
<headersticky type="buttons" category="Header" width="4" title="Make header sticky" options="on|off" optionlabels="Yes|No">on</headersticky>
<headerstickycomputer type="checkbox" category="Header" width="4" title="Computer screen">on</headerstickycomputer>
<headerstickytablet type="checkbox" category="Header" width="4" title="Tablet">on</headerstickytablet>
<headerstickymobile type="checkbox" category="Header" width="4" title="Mobile phone">off</headerstickymobile>
<!-- Row 138: header bar height. Applied as min-height on #survey-nav in
custom_header.twig (the "px" unit is added there; |replace guards against
a stored value that still carries the unit). min-height so taller logos
can still grow the bar — the sticky body padding follows nav.height().
Default 90 px. Sticky defaults above: computer + tablet on, mobile off. -->
<headerheight type="text" category="Top of the page" width="4" title="Header bar height, in px">90</headerheight>
<!-- Logos in the Top of the page tab (row 159). HOUSE-STYLE: logo files are set per
<headerheight type="text" category="Header" width="4" title="Header bar height, in px">90</headerheight>
<!-- Logos in the Header tab (row 159). HOUSE-STYLE: logo files are set per
variant via variants/<client>.json. -->
<!-- Logos (Prompt M): per logo (left=brand, center, right) a file dropdown whose
FIRST option is "No logo" (value "off", prepended by options.twig), a top
@ -273,32 +273,32 @@
The old keys (brandlogo/centerlogo/rightlogo, *logohideonsmall, the shared
logotopmargin) were removed; variants/build.php maps the variant json's
old keys onto these new keys. -->
<brandlogofile type="imagefile" category="Top of the page" width="4" title="Logo file (left)">./files/logo-left.png</brandlogofile>
<brandlogotopmargin type="text" category="Top of the page" width="4" title="Margin between logo and top of screen (left), in px (0-100)">30</brandlogotopmargin>
<brandshowoncomputer type="checkbox" category="Top of the page" width="4" title="Computer screen">on</brandshowoncomputer>
<brandshowontablet type="checkbox" category="Top of the page" width="4" title="Tablet">on</brandshowontablet>
<brandshowonmobile type="checkbox" category="Top of the page" width="4" title="Mobile phone">off</brandshowonmobile>
<centerlogofile type="imagefile" category="Top of the page" width="4" title="Logo file (center)">./files/logo.png</centerlogofile>
<centerlogotopmargin type="text" category="Top of the page" width="4" title="Margin between logo and top of screen (center), in px (0-100)">30</centerlogotopmargin>
<centershowoncomputer type="checkbox" category="Top of the page" width="4" title="Computer screen">on</centershowoncomputer>
<centershowontablet type="checkbox" category="Top of the page" width="4" title="Tablet">on</centershowontablet>
<centershowonmobile type="checkbox" category="Top of the page" width="4" title="Mobile phone">off</centershowonmobile>
<rightlogofile type="imagefile" category="Top of the page" width="4" title="Logo file (right)">./files/logo-right.png</rightlogofile>
<rightlogotopmargin type="text" category="Top of the page" width="4" title="Margin between logo and top of screen (right), in px (0-100)">30</rightlogotopmargin>
<rightshowoncomputer type="checkbox" category="Top of the page" width="4" title="Computer screen">on</rightshowoncomputer>
<rightshowontablet type="checkbox" category="Top of the page" width="4" title="Tablet">on</rightshowontablet>
<rightshowonmobile type="checkbox" category="Top of the page" width="4" title="Mobile phone">off</rightshowonmobile>
<!-- Progress bar position (now category "Top of the page" — row 159) -->
<brandlogofile type="imagefile" category="Header" width="4" title="Logo file (left)">./files/logo-left.png</brandlogofile>
<brandlogotopmargin type="text" category="Header" width="4" title="Margin between logo and top of screen (left), in px (0-100)">30</brandlogotopmargin>
<brandshowoncomputer type="checkbox" category="Header" width="4" title="Computer screen">on</brandshowoncomputer>
<brandshowontablet type="checkbox" category="Header" width="4" title="Tablet">on</brandshowontablet>
<brandshowonmobile type="checkbox" category="Header" width="4" title="Mobile phone">off</brandshowonmobile>
<centerlogofile type="imagefile" category="Header" width="4" title="Logo file (center)">./files/logo.png</centerlogofile>
<centerlogotopmargin type="text" category="Header" width="4" title="Margin between logo and top of screen (center), in px (0-100)">30</centerlogotopmargin>
<centershowoncomputer type="checkbox" category="Header" width="4" title="Computer screen">on</centershowoncomputer>
<centershowontablet type="checkbox" category="Header" width="4" title="Tablet">on</centershowontablet>
<centershowonmobile type="checkbox" category="Header" width="4" title="Mobile phone">off</centershowonmobile>
<rightlogofile type="imagefile" category="Header" width="4" title="Logo file (right)">./files/logo-right.png</rightlogofile>
<rightlogotopmargin type="text" category="Header" width="4" title="Margin between logo and top of screen (right), in px (0-100)">30</rightlogotopmargin>
<rightshowoncomputer type="checkbox" category="Header" width="4" title="Computer screen">on</rightshowoncomputer>
<rightshowontablet type="checkbox" category="Header" width="4" title="Tablet">on</rightshowontablet>
<rightshowonmobile type="checkbox" category="Header" width="4" title="Mobile phone">off</rightshowonmobile>
<!-- Progress bar position (now category "Header" — row 159) -->
<!-- Prompt N: listing order swapped — "In header" FIRST, then "Under header".
The stored value semantics are unchanged (in|under); the default stays "under". -->
<progressbarposition type="buttons" category="Top of the page" width="4" title="Position of the progress bar" options="in|under" optionlabels="In header|Under header">under</progressbarposition>
<progressbarfont type="fontselect" category="Top of the page" width="4" title="Font for the progress bar">base</progressbarfont>
<progressbarposition type="buttons" category="Header" width="4" title="Position of the progress bar" options="in|under" optionlabels="In header|Under header">under</progressbarposition>
<progressbarfont type="fontselect" category="Header" width="4" title="Font for the progress bar">base</progressbarfont>
<!-- Row 135: progress bar colors as color-choosers. Layout in the "Top of the
page" tab (options.twig slots): progress bar color = COLUMN 1, progress
background = COLUMN 2, progress font color = COLUMN 3 (with an extra tip
underneath). Defaults: progress bar color = Color 1, progress background =
Default background color, progress font color = Default font color. -->
<progressbarcolor type="dropdown" category="Top of the page" width="4" title="Progress bar color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">color1
<progressbarcolor type="dropdown" category="Header" width="4" title="Progress bar color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">color1
<dropdownoptions>
<option value="default">Default font color</option>
<option value="defaultbackgroundcolor">Default background color</option>
@ -307,8 +307,8 @@
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></progressbarcolor>
<progressbarcolorcustom type="colorpicker" category="Top of the page" width="4" title="Custom progress bar color (for 'Other ...')" parent="progressbarcolor">#5e1c64</progressbarcolorcustom>
<progressbarbackgroundcolor type="dropdown" category="Top of the page" width="4" title="Progress bar background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">defaultbackgroundcolor
<progressbarcolorcustom type="colorpicker" category="Header" width="4" title="Custom progress bar color (for 'Other ...')" parent="progressbarcolor">#5e1c64</progressbarcolorcustom>
<progressbarbackgroundcolor type="dropdown" category="Header" width="4" title="Progress bar background color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">defaultbackgroundcolor
<dropdownoptions>
<option value="default">Default font color</option>
<option value="defaultbackgroundcolor" data-default="1">[Default background color]</option>
@ -317,8 +317,8 @@
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></progressbarbackgroundcolor>
<progressbarbackgroundcolorcustom type="colorpicker" category="Top of the page" width="4" title="Custom progress bar background color (for 'Other ...')" parent="progressbarbackgroundcolor">#eeeeee</progressbarbackgroundcolorcustom>
<progressbarfontcolor type="dropdown" category="Top of the page" width="4" title="Progress bar font color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">default
<progressbarbackgroundcolorcustom type="colorpicker" category="Header" width="4" title="Custom progress bar background color (for 'Other ...')" parent="progressbarbackgroundcolor">#eeeeee</progressbarbackgroundcolorcustom>
<progressbarfontcolor type="dropdown" category="Header" width="4" title="Progress bar font color" options="default|defaultbackgroundcolor|color1|color2|color3|other" optionlabels="Default font color|Default background color|Color 1|Color 2|Color 3|Other ...">default
<dropdownoptions>
<option value="default" data-default="1">[Default font color]</option>
<option value="defaultbackgroundcolor">Default background color</option>
@ -327,7 +327,7 @@
<option value="color3">Color 3</option>
<option value="other">Other ...</option>
</dropdownoptions></progressbarfontcolor>
<progressbarfontcolorcustom type="colorpicker" category="Top of the page" width="4" title="Custom progress bar font color (for 'Other ...')" parent="progressbarfontcolor">#ffffff</progressbarfontcolorcustom>
<progressbarfontcolorcustom type="colorpicker" category="Header" width="4" title="Custom progress bar font color (for 'Other ...')" parent="progressbarfontcolor">#ffffff</progressbarfontcolorcustom>
<!-- Page background tab (options.twig tab 3, aImagesPaneKeys order): overall background color (chooser + custom), then the background image on/off + its detail options. -->
<!-- Row 149: the overall background color is a color-chooser dropdown like the

View file

@ -889,7 +889,7 @@ var ThemeOptions = function () {
if (customInput.length) { customInput.on('input change', refreshAll); }
};
// THEME ADDITION (row 136): in the "Top of the page" tab the header row is
// THEME ADDITION (row 136): in the "Header" tab the header row is
// col 1 = font + text color in header, col 2 = header background color. Lower the
// background column so its option aligns with the color option in col 1:
// measure the vertical distance between the navbarfontcolor block's top and
@ -1214,7 +1214,7 @@ $(function () {
addUploadedImageToSelectors(data && data.file);
}
});
// row 139: second upload widget in the "Top of the page" tab (under the logos
// row 139: second upload widget in the "Header" tab (under the logos
// row) — own input/progress ids, same shared upload form; uploads land in the
// same image selectors via addUploadedImageToSelectors
new BindUpload({

View file

@ -13,7 +13,7 @@
dropdown plus "Same as base font"; see the branch below.)
Tab order: the "Default fonts and colors" category tab is FIRST (default font +
per-element font overrides), then the "Top of the page" tab, then the "Page
per-element font overrides), then the "Header" tab, then the "Page
background" tab, then the "Groups" tab, then the other remaining categories,
and LAST the "Other options" tab.
@ -297,7 +297,7 @@
{% set aGroupCol2 = ['groupdescriptionfont', 'groupdescriptiontextcolor', 'groupdescriptiontextcolorcustom', 'groupdescriptionfontsize', 'groupdescriptionfontoptions'] %}
{# Tab list: FIRST the "Default fonts and colors" tab (where the default/base font
is chosen and the per-element font overrides live), then the "Top of the page"
is chosen and the per-element font overrides live), then the "Header" tab
tab (keys = aTopOfPageKeys), then row 147: the "Page background" tab (the
config.xml "Page background" category, id kept as 'category-images' so the
stored tab preference stays valid), then the "Groups" tab (keys = aGroupKeys),
@ -308,9 +308,9 @@
{% if 'Default fonts and colors' in aOptionAttributes.categories %}
{% set aTabs = [{ 'id': 'category-fonts', 'label': 'Default fonts and colors', 'category': 'Default fonts and colors', 'keys': null }] %}
{% endif %}
{% set aTabs = aTabs|merge([{ 'id': 'top-of-page', 'label': 'Top of the page', 'category': 'Top of the page', 'keys': aTopOfPageKeys }]) %}
{% set aTabs = aTabs|merge([{ 'id': 'top-of-page', 'label': 'Header', 'category': 'Header', 'keys': aTopOfPageKeys }]) %}
{# row 147/159: "Page background" category -> the Page background tab, directly after
Top of the page #}
Header tab #}
{% set aImagesKeys = [] %}
{% for key, attr in aOptionAttributes.optionAttributes %}
{% if key != 'ajaxmode' and attr.category == 'Page background' and key not in aTopOfPageKeys %}
@ -329,10 +329,10 @@
slot layout below instead of the Questions 3-column grid. #}
{% set aTabs = aTabs|merge([{ 'id': 'groups', 'label': 'Groups', 'category': 'Groups', 'keys': aGroupKeys }]) %}
{% for category in aOptionAttributes.categories %}
{% if category != 'Default fonts and colors' and category != 'Top of the page' and category != 'Colors' and category != 'Page background' and category != 'Groups' and category != 'Other options' %}
{% if category != 'Default fonts and colors' and category != 'Header' and category != 'Colors' and category != 'Page background' and category != 'Groups' and category != 'Other options' %}
{# The "Colors" tab is removed on purpose. Its only remaining options are
sliderhandlecolor and privacybackgroundcolor (the other Colors keys carry
category "Top of the page" now) — TODO: place these two
category "Header" now) — TODO: place these two
options on another tab. #}
{# Resolve this category's keys once and skip the tab entirely when none
remain: e.g. "Progress" — its only option (progressbarposition)
@ -387,10 +387,10 @@
{% endfor %}
{% else %}
{# the top-of-page tab also picks up options that literally carry the
category "Top of the page" (so config.xml may use it after a reset) #}
category "Header" (so config.xml may use it after a reset) #}
{% if tab.id == 'top-of-page' %}
{% for key, attr in aOptionAttributes.optionAttributes %}
{% if key != 'ajaxmode' and attr.category == 'Top of the page' and key not in aTabKeys %}
{% if key != 'ajaxmode' and attr.category == 'Header' and key not in aTabKeys %}
{% set aTabKeys = aTabKeys|merge([key]) %}
{% endif %}
{% endfor %}
@ -866,7 +866,7 @@
</div>
</div>
{# same translatable, scope-dependent help text as under the upload
widget in the Top of the page tab (rows 140/141) #}
widget in the Header tab (rows 140/141) #}
<div class="row">
<div class="col-12">
<div class="form-text mt-1">{% if bInherit %}{{ gT("Upload here the files for logos and background. You are in the settings for your specific survey now, so files that you upload here are available for this survey only. If you want a file to be available for all surveys, upload it at the global theme settings options page.") }}{% else %}{{ gT("Upload here the files for logos and background. You are in global settings now, so files that you upload here are available for all surveys. If you want a file to be available only for your specific survey, upload it at the theme settings options page for that specific survey.") }}{% endif %}</div>