diff --git a/options/options.twig b/options/options.twig index 848efdb..f8ec5ab 100644 --- a/options/options.twig +++ b/options/options.twig @@ -163,6 +163,11 @@ next to it stays empty) directly below the logo hr, in this fixed order. #} {% 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 colors" pane. Per element the keys are font (fontselect), textcolor (dropdown default|primary|secondary|other) and @@ -283,6 +288,64 @@ {% for key in aTabKeys %} {% set attr = aOptionAttributes.optionAttributes[key] ?? 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' %}

{% endif %} + {% if fLastSlot == 'combo3' %}{% endif %} + {% if fSlot == 'top1' %}
+ {% elseif fSlot == 'top2' %}
+ {% elseif fSlot == 'combo1' %}
+ {% elseif fSlot == 'combo2' %}
+ {% elseif fSlot == 'combo3' %}
+ {% endif %} + {% else %} + {# top-of-page transitions: close previous slot, open new slot #} + {% if fLastSlot == 'h1' or fLastSlot == 'h2' %}
+ {% elseif fLastSlot == 'h3' %}

{{ gT("Logos") }}

{{ gT("In this theme there are three positions for separate logos, but it is up to you which positions you want to fill.") }}

+ {% elseif fLastSlot == 'logo' %}

{{ gT("Progress bar") }}

{{ 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.") }}

+ {% elseif fLastSlot == 'ppos' %}
+ {% elseif fLastSlot == 'pcol1' or fLastSlot == 'pcol2' %}
+ {% endif %} + {% if fSlot == 'h1' %}
+ {% elseif fSlot == 'ppos' %}
+ {% endif %} + {% endif %} + {% set fLastSlot = fSlot %} + {% endif %} {% if tab.id == 'top-of-page' and key == 'brandlogofile' %} {# PROMPT M: dedicated 3-column logo block (left/center/right), vertical borders between columns, hr below. Per column, top to bottom: @@ -349,14 +412,6 @@

{% 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' %} -
- {% endif %} {# Prompt R: Questions pane — three columns; open a col-md-4 at the first key and switch column (border-start) whenever the key's column changes. All options in this pane stack as col-12. #} @@ -369,36 +424,7 @@ {% set qLastCol = qCol %} {% endif %} {% endif %} - {# Prompt U: Fonts pane ("Fonts and colors") — slot-based layout. Slots: - 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' %}

{% endif %} - {% if fLastSlot == 'combo3' %}
{% endif %} - {% if fSlot == 'top1' %}
- {% elseif fSlot == 'top2' %}
- {% elseif fSlot == 'combo1' %}
- {% elseif fSlot == 'combo2' %}
- {% elseif fSlot == 'combo3' %}
- {% 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 %} + {% 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 %} {# 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] : '')) %} {# parent != '': this field is only visible when the parent option's value @@ -566,7 +592,7 @@ {% endif %}
- {% if bProgressKey and key == 'progressbarfontcolor' %}
{% endif %} + {% endif %} {% endif %} {% endfor %} @@ -574,7 +600,9 @@ {% if tab.category == 'Questions' and qLastCol > 0 %}
{% endif %} {# Prompt U: close the Fonts pane's open slot container (every non-rest slot has exactly two open divs: row + col) #} - {% if tab.category == 'Fonts' and fLastSlot != 0 and fLastSlot != 'rest' %}
{% 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' %}{% endif %} {% if tab.category == 'Images' %}