Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Dev: added more subviews for group rendering in Vanilla
  • Loading branch information
LouisGac committed Dec 1, 2017
1 parent a294908 commit 0e91e39
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 31 deletions.
32 changes: 2 additions & 30 deletions themes/survey/vanilla/views/subviews/survey/group.twig
Expand Up @@ -22,37 +22,9 @@

<!-- START OF GROUP: {{ aGroup.name }} {{ aGroup.gid }} -->
<div id='group-{{ aGroup.gseq }}' class="{{ aSurveyInfo.class.groupoutercontainer }}{{ aGroup.class }} space-col" {{ aSurveyInfo.attr.questiongroup }}>
<div class="{{ aSurveyInfo.class.groupcontainer }} space-col" {{ aSurveyInfo.attr.groupcontainer }}>
<div class="{{ aSurveyInfo.class.grouptitle }} text-center h3 space-col" {{ aSurveyInfo.attr.grouptitle }}>
{{ aGroup.name }}
</div>

<!-- Group description -->
{% if aGroup.description != '' %}
<div class="{{ aSurveyInfo.class.groupdesc }} row well space-col" {{ aSurveyInfo.attr.groupdesc }}>
{{ aGroup.description }}
</div>
{% endif %}
{# The container div itself could often change from a template to another, so we clearly separate it. #}
{{ include('./subviews/survey/group_subviews/group_container.twig') }}

{#
PRESENT THE QUESTIONS
This is the main part. It will render each question for this group
#}

<!-- PRESENT THE QUESTIONS -->
{% for aQuestion in aGroup.aQuestions %}
{{ include('./subviews/survey/question_container.twig') }}
{% endfor %}

<!-- Hidden inputs -->
{% if aGroup.show_last_group == true %}
<input type='hidden' name='lastgroup' value='{{ aGroup.lastgroup }}' id='lastgroup' />
{% endif %}

{% if aGroup.show_last_answer == true %}
<input type='hidden' name='lastanswer' value='{{ aGroup.lastanswer }}' id='lastanswer' />
{% endif %}
</div>
</div>
<!-- END OF GROUP: {{ aGroup.name }} {{ aGroup.gid }} -->
@@ -0,0 +1,48 @@
{#
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.
(¯`·._.·(¯`·._.· Group Container ·._.·´¯)·._.·´¯)
The container div itself could often change from a template to another, so we clearly separate it.
NOTE: see views/subviews/survey/group.twig comments for more infos
#}

<div class="{{ aSurveyInfo.class.groupcontainer }} space-col" {{ aSurveyInfo.attr.groupcontainer }}>

{# Group Name #}
{{ include('./subviews/survey/group_subviews/group_name.twig') }}

{# Group Description #}
{{ include('./subviews/survey/group_subviews/group_desc.twig') }}

{#
PRESENT THE QUESTIONS
This is the main part. It will render each question for this group
#}

<!-- PRESENT THE QUESTIONS -->
{% for aQuestion in aGroup.aQuestions %}
{{ include('./subviews/survey/question_container.twig') }}
{% endfor %}

<!-- Hidden inputs -->
{% if aGroup.show_last_group == true %}
<input type='hidden' name='lastgroup' value='{{ aGroup.lastgroup }}' id='lastgroup' />
{% endif %}

{% if aGroup.show_last_answer == true %}
<input type='hidden' name='lastanswer' value='{{ aGroup.lastanswer }}' id='lastanswer' />
{% endif %}
</div>
@@ -0,0 +1,26 @@
{#
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.
(¯`·._.·(¯`·._.· Group Name ·._.·´¯)·._.·´¯)
Presentation of the group description
NOTE: see views/subviews/survey/group.twig comments for more infos
#}

{% if aGroup.description != '' %}
<!-- Group description -->
<div class="{{ aSurveyInfo.class.groupdesc }} row well space-col" {{ aSurveyInfo.attr.groupdesc }}>
{{ aGroup.description }}
</div>
{% endif %}
@@ -0,0 +1,24 @@
{#
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.
(¯`·._.·(¯`·._.· Group Name ·._.·´¯)·._.·´¯)
Presentation of the group name
NOTE: see views/subviews/survey/group.twig comments for more infos
#}

<!-- Group Name -->
<div class="{{ aSurveyInfo.class.grouptitle }} text-center h3 space-col" {{ aSurveyInfo.attr.grouptitle }}>
{{ aGroup.name }}
</div>
Expand Up @@ -11,7 +11,7 @@
(¯`·._.·(¯`·._.· Survey Question Help Layout ·._.·´¯)·._.·´¯)
(¯`·._.·(¯`·._.· Survey Question Help ·._.·´¯)·._.·´¯)
The additional question help as entered by the survey creator in question editing
NOTE: see views/subviews/survey/question.twig comments for more infos
Expand Down

0 comments on commit 0e91e39

Please sign in to comment.