feat(header): left, center and right logos in the header navbar
- config.xml: brandlogo/brandlogofile = left logo; new centerlogo/centerlogofile and rightlogo/rightlogofile options; old secondlogo/secondlogofile removed. - nav_bar.twig renders the three positions: left in flow, center absolutely centered, right flush right (ms-auto on the logo, menu keeps ms-auto when no right logo). Logos render only when the file resolves (imageSrc guard). - sass/plain.sass: flex/relative container + absolute centering for .logo-center. - options/options.twig: removed dead secondlogo variables. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
parent
7fdf23d196
commit
cee78a973f
1 changed files with 71 additions and 17 deletions
|
|
@ -28,8 +28,9 @@ 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)) %}
|
||||
<div id="survey-nav" class="navbar {{ navClass }} navbar-expand-md fixed-top border-bottom pt-0 pb-0">
|
||||
<div class="container-fluid">
|
||||
<div class="container-fluid d-flex align-items-center">
|
||||
{% if ShowMenu %}
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar"
|
||||
aria-controls="small-screens-menus" aria-expanded="false">
|
||||
|
|
@ -37,24 +38,25 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
|||
<span class="navbar-toggler-icon" aria-hidden="true"></span>
|
||||
</button>
|
||||
{% endif %}
|
||||
{# Logo option #}
|
||||
{% if( aSurveyInfo.options.brandlogo == "on") %}
|
||||
<div class="navbar-brand logo-container d-none d-md-block">
|
||||
{# Left logo #}
|
||||
{% if( aSurveyInfo.options.brandlogo == "on" and imageSrc(aSurveyInfo.options.brandlogofile)) %}
|
||||
<div class="navbar-brand logo-container logo-left d-none d-md-block">
|
||||
{{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="navbar-brand">
|
||||
<div class="navbar-brand logo-left">
|
||||
{{ aSurveyInfo.name }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if( aSurveyInfo.options.secondlogo == "on") %}
|
||||
<div class="navbar-brand logo-container d-none d-md-block">
|
||||
{{ image(aSurveyInfo.options.secondlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
{# 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 d-none d-md-block">
|
||||
{{ image(aSurveyInfo.options.centerlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if ShowMenu %}
|
||||
<div id="navbar" class="collapse navbar-collapse navbar-nav-scroll pt-2">
|
||||
<ul class="nav navbar-nav navbar-action-link navbar-right ms-auto">
|
||||
<div id="navbar" class="collapse navbar-collapse navbar-nav-scroll pt-2 {{ showRightLogo ? "" : "ms-auto" }}">
|
||||
<ul class="nav navbar-nav navbar-action-link navbar-right">
|
||||
{{ include('./subviews/navigation/save_links.twig') }}
|
||||
{{ include('./subviews/navigation/clearall_links.twig') }}
|
||||
{{ include('./subviews/navigation/question_index_menu.twig') }}
|
||||
|
|
@ -62,6 +64,12 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
|||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{# Right logo #}
|
||||
{% if showRightLogo %}
|
||||
<div class="navbar-brand logo-container logo-right d-none d-md-block ms-auto">
|
||||
{{ image(aSurveyInfo.options.rightlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
|
|
|||
Loading…
Reference in a new issue