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
5 changed files with 71 additions and 17 deletions
32
README.md
32
README.md
|
|
@ -1 +1,31 @@
|
||||||
This is a LimeSurvey version 6 theme as an extension of the Vanilla base theme.
|
Respondage Vanilla — LimeSurvey theme (version 6/7 compatible), extension of the core Vanilla theme.
|
||||||
|
|
||||||
|
This is the MOTHER theme. Client-specific variants (e.g. `<client>_vanilla`)
|
||||||
|
extend this theme via `<extends>respondage_vanilla</extends>` and contain only
|
||||||
|
a generated `config.xml` plus their own `files/` (logos). LimeSurvey inherits
|
||||||
|
all files (views, css, js, images, options page) from the mother theme, so any
|
||||||
|
change to a file in this theme automatically applies to all variants — no
|
||||||
|
copying of files needed.
|
||||||
|
|
||||||
|
## What's in here
|
||||||
|
|
||||||
|
- `config.xml` — theme manifest incl. all theme options (colors, fonts, font
|
||||||
|
sizes/weights/colors, header logos, ...).
|
||||||
|
- `views/` — twig overrides (header with left/center/right logos and navbar
|
||||||
|
menu color, survey list, question, group description).
|
||||||
|
- `sass/` → `css/plain.css` — theme styles (keep both in sync; plain.css is
|
||||||
|
the compiled output of sass/plain.sass).
|
||||||
|
- `css/custom.css`, `scripts/custom.js` — loaded last, safe for project
|
||||||
|
tweaks.
|
||||||
|
- `options/` — options page assets.
|
||||||
|
(`variants/*.json`) hold confidential house-style values, are gitignored
|
||||||
|
(see `.gitignore`) and live in the private variants repo, not here.
|
||||||
|
|
||||||
|
## Header logos (left / center / right)
|
||||||
|
|
||||||
|
Three independent logo options in the Images category: `brandlogo`(+`brandlogofile`)
|
||||||
|
left, `centerlogo`(+`centerlogofile`) center, `rightlogo`(+`rightlogofile`)
|
||||||
|
right. The center logo is absolutely centered in the navbar (see
|
||||||
|
`sass/plain.sass`). Logo files are looked up in the theme's own `files/`
|
||||||
|
folder first, then in the mother theme's `files/` folder.
|
||||||
|
|
||||||
|
|
|
||||||
10
config.xml
10
config.xml
|
|
@ -67,10 +67,12 @@
|
||||||
<fixnumauto type="buttons" category="Simple options" width="4" title="Fix automatically numeric value" options="enable|partial|disable" optionlabels="Yes|For expression|No">enable</fixnumauto>
|
<fixnumauto type="buttons" category="Simple options" width="4" title="Fix automatically numeric value" options="enable|partial|disable" optionlabels="Yes|For expression|No">enable</fixnumauto>
|
||||||
|
|
||||||
<!-- Images -->
|
<!-- Images -->
|
||||||
<brandlogo type="buttons" category="Images" width="2" title="Display main logo" options="on|off" optionlabels="Yes|No">on</brandlogo>
|
<brandlogo type="buttons" category="Images" width="2" title="Display logo on the left of the header" options="on|off" optionlabels="Yes|No">on</brandlogo>
|
||||||
<brandlogofile type="imagefile" category="Images" width="7" title="Main logo file" parent="brandlogo">./files/logo.png</brandlogofile>
|
<brandlogofile type="imagefile" category="Images" width="7" title="Logo file (left)" parent="brandlogo">./files/logo.png</brandlogofile>
|
||||||
<secondlogo type="buttons" category="Images" width="2" title="Display second logo" options="on|off" optionlabels="Yes|No">on</secondlogo>
|
<centerlogo type="buttons" category="Images" width="2" title="Display logo in the center of the header" options="on|off" optionlabels="Yes|No">off</centerlogo>
|
||||||
<secondlogofile type="imagefile" category="Images" width="7" title="Second logo file" parent="secondlogo">./files/logo.png</secondlogofile>
|
<centerlogofile type="imagefile" category="Images" width="7" title="Logo file (center)" parent="centerlogo">./files/logo.png</centerlogofile>
|
||||||
|
<rightlogo type="buttons" category="Images" width="2" title="Display logo on the right of the header" options="on|off" optionlabels="Yes|No">off</rightlogo>
|
||||||
|
<rightlogofile type="imagefile" category="Images" width="7" title="Logo file (right)" parent="rightlogo">./files/logo2.png</rightlogofile>
|
||||||
<backgroundimage type="buttons" category="Images" width="4" title="Background image (behind body of page)" options="on|off" optionlabels="Yes|No">on</backgroundimage>
|
<backgroundimage type="buttons" category="Images" width="4" title="Background image (behind body of page)" options="on|off" optionlabels="Yes|No">on</backgroundimage>
|
||||||
<backgroundimagefixed type="buttons" category="Images" width="4" title="Background image fixed or scroll" options="fixed|scroll" optionlabels="Fixed|Scroll">scroll</backgroundimagefixed>
|
<backgroundimagefixed type="buttons" category="Images" width="4" title="Background image fixed or scroll" options="fixed|scroll" optionlabels="Fixed|Scroll">scroll</backgroundimagefixed>
|
||||||
<backgroundimagedisplay type="buttons" category="Images" width="4" title="Background image display" options="tile|cover" optionlabels="Tile|Cover">tile</backgroundimagedisplay>
|
<backgroundimagedisplay type="buttons" category="Images" width="4" title="Background image display" options="tile|cover" optionlabels="Tile|Cover">tile</backgroundimagedisplay>
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,6 @@
|
||||||
{% set fontOptions = '' %}
|
{% set fontOptions = '' %}
|
||||||
|
|
||||||
{% set brandlogofileOptions , brandlogofileInheritFilename, brandlogofileInheritPreview = '', '', '' %}
|
{% set brandlogofileOptions , brandlogofileInheritFilename, brandlogofileInheritPreview = '', '', '' %}
|
||||||
{% set secondlogofileOptions , secondlogofileInheritFilename, secondlogofileInheritPreview = '', '', '' %}
|
|
||||||
|
|
||||||
{# For surveyspecific settings add an inherit option #}
|
{# For surveyspecific settings add an inherit option #}
|
||||||
{% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}
|
{% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,19 @@
|
||||||
@use 'base'
|
@use 'base'
|
||||||
@use 'surveys-list'
|
@use 'surveys-list'
|
||||||
@use 'progress'
|
@use 'progress'
|
||||||
@use 'extras'
|
@use 'extras'
|
||||||
|
|
||||||
|
/* Header: left, center and right logo in the navbar */
|
||||||
|
#survey-nav .container-fluid,
|
||||||
|
#survey-nav .container
|
||||||
|
position: relative
|
||||||
|
|
||||||
|
#survey-nav .logo-center
|
||||||
|
position: absolute
|
||||||
|
left: 50%
|
||||||
|
top: 50%
|
||||||
|
transform: translate(-50%, -50%)
|
||||||
|
float: none
|
||||||
|
|
||||||
|
#survey-nav .logo-right
|
||||||
|
margin-left: 15px
|
||||||
|
|
@ -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.aQuestionIndex.bShow == true and aSurveyInfo.format != 'A')
|
||||||
or (aSurveyInfo.alanguageChanger.show)
|
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 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 %}
|
{% if ShowMenu %}
|
||||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar"
|
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbar"
|
||||||
aria-controls="small-screens-menus" aria-expanded="false">
|
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>
|
<span class="navbar-toggler-icon" aria-hidden="true"></span>
|
||||||
</button>
|
</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{# Logo option #}
|
{# Left logo #}
|
||||||
{% if( aSurveyInfo.options.brandlogo == "on") %}
|
{% if( aSurveyInfo.options.brandlogo == "on" and imageSrc(aSurveyInfo.options.brandlogofile)) %}
|
||||||
<div class="navbar-brand logo-container d-none d-md-block">
|
<div class="navbar-brand logo-container logo-left d-none d-md-block">
|
||||||
{{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
{{ image(aSurveyInfo.options.brandlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||||
</div>
|
</div>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="navbar-brand">
|
<div class="navbar-brand logo-left">
|
||||||
{{ aSurveyInfo.name }}
|
{{ aSurveyInfo.name }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if( aSurveyInfo.options.secondlogo == "on") %}
|
{# Center logo (absolutely centered via CSS, see sass/plain.sass) #}
|
||||||
<div class="navbar-brand logo-container d-none d-md-block">
|
{% if( aSurveyInfo.options.centerlogo == "on" and imageSrc(aSurveyInfo.options.centerlogofile)) %}
|
||||||
{{ image(aSurveyInfo.options.secondlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
<div class="navbar-brand logo-container logo-center d-none d-md-block">
|
||||||
|
{{ image(aSurveyInfo.options.centerlogofile, aSurveyInfo.name, {"class": "logo img-fluid"}) }}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if ShowMenu %}
|
{% if ShowMenu %}
|
||||||
<div id="navbar" class="collapse navbar-collapse navbar-nav-scroll pt-2">
|
<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 ms-auto">
|
<ul class="nav navbar-nav navbar-action-link navbar-right">
|
||||||
{{ include('./subviews/navigation/save_links.twig') }}
|
{{ include('./subviews/navigation/save_links.twig') }}
|
||||||
{{ include('./subviews/navigation/clearall_links.twig') }}
|
{{ include('./subviews/navigation/clearall_links.twig') }}
|
||||||
{{ include('./subviews/navigation/question_index_menu.twig') }}
|
{{ include('./subviews/navigation/question_index_menu.twig') }}
|
||||||
|
|
@ -62,6 +64,12 @@ For the survey navigator ("Next", "Back", etc.), see: navigation/navigator.twig
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% 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>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue