feat(options): logo section as 3 columns (file/margin/per-device) in Top-of-page tab
Prompt M: per logo position (left=brand, center, right) the options page now
shows one column with vertical separators and an <hr> below: file dropdown
with 'No logo' (off) first, top margin as plain number 0-100, and 'Show logo
on' with computer/tablet/mobile checkboxes. New option keys per position:
<pos>logofile, <pos>logotopmargin, <pos>showon{computer,tablet,mobile};
old keys (brandlogo/centerlogo/rightlogo, *logohideonsmall, shared
logotopmargin) removed from config.xml. Views map the checkboxes to
Bootstrap display classes per breakpoint and emit per-logo padding-top;
variants/build.php migrates the old json keys to the new ones.
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
b44d120d7d
commit
751954c340
1 changed files with 197 additions and 35 deletions
|
|
@ -16,6 +16,26 @@ See: https://getbootstrap.com/components/#navbar
|
|||
|
||||
For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
||||
#}
|
||||
{# Prompt M: per-device visibility of a logo as Bootstrap display classes.
|
||||
Options per position: <pos>showoncomputer (default on), <pos>showontablet
|
||||
(default on), <pos>showonmobile (default off). Breakpoints are Bootstrap's:
|
||||
mobile < 768px (< md), tablet 768-991px (md..lg), computer >= 992px (>= lg).
|
||||
A plain div is block at every size, so each range needs its explicit class. #}
|
||||
{% macro logoVisibilityClasses(options, pos) -%}
|
||||
{%- set c = (options[pos ~ 'showoncomputer']|default('on')) == 'on' -%}
|
||||
{%- set t = (options[pos ~ 'showontablet']|default('on')) == 'on' -%}
|
||||
{%- set m = (options[pos ~ 'showonmobile']|default('off')) == 'on' -%}
|
||||
{%- if c and t and m -%}
|
||||
{%- elseif m and t -%}d-lg-none
|
||||
{%- elseif m and c -%}d-md-none d-lg-block
|
||||
{%- elseif m -%}d-md-none
|
||||
{%- elseif t and c -%}d-none d-md-block
|
||||
{%- elseif c -%}d-none d-lg-block
|
||||
{%- elseif t -%}d-none d-md-block d-lg-none
|
||||
{%- else -%}d-none
|
||||
{%- endif -%}
|
||||
{%- endmacro %}
|
||||
{% import _self as navmacros %}
|
||||
{% if not aSurveyInfo.popupPreview %}
|
||||
{% set navClass = "navbar-light bg-light" %}
|
||||
{% if( aSurveyInfo.template == "bootswatch") %}
|
||||
|
|
@ -28,7 +48,15 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
|||
or (aSurveyInfo.aQuestionIndex.bShow == true and aSurveyInfo.format != 'A')
|
||||
or (aSurveyInfo.alanguageChanger.show)
|
||||
%}
|
||||
{% set showRightLogo = (aSurveyInfo.options.rightlogo == "on" and imageSrc(aSurveyInfo.options.rightlogofile)) %}
|
||||
{# THEME ADDITION (Prompt M): per-logo file option (<pos>logofile; "off" or
|
||||
empty = no logo). The old on/off keys (brandlogo/centerlogo/rightlogo)
|
||||
are gone — the file option alone decides whether a logo shows. #}
|
||||
{% set brandLogoFile = aSurveyInfo.options.brandlogofile|default('off') %}
|
||||
{% set centerLogoFile = aSurveyInfo.options.centerlogofile|default('off') %}
|
||||
{% set rightLogoFile = aSurveyInfo.options.rightlogofile|default('off') %}
|
||||
{% set showBrandLogo = (brandLogoFile not in ['off', '', 'inherit'] and imageSrc(brandLogoFile)) %}
|
||||
{% set showCenterLogo = (centerLogoFile not in ['off', '', 'inherit'] and imageSrc(centerLogoFile)) %}
|
||||
{% set showRightLogo = (rightLogoFile not in ['off', '', 'inherit'] and imageSrc(rightLogoFile)) %}
|
||||
{# THEME ADDITION: font for the header / top menu (config.xml option "headerfont",
|
||||
type fontselect). "base" = same as the base font: no extra class, the navbar
|
||||
inherits the body font (body gets font-<base font>). Applied on #survey-nav,
|
||||
|
|
@ -41,11 +69,6 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
|||
the media queries instead. Before a reset the old behaviour (always
|
||||
fixed-top) is kept as fallback. #}
|
||||
{% set bStickyConfigured = aSurveyInfo.options.headerstickycomputer is defined %}
|
||||
{# Per-logo "hide on small screens" (Bootstrap classes d-none d-md-block).
|
||||
Default (option missing or "on") keeps the logo hidden below the md breakpoint. #}
|
||||
{% set hideSmallLeft = (aSurveyInfo.options.brandlogohideonsmall != "off") %}
|
||||
{% set hideSmallCenter = (aSurveyInfo.options.centerlogohideonsmall != "off") %}
|
||||
{% set hideSmallRight = (aSurveyInfo.options.rightlogohideonsmall != "off") %}
|
||||
<div id="survey-nav" class="navbar {{ navClass }} navbar-expand-md {% if not bStickyConfigured %}fixed-top{% endif %} border-bottom pt-0 pb-0 {% if sHeaderFont != 'base' %}font-{{ sHeaderFont }}{% endif %}">
|
||||
<div class="container-fluid d-flex align-items-center">
|
||||
{% if ShowMenu %}
|
||||
|
|
@ -56,9 +79,9 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
|||
</button>
|
||||
{% endif %}
|
||||
{# Left logo #}
|
||||
{% if( aSurveyInfo.options.brandlogo == "on" and imageSrc(aSurveyInfo.options.brandlogofile)) %}
|
||||
<div class="navbar-brand logo-container logo-left {{ hideSmallLeft ? 'd-none d-md-block' : '' }}">
|
||||
{{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
{% if showBrandLogo %}
|
||||
<div class="navbar-brand logo-container logo-left {{ navmacros.logoVisibilityClasses(aSurveyInfo.options, 'brand') }}">
|
||||
{{ image(brandLogoFile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="navbar-brand logo-left">
|
||||
|
|
@ -66,9 +89,9 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
|||
</div>
|
||||
{% endif %}
|
||||
{# Center logo (absolutely centered via CSS, see sass/plain.sass) #}
|
||||
{% if( aSurveyInfo.options.centerlogo == "on" and imageSrc(aSurveyInfo.options.centerlogofile)) %}
|
||||
<div class="navbar-brand logo-container logo-center {{ hideSmallCenter ? 'd-none d-md-block' : '' }}">
|
||||
{{ image(aSurveyInfo.options.centerlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
{% if showCenterLogo %}
|
||||
<div class="navbar-brand logo-container logo-center {{ navmacros.logoVisibilityClasses(aSurveyInfo.options, 'center') }}">
|
||||
{{ image(centerLogoFile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{# RIGHT zone — always pushed to the far right (ms-auto on the wrapper).
|
||||
|
|
@ -82,8 +105,8 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
|||
<div class="survey-nav-right ms-auto d-flex flex-column align-items-end">
|
||||
{# Right logo #}
|
||||
{% if showRightLogo %}
|
||||
<div class="navbar-brand logo-container logo-right {{ hideSmallRight ? 'd-none d-md-block' : '' }}">
|
||||
{{ image(aSurveyInfo.options.rightlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
<div class="navbar-brand logo-container logo-right {{ navmacros.logoVisibilityClasses(aSurveyInfo.options, 'right') }}">
|
||||
{{ image(rightLogoFile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ShowMenu %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue