Commit 31ba825a authored by Chenu Denis's avatar Chenu Denis
Browse files

[feature] Logo as header

parent d9f8d4f6
......@@ -16,12 +16,12 @@
<supportUrl>https://extensions.sondages.pro/themes-and-templates/skelvanilla-a11y-and-usuability/</supportUrl>
<copyright>Copyright (C) 2018-2020 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 3 or later</license>
<version>9.4.0-alpha</version>
<version>9.4.0</version>
<apiVersion>3</apiVersion>
<description><![CDATA[<strong>LimeSurvey Bootstrap Vanilla Survey Theme with Accessibility and Options</strong><br>Base on vanilla theme, usage of more aria, fix some role and aria from core.<br>Allow usage of a lot of variations, list of variation can be updated. Some decoration option using boostrap class.]]></description>
<extends>vanilla</extends>
<last_update>2020-12-08 17:00:00</last_update>
<lastUpdate>2020-12-08 17:00:00</lastUpdate>
<last_update>2020-12-08 17:44:59</last_update>
<lastUpdate>2020-12-08 17:44:59</lastUpdate>
</metadata>
<files>
......@@ -56,6 +56,7 @@
<questionhtag>off</questionhtag>
<brandlogo>off</brandlogo>
<brandlogofile>./files/logo.png</brandlogofile>
<brandlogoasbanner>off</brandlogoasbanner>
<surveylistlogo>on</surveylistlogo>
<surveylistlogofile>./files/survey_list_header.png</surveylistlogofile>
<poweredlogo>on</poweredlogo>
......
......@@ -17,7 +17,7 @@
.navbar-brand .logo-container {padding:0;padding:0 0.5rem;display:inline-block;}
.navbar-brand .logo-container > img{width:auto;display:inline-block;}
.navbar-brand img {vertical-align: text-bottom;}
.logo-as-banner{margin:0 auto}
.skip-navigation{list-style-type: none;}
.skip-navigation{position:absolute;padding:0}
/* lang can be bigger than screen quick fix*/
......
......@@ -785,6 +785,31 @@
<br/>
<button class="btn btn-default selector__open_lightbox" data-target="#simple_edit_options_brandlogofile"> {{ gT('Preview image')}}</button>
</div>
<div class='col-sm-12 col-md-4'>
{# Brandlogo ad banner #}
<div class='form-group row'>
<label for='simple_edit_options_brandlogoasbanner' class='control-label'>{{ gT("Use logo as banner") }}</label>
<div class='col-sm-12'>
<div class="btn-group" data-toggle="buttons">
<label class="btn btn-default">
<input type='radio' name='brandlogoasbanner' value='on' class='selector_option_radio_field ' data-id='simple_edit_options_brandlogoasbanner'/>
{{gT("Yes" )}}
</label>
<label class="btn btn-default">
<input type='radio' name='brandlogoasbanner' value='off' class='selector_option_radio_field ' data-id='simple_edit_options_brandlogoasbanner'/>
{{ gT("No") }}
</label>
{# If this is a root template setting, don't show the inherit button #}
{% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}
<label class="btn btn-default">
<input type='radio' name='brandlogoasbanner' value='inherit' class='selector_option_radio_field ' data-id='simple_edit_options_brandlogoasbanner'/>
{{ gT("Inherit") }}
</label>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<!-- Survey list Logo -->
......
......@@ -24,11 +24,22 @@
{% if (aSurveyInfo.options.container == "on" and aSurveyInfo.options.headercontainer == "on") %}
{% set containerclass = 'container' %}
{% endif %}
{% set brandlogo = "on" %}
{% if (aSurveyInfo.options.brandlogo == "off" or not imageSrc(aSurveyInfo.options.brandlogofile)) %}
{% set brandlogo = "off" %}
{% else %}
{%if aSurveyInfo.options.brandlogoasbanner == "on" %}
{% set brandlogo = "banner" %}
{% endif %}
{% endif %}
<!-- Bootstrap Navigation Bar -->
{% if(aSurveyInfo.class.navbar) %}
{% if(aSurveyInfo.options.fixedheader == 'on') %}
<div class="invisible navbar navbar-inverse navbar-static-top" aria-hidden="true">
<div class="{{ containerclass }}">
{% if brandlogo == "banner" %}
{{ image(aSurveyInfo.options.brandlogofile, "", {"class": "logo-as-banner banner img-responsive"}) }}
{% endif %}
<div class="{{ aSurveyInfo.class.navbarheader }}">
{% if(hasMenu) %}
<button type="button" class="{{ aSurveyInfo.class.navbartoggle }}" {{ aSurveyInfo.attr.navbartoggle }} >
......@@ -39,8 +50,8 @@
</button>
{% endif %}
{% if(aSurveyInfo.options.titlelocation != 'content') %}
<div class="h1 {{ aSurveyInfo.class.navbarbrand }} {% if( aSurveyInfo.options.brandlogo == "on") %}with-logo{% endif %}" {{ aSurveyInfo.attr.navbarbrand }} >
{% if( aSurveyInfo.options.brandlogo == "on") %}
<div class="h1 {{ aSurveyInfo.class.navbarbrand }} {% if( brandlogo == "on") %}with-logo{% endif %}" {{ aSurveyInfo.attr.navbarbrand }} >
{% if( brandlogo == "on") %}
<span class="logo-container">
{{ image(aSurveyInfo.options.brandlogofile, "", {"class": "logo img-responsive"}) }}
</span>
......@@ -50,13 +61,13 @@
{% if(aSurveyInfo.options.titlelocation == 'hidden') %}</div>{% endif %}
</div>
{% else %}
<div class="h1 {{ aSurveyInfo.class.navbarbrand }} {% if( aSurveyInfo.options.brandlogo == "on") %}with-logo{% endif %}" {{ aSurveyInfo.attr.navbarbrand }} aria-hidden="true" >
{% if( aSurveyInfo.options.brandlogo == "on") %}
<span class="logo-container">
{{ image(aSurveyInfo.options.brandlogofile, "", {"class": "logo img-responsive"}) }}
</span>
{% endif %}
{% if( brandlogo == "on") %}
<div class="h1 {{ aSurveyInfo.class.navbarbrand }} {% if( brandlogo == "on") %}with-logo{% endif %}" {{ aSurveyInfo.attr.navbarbrand }} aria-hidden="true" >
<span class="logo-container">
{{ image(aSurveyInfo.options.brandlogofile, "", {"class": "logo img-responsive"}) }}
</span>
</div>
{% endif %}
{% endif %}
</div>
</div>
......@@ -64,6 +75,9 @@
{% endif %}
<header class="{{ aSurveyInfo.class.navbar }} {{ (aSurveyInfo.options.fixedheader == 'on') ? 'navbar-fixed-top' : 'navbar-static-top' }} hidden-print" role="banner" {{ aSurveyInfo.attr.navbar }}>
<div class="{{ containerclass }}" role="navigation">
{% if brandlogo == "banner" %}
{{ image(aSurveyInfo.options.brandlogofile, "", {"class": "logo-as-banner banner img-responsive"}) }}
{% endif %}
<div class="{{ aSurveyInfo.class.navbarheader }}" {{ aSurveyInfo.attr.navbarheader }} >
{{ include('./subviews/navigation/shortcuts_links.twig') }}
{% if(hasMenu) %}
......@@ -75,8 +89,8 @@
</button>
{% endif %}
{% if(aSurveyInfo.options.titlelocation != 'content') %}
<h1 class="{{ aSurveyInfo.class.navbarbrand }} {% if( aSurveyInfo.options.brandlogo == "on") %}with-logo{% endif %}" {{ aSurveyInfo.attr.navbarbrand }} >
{% if( aSurveyInfo.options.brandlogo == "on") %}
<h1 class="{{ aSurveyInfo.class.navbarbrand }} {% if( brandlogo == "on") %}with-logo{% endif %}" {{ aSurveyInfo.attr.navbarbrand }} >
{% if( brandlogo == "on") %}
<span class="logo-container">
{{ image(aSurveyInfo.options.brandlogofile, "", {"class": "logo img-responsive"}) }}
</span>
......@@ -86,13 +100,13 @@
{% if(aSurveyInfo.options.titlelocation == 'hidden') %}</div>{% endif %}
</h1>
{% else %}
<div class="h1 {{ aSurveyInfo.class.navbarbrand }} {% if( aSurveyInfo.options.brandlogo == "on") %}with-logo{% endif %}" {{ aSurveyInfo.attr.navbarbrand }} aria-hidden="true" >
{% if( aSurveyInfo.options.brandlogo == "on") %}
{% if( brandlogo == "on") %}
<div class="h1 {{ aSurveyInfo.class.navbarbrand }} {% if( brandlogo == "on") %}with-logo{% endif %}" {{ aSurveyInfo.attr.navbarbrand }} aria-hidden="true" >
<span class="logo-container">
{{ image(aSurveyInfo.options.brandlogofile, "", {"class": "logo img-responsive"}) }}
</span>
{% endif %}
</div>
</div>
{% endif %}
{% endif %}
</div>
{% if(hasMenu) %}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment