feat(options): Top-of-page tab in sections — Header (3 cols) | Logos | Progress bar (Prompt X)

The Top-of-page pane is now structured in sections with translatable
h2+p intros (gT): 'Header' (full width), then a 3-column row
(col 1 header background color, col 2 menu item text color, col 3
'Make header sticky' + 3 checkboxes), a full-width hr; 'Logos' intro +
the existing 3-column logo block + its hr; 'Progress bar' intro,
position in column 1 (cols 2-3 empty), then a new row with the three
progress bar colors, one per column, in the existing order.
Implemented via the slot mechanism (fSlot/fLastSlot) shared with the
Fonts pane; the old Prompt N single-column progress block is replaced.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-25 13:34:40 +01:00
commit cf2acebc1a

View file

@ -163,6 +163,11 @@
next to it stays empty) directly below the logo hr, in this fixed order. #} next to it stays empty) directly below the logo hr, in this fixed order. #}
{% set aProgressKeys = ['progressbarposition', 'progressbarbackgroundcolor', 'progressbarcolor', 'progressbarfontcolor'] %} {% set aProgressKeys = ['progressbarposition', 'progressbarbackgroundcolor', 'progressbarcolor', 'progressbarfontcolor'] %}
{# Prompt X: the "Header" section of the Top-of-page tab is a 3-column row:
col 1 = headerbackgroundcolor, col 2 = navbarfontcolor, col 3 = the sticky
group (master label "Make header sticky" + 3 checkboxes). #}
{% set aTopStickyKeys = ['headersticky', 'headerstickycomputer', 'headerstickytablet', 'headerstickymobile'] %}
{# Prompt U: the elements that get a font+color combo row in the "Fonts and {# Prompt U: the elements that get a font+color combo row in the "Fonts and
colors" pane. Per element <el> the keys are <el>font (fontselect), colors" pane. Per element <el> the keys are <el>font (fontselect),
<el>textcolor (dropdown default|primary|secondary|other) and <el>textcolor (dropdown default|primary|secondary|other) and
@ -283,6 +288,64 @@
{% for key in aTabKeys %} {% for key in aTabKeys %}
{% set attr = aOptionAttributes.optionAttributes[key] ?? null %} {% set attr = aOptionAttributes.optionAttributes[key] ?? null %}
{% if attr is not null %} {% if attr is not null %}
{# Slot-based pane layouts (Prompt U fonts, Prompt X top-of-page): on a
slot change the previous container is closed and the new one opened.
Every slot is row+col (two divs), except 'logo' (self-contained block)
and 'rest' (normal grid). Computed BEFORE the logo-block branch so
the transition into the logo slot also fires. #}
{% set bFontsPane = tab.category == 'Fonts' %}
{% set bTopPane = tab.id == 'top-of-page' %}
{% set fSlot = 'rest' %}
{% if bFontsPane %}
{% if key in aFontsTop1 %}{% set fSlot = 'top1' %}
{% elseif key in aFontsTop2 %}{% set fSlot = 'top2' %}
{% else %}
{% for el in aFontElements %}
{% if key == el ~ 'font' %}{% set fSlot = 'combo1' %}
{% elseif key == el ~ 'textcolor' %}{% set fSlot = 'combo2' %}
{% elseif key == el ~ 'textcolorcustom' %}{% set fSlot = 'combo3' %}{% endif %}
{% endfor %}
{% endif %}
{% elseif bTopPane %}
{# Prompt X: Top-of-page sections — Header (3 cols:
headerbackgroundcolor | navbarfontcolor | sticky group), hr,
Logos (h2+p, then the logo block, then its hr), Progress bar
(h2+p, position in col 1 with empty cols 2-3, then a colors row
with one colorpicker per column, in current order). #}
{% if key in aLogoKeys %}{% set fSlot = 'logo' %}
{% elseif key == 'headerbackgroundcolor' %}{% set fSlot = 'h1' %}
{% elseif key == 'navbarfontcolor' %}{% set fSlot = 'h2' %}
{% elseif key in aTopStickyKeys %}{% set fSlot = 'h3' %}
{% elseif key == 'progressbarposition' %}{% set fSlot = 'ppos' %}
{% elseif key == 'progressbarbackgroundcolor' %}{% set fSlot = 'pcol1' %}
{% elseif key == 'progressbarcolor' %}{% set fSlot = 'pcol2' %}
{% elseif key == 'progressbarfontcolor' %}{% set fSlot = 'pcol3' %}
{% endif %}
{% endif %}
{% if fSlot != fLastSlot and (bFontsPane or bTopPane) %}
{% if bFontsPane %}
{% if fLastSlot == 'top2' %}</div><div class="col-md-4"></div></div><div class="row action_hide_on_inherit"><div class="col-12"><hr class="fonts-hr"></div></div>{% endif %}
{% if fLastSlot == 'combo3' %}</div></div>{% endif %}
{% if fSlot == 'top1' %}<div class="row fonts-top-row"><div class="col-md-4">
{% elseif fSlot == 'top2' %}</div><div class="col-md-4">
{% elseif fSlot == 'combo1' %}<div class="row font-combo-row"><div class="col-md-4">
{% elseif fSlot == 'combo2' %}</div><div class="col-md-4">
{% elseif fSlot == 'combo3' %}</div><div class="col-md-4">
{% endif %}
{% else %}
{# top-of-page transitions: close previous slot, open new slot #}
{% if fLastSlot == 'h1' or fLastSlot == 'h2' %}</div><div class="col-md-4">
{% elseif fLastSlot == 'h3' %}</div></div><div class="row action_hide_on_inherit"><div class="col-12"><hr class="top-section-hr"></div></div><div class="row action_hide_on_inherit top-section-intro"><div class="col-12"><h2>{{ gT("Logos") }}</h2><p>{{ gT("In this theme there are three positions for separate logos, but it is up to you which positions you want to fill.") }}</p></div></div>
{% elseif fLastSlot == 'logo' %}<div class="row action_hide_on_inherit top-section-intro"><div class="col-12"><h2>{{ gT("Progress bar") }}</h2><p>{{ gT("The progress bar can be switched on/off per survey in the survey settings. Here in this section you can choose how the progress bar looks when displayed.") }}</p></div></div>
{% elseif fLastSlot == 'ppos' %}</div><div class="col-md-4"></div><div class="col-md-4"></div></div><div class="row action_hide_on_inherit progress-colors-row"><div class="col-md-4">
{% elseif fLastSlot == 'pcol1' or fLastSlot == 'pcol2' %}</div><div class="col-md-4">
{% endif %}
{% if fSlot == 'h1' %}<div class="row action_hide_on_inherit top-section-header"><div class="col-md-4">
{% elseif fSlot == 'ppos' %}<div class="row action_hide_on_inherit progress-block"><div class="col-md-4">
{% endif %}
{% endif %}
{% set fLastSlot = fSlot %}
{% endif %}
{% if tab.id == 'top-of-page' and key == 'brandlogofile' %} {% if tab.id == 'top-of-page' and key == 'brandlogofile' %}
{# PROMPT M: dedicated 3-column logo block (left/center/right), vertical {# PROMPT M: dedicated 3-column logo block (left/center/right), vertical
borders between columns, hr below. Per column, top to bottom: borders between columns, hr below. Per column, top to bottom:
@ -349,14 +412,6 @@
<div class="row action_hide_on_inherit"><div class="col-12"><hr class="logo-columns-hr"></div></div> <div class="row action_hide_on_inherit"><div class="col-12"><hr class="logo-columns-hr"></div></div>
</div> </div>
{% elseif key not in aLogoKeys %} {% elseif key not in aLogoKeys %}
{# Prompt N: in the Top-of-page tab the progress keys form ONE column below
the logo hr — open a row + col-md-4 at the first progress key and close
it (with an empty col-md-8) at the last; inside the column the wrapper
is plain col-12 so the options stack vertically. #}
{% set bProgressKey = (tab.id == 'top-of-page' and key in aProgressKeys) %}
{% if bProgressKey and key == 'progressbarposition' %}
<div class="row action_hide_on_inherit progress-block"><div class="col-md-4">
{% endif %}
{# Prompt R: Questions pane — three columns; open a col-md-4 at the {# Prompt R: Questions pane — three columns; open a col-md-4 at the
first key and switch column (border-start) whenever the key's first key and switch column (border-start) whenever the key's
column changes. All options in this pane stack as col-12. #} column changes. All options in this pane stack as col-12. #}
@ -369,36 +424,7 @@
{% set qLastCol = qCol %} {% set qLastCol = qCol %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{# Prompt U: Fonts pane ("Fonts and colors") — slot-based layout. Slots: {% if bQuestionsPane or bTopPane or (bFontsPane and fSlot != 'rest') %}{% set wrapClass = 'col-12' %}{% else %}{% set wrapClass = 'col-12 col-md-' ~ attr.width|default(2) %}{% endif %}
top1 (top row col 1), top2 (top row col 2), combo1/2/3 (per-element
combo row cols 1-3), rest (sizes/weights, normal grid). On slot
change close the previous container(s) and open the new one. All
slots except rest have exactly two open divs (row + col). #}
{% set bFontsPane = tab.category == 'Fonts' %}
{% set fSlot = 'rest' %}
{% if bFontsPane %}
{% if key in aFontsTop1 %}{% set fSlot = 'top1' %}
{% elseif key in aFontsTop2 %}{% set fSlot = 'top2' %}
{% else %}
{% for el in aFontElements %}
{% if key == el ~ 'font' %}{% set fSlot = 'combo1' %}
{% elseif key == el ~ 'textcolor' %}{% set fSlot = 'combo2' %}
{% elseif key == el ~ 'textcolorcustom' %}{% set fSlot = 'combo3' %}{% endif %}
{% endfor %}
{% endif %}
{% if fSlot != fLastSlot %}
{% if fLastSlot == 'top2' %}</div><div class="col-md-4"></div></div><div class="row action_hide_on_inherit"><div class="col-12"><hr class="fonts-hr"></div></div>{% endif %}
{% if fLastSlot == 'combo3' %}</div></div>{% endif %}
{% if fSlot == 'top1' %}<div class="row fonts-top-row"><div class="col-md-4">
{% elseif fSlot == 'top2' %}</div><div class="col-md-4">
{% elseif fSlot == 'combo1' %}<div class="row font-combo-row"><div class="col-md-4">
{% elseif fSlot == 'combo2' %}</div><div class="col-md-4">
{% elseif fSlot == 'combo3' %}</div><div class="col-md-4">
{% endif %}
{% set fLastSlot = fSlot %}
{% endif %}
{% endif %}
{% if bQuestionsPane or bProgressKey or (bFontsPane and fSlot != 'rest') %}{% set wrapClass = 'col-12' %}{% else %}{% set wrapClass = 'col-12 col-md-' ~ attr.width|default(2) %}{% endif %}
{# server-side current value for this option (checked/selected/value) #} {# server-side current value for this option (checked/selected/value) #}
{% set currentValue = bGeneralInherit ? 'inherit' : (aCurrentOptions[key] is defined ? aCurrentOptions[key] : (oParentOptions[key] is defined ? oParentOptions[key] : '')) %} {% set currentValue = bGeneralInherit ? 'inherit' : (aCurrentOptions[key] is defined ? aCurrentOptions[key] : (oParentOptions[key] is defined ? oParentOptions[key] : '')) %}
{# parent != '': this field is only visible when the parent option's value {# parent != '': this field is only visible when the parent option's value
@ -566,7 +592,7 @@
{% endif %} {% endif %}
</div> </div>
</div> </div>
{% if bProgressKey and key == 'progressbarfontcolor' %}</div><div class="col-md-8"></div></div>{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
@ -574,7 +600,9 @@
{% if tab.category == 'Questions' and qLastCol > 0 %}</div>{% endif %} {% if tab.category == 'Questions' and qLastCol > 0 %}</div>{% endif %}
{# Prompt U: close the Fonts pane's open slot container (every non-rest {# Prompt U: close the Fonts pane's open slot container (every non-rest
slot has exactly two open divs: row + col) #} slot has exactly two open divs: row + col) #}
{% if tab.category == 'Fonts' and fLastSlot != 0 and fLastSlot != 'rest' %}</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 == 'Fonts' or tab.id == 'top-of-page') and fLastSlot != 0 and fLastSlot != 'rest' and fLastSlot != 'logo' %}</div></div>{% endif %}
</div> </div>
{% if tab.category == 'Images' %} {% if tab.category == 'Images' %}