Commit 3d1222a6 authored by Chenu Denis's avatar Chenu Denis
Browse files

[fix] 2 real step clearall

- Fix LimeSurvey 17623 issue
parent 29e0cd92
......@@ -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>10.4.7</version>
<version>10.4.8</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>2021-09-24 14:17:00</last_update>
<lastUpdate>2021-09-24 14:17:00</lastUpdate>
<last_update>2021-09-28 16:33:00</last_update>
<lastUpdate>2021-09-28 16:33:00</lastUpdate>
</metadata>
<files>
......@@ -396,6 +396,7 @@
<file type="view" role="subview">./subviews/content/mainrow.twig</file>
<file type="view" role="subview">./subviews/content/outerframe.twig</file>
<file type="view" role="content">./subviews/content/clearall.twig</file>
<file type="view" role="content">./subviews/content/clearall_confirm.twig</file>
<file type="css">./css/bootstrap.css</file>
<file type="css">./css/theme.css</file>
<file type="js">./scripts/theme.js</file>
......
{#
LimeSurvey accessible vanilla
Copyright (C) 2007-2020 Denis Chenu
LimeSurvey accessible vanilla and other optimization
Copyright (C) 2007-2021 Denis Chenu
Copyright (C) 2007-2018 The LimeSurvey Project Team
All rights reserved.
License: GNU/GPL License v4 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.
See https://github.com/LimeSurvey/LimeSurvey/blob/master/themes/survey/vanilla/views/layout_global.twig for general comment about LimeSurvey themes
For this template :
......@@ -28,6 +23,15 @@
{% set bodyClass = aSurveyInfo.class.body ~ " " ~ str_replace(['variations/','css/', '.css','.min','-','_'],['skelvanilla-','', '','',' skelvanilla-',' skelvanilla-'],theme) %}
<body class="{% if(aSurveyInfo.options.bodyloaded == 'on' or not aSurveyInfo.options.bodyloaded) %}body-loading {% endif %}{{ bodyClass }} lang-{{aSurveyInfo.languagecode}} {{aSurveyInfo.surveyformat}} {{ ( aSurveyInfo.options.brandlogo == 'on') ? 'with-brand-logo' : '' }} {{ (aSurveyInfo.options.fixedheader == 'on') ? 'with-navbar-fixed-top ' }}{{ (aSurveyInfo.options.tableheader != 'off') ? 'table-fixed-header ' }}" >
<div id="{{ aSurveyInfo.id.dynamicreload }}">
{# Fix LimeSurvey issue 17623 #}
{% if(getPost('clearall') == 'clearall' and getPost('move') != 'clearcancel') %}
{% set aSurveyInfo = aSurveyInfo|merge({
"include_content": 'clearall_confirm',
"aNavigator": { },
"aQuestionIndex": { },
"bShowClearAll": false
}) %}
{% endif %}
{% block body %}
{# Bootstrap Navigation Bar: the top menu #}
{% block nav_bar %}
......
{#
LimeSurvey
Copyright (C) 2007-2017 The LimeSurvey Project Team / Louis Gac
All rights reserved.
License: GNU/GPL License v2 or later, see LICENSE.php
LimeSurvey is free software. This version may have been modified pursuant
to the GNU General Public License, and as distributed it includes or
is derivative of works licensed under the GNU General Public License or
other free or open source software licenses.
See COPYRIGHT.php for copyright notices and details.
(¯`·._.·(¯`·._.· Clear All Content ·._.·´¯)·._.·´¯)
This file displays the page shown to a respondent when they have cleared the survey (only show "Restart this survey")
NOTE: This content is included inside mainrow.twig
#}
<div class='{{ aSurveyInfo.class.clearall }}' {{ aSurveyInfo.attr.clearall }}>
<div class=" {{ aSurveyInfo.class.clearalldiv }} " {{ aSurveyInfo.attr.clearalldiv }}>
<p>{{ gT("Answers cleared") }}</p>
<a href="{{ createUrl( "survey/index", {
'sid': aSurveyInfo.sid,
'newtest': "Y",
}) }}" class="{{ aSurveyInfo.class.clearalla }}" {{ aSurveyInfo.attr.clearalla }}>{{ gT("Restart this survey") }}</a>
</div>
</div>
{% if(getPost('confirm-clearall') == 'confirm') %}
{{ include('./subviews/content/clearall.twig') }}
{% else %}
<div class='row' >
<div class="col-md-6 col-md-offset-3">
{{ include('./subviews/header/start_form.twig') }}
<p id="clear-all-id{{ navigatorid }}">{{gT("Please confirm you want to clear your response?" )}}</p>
<input type="hidden" name="clearall" value="clearall">
<div class="btn-group btn-group-justified" role="group" aria-labelledby="clear-all-id{{ navigatorid }}">
<div class="btn-group">
<a href="{{ aSurveyInfo.surveyUrl }}" class="btn btn-success" name="move" value="clearcancel">{{ gT("Cancel")}} </a>
</div>
<div class="btn-group">
<button type="submit" class="btn btn-danger" name="confirm-clearall" value="confirm">{{ gT("Confirm")}} </button>
</div>
</div>
</form>
</div>
</div>
{% endif %}
{% 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-labelledby="clear-all-id{{ navigatorid }}" value="clearall" name="clearall" type="submit" data-confirmedby="confirm-clearall" class="{{ aSurveyInfo.class.clearallbutton }} btn btn-link">{{gT("Exit and clear survey")}}</button>
<button value="clearall" name="clearall" type="submit" class="{{ aSurveyInfo.class.clearallbutton }} btn btn-warning">{{gT("Exit and clear survey")}}</button>
</div>
{% endif %}
{% if (aSurveyInfo.bShowClearAll == true and aSurveyInfo.options.showclearall != 'off') %}
<!-- Exit and clear survey -->
<li class="{{ aSurveyInfo.class.clearalllinks }}" {{ aSurveyInfo.attr.clearalllinks }}>
<a role="button" tabindex="0" 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 }}>
<a role="button" tabindex="0" data-limesurvey-submit='{ "clearall":"clearall" }' class='{{ aSurveyInfo.class.clearalllink }} animate' {{ aSurveyInfo.attr.clearalllink }}>
{{gT("Exit and clear survey" )}}
</a>
</li>
......
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