Commit 7bac1d37 authored by Chenu Denis's avatar Chenu Denis

[feature] Allow to hide clear all button

parent 03a29f9d
......@@ -16,10 +16,10 @@
<supportUrl>https://extensions.sondages.pro/themes-and-templates/skelvanilla-a11y-and-usuability/</supportUrl>
<copyright>Copyright (C) 2018-2019 Denis Chenu / Sondages Pro</copyright>
<license>GNU General Public License version 3 or later</license>
<version>6.2.1</version>
<version>6.3.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>
<last_update>2019-10-07 08:54:59</last_update>
<last_update>2019-10-08 07:08:51</last_update>
<extends>vanilla</extends>
</metadata>
......@@ -78,6 +78,7 @@
<languagelink>on</languagelink>
<previouslink>off</previouslink>
<nextsubmitlink>off</nextsubmitlink>
<showclearall>on</showclearall>
<availablevariations>{
"contrast": {
"name": "Contrast",
......
......@@ -219,6 +219,31 @@
{% endif %}
</div>
</div>
{# Clear all #}
<div class='col-sm-12 col-md-6 col-lg-3'>
<div class='form-group row'>
<label id='simple_edit_options_showclearall' class='control-label col-xs-4'> {{ gT("Show clear all") }} </label>
<div class='col-xs-8'>
<div class="btn-group" data-toggle="buttons" role='radiogroup' aria-labelledby='simple_edit_options_showclearall' data-default='on'>
<label class="btn btn-default">
<input type='radio' name='showclearall' value='on' class='selector_option_radio_field simple_edit_options_showclearall ' data-id='showclearall'/>
{{ gT("Yes") }}
</label>
<label class="btn btn-default">
<input type='radio' name='showclearall' value='off' class='selector_option_radio_field simple_edit_options_showclearall ' data-id='showclearall'/>
{{ gT("No") }}
</label>
{% if templateConfiguration.sid is not empty or templateConfiguration.gsid is not empty %}
<label class="btn btn-default">
<input type='radio' name='showclearall' value='inherit' class='selector_option_radio_field simple_edit_options_showclearall ' data-id='showclearall'/>
{{ gT("Inherit") }}
</label>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<h3 class="h4 action_hide_on_inherit">{{ gT("Top link actions") }}</h3>
<div class="row action_hide_on_inherit">
......
<div class="{{ aSurveyInfo.class.clearallwrapper }} form-inline">
<label class="form-group {{ aSurveyInfo.class.clearalllabel }}" for="clear-all-id{{ navigatorid }}" >
<input {{ aSurveyInfo.attr.clearallconfirm }} class="{{ aSurveyInfo.class.clearallconfirm }}" id="clear-all-id{{ navigatorid }}" ><span class="control-label">{{gT("Please confirm you want to clear your response?")}}</span>
</label>
<button aria-labelled-by="clear-all-id{{ navigatorid }}" data-disable-check-validity=1 value="clearall" name="clearall" type="submit" data-confirmedby="confirm-clearall" class="{{ aSurveyInfo.class.clearallbutton }} btn btn-link">{{gT("Exit and clear survey")}}</button>
</div>
{% if aSurveyInfo.options.showclearall != 'off' %}
<div class="{{ aSurveyInfo.class.clearallwrapper }} form-inline">
<label class="form-group {{ aSurveyInfo.class.clearalllabel }}" for="clear-all-id{{ navigatorid }}" >
<input {{ aSurveyInfo.attr.clearallconfirm }} class="{{ aSurveyInfo.class.clearallconfirm }}" id="clear-all-id{{ navigatorid }}" ><span class="control-label">{{gT("Please confirm you want to clear your response?")}}</span>
</label>
<button aria-labelled-by="clear-all-id{{ navigatorid }}" data-disable-check-validity=1 value="clearall" name="clearall" type="submit" data-confirmedby="confirm-clearall" class="{{ aSurveyInfo.class.clearallbutton }} btn btn-link">{{gT("Exit and clear survey")}}</button>
</div>
{% endif %}
\ No newline at end of file
{% if (aSurveyInfo.bShowClearAll == true and aSurveyInfo.options.showclearall != 'off') %}
<!-- Exit and clear survey -->
<li class="{{ aSurveyInfo.class.clearalllinks }}" {{ aSurveyInfo.attr.clearalllinks }}>
<a href="#" data-limesurvey-submit='{ "clearall":"clearall" }' data-confirmedby='{ "confirm-clearall":"confirm" }' data-confirmlabel='{{gT("Please confirm you want to clear your response?" )}}' class='{{ aSurveyInfo.class.clearalllink }} animate' {{ aSurveyInfo.attr.clearalllink }}>
{{gT("Exit and clear survey" )}}
</a>
</li>
{% endif %}
......@@ -3,7 +3,7 @@
Copyright (C) 2018 The LimeSurvey Project Team
This file render extra part for navigator
#}
{% if aSurveyInfo.aNavigator.load.show == "Y" or aSurveyInfo.aNavigator.save.show == "Y" or aSurveyInfo.aQuestionIndex.bShow == true or aSurveyInfo.bShowClearAll == true %}
{% if aSurveyInfo.aNavigator.load.show == "Y" or aSurveyInfo.aNavigator.save.show == "Y" or aSurveyInfo.aQuestionIndex.bShow == true or (aSurveyInfo.bShowClearAll == true and aSurveyInfo.options.showclearall != 'off') %}
<!-- extra tools, can be shown with javascript too (just remove ls-js-hidden class -->
<div class="row ls-js-hidden">
<!-- Extra button container -->
......@@ -16,7 +16,7 @@
{% endif %}
</div>
<!-- Index container -->
{% if (aSurveyInfo.aQuestionIndex.bShow == true) %}
{% if aSurveyInfo.aQuestionIndex.bShow == true %}
{{ include('./subviews/navigation/question_index_buttons.twig') }}
{% endif %}
</div>
......
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