feat(options): Questions tab starts with 'Overall question' section + 2 distance options (plan P1)

Questions pane now has h2 'Questions' + intro paragraph, then an h3
'Overall question' section rendered as ONE col-md-6 column holding two new
text options — questiondistance ('Distance between two questions') and
questiondistancebottom ('Distance between last question and buttons at
bottom of page'), both default 30px and accepting px or rem — followed by a
full-width hr before the existing 3-column grid. custom_header.twig applies
them as CSS: .question-container margin-bottom and #navigator-container
margin-top, guarded to ^<number>(px|rem)$ with fallback 30px. config.xml:
both keys first in the Questions category, width=6 (row 160 rule). All
variants rebuilt + example config synced. jsdom: new row-179 assertions,
suite 8/8; live survey page emits both rules at 30px.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
Tammo ter Hark 2026-11-29 14:27:52 +01:00
commit c4ec304dd0
4 changed files with 54 additions and 6 deletions

View file

@ -401,6 +401,15 @@
<groupdescriptionfontoptions type="buttons" category="Groups" width="6" title="Group description font options" options="normal|bold|italic|bolditalic" optionlabels="Normal|Bold|Italic|Bold italic">normal</groupdescriptionfontoptions>
<!-- Questions tab (options.twig tab 5): first the three columns (col 1 colors+help, col 2 border + children, col 3 checkbox color; width 4 = col-md-4 columns), then the rest full-width (width 12). -->
<!-- Row 179 / plan P1: the Questions tab starts with the "Overall question"
section — ONE col-md-6 column (width 6) holding the two distance options,
followed by a full-width hr in options.twig. Values are free text in px or
rem (default 30px) and are applied as CSS in custom_header.twig:
questiondistance = margin-bottom of .question-container,
questiondistancebottom = margin-top of #navigator-container (the bottom
Previous/Next/Submit buttons). NOT house-style (structural). -->
<questiondistance type="text" category="Questions" width="6" title="Distance between two questions (px or rem)">30px</questiondistance>
<questiondistancebottom type="text" category="Questions" width="6" title="Distance between last question and buttons at bottom of page (px or rem)">30px</questiondistancebottom>
<!-- Questions
HOUSE-STYLE: the colorpicker options in this section (question
title/background/help/help-font/border/checkbox colors) are house-style

View file

@ -293,6 +293,9 @@
{% set aQuestionsCol1 = ['questiontitlebackgroundcolor', 'questiontitlefontcolor', 'questionbackgroundcolor', 'questionhelpbackgroundcolor', 'questionhelpfontcolor', 'questionhelptextposition'] %}
{% set aQuestionsCol2 = ['questionborder', 'questionbordercolor', 'questionborderstyle', 'questiondropdown', 'questionborderradiusTL', 'questionborderradiusTR', 'questionborderradiusBL', 'questionborderradiusBR'] %}
{% set aQuestionsCol3 = ['checkboxcolor'] %}
{# row 179 / plan P1: the "Overall question" section at the top of the Questions
pane — qCol 4, rendered as ONE col-md-6 column, followed by a full-width hr #}
{% set aQuestionsOverall = ['questiondistance', 'questiondistancebottom'] %}
{# row 147: all group-related options of the "Questions" category — they are
pulled out of the Questions tab into a dedicated "Groups" tab (aGroupsTab below).
@ -449,6 +452,13 @@
<p>{{ gT("Groups are more or less the same as pages. In the survey settings you can decide to show or hide the group title and the group description. Here you choose how they look when shown.") }}</p>
</div></div>
{% endif %}
{% if tab.category == 'Questions' %}
{# row 179 / plan P1: h2 + intro of the Questions tab #}
<div class="row action_hide_on_inherit questions-intro"><div class="col-12">
<h2>{{ gT("Questions") }}</h2>
<p>{{ gT("Questions are the core of a survey. Here you create your own design of how questions are displayed to your respondent.") }}</p>
</div></div>
{% endif %}
<div class="row action_hide_on_inherit">
{% set qLastCol = 0 %}
{% set fLastSlot = 0 %}
@ -657,11 +667,16 @@
{% elseif key not in aLogoKeys %}
{% set bQuestionsPane = tab.category == 'Questions' %}
{% if bQuestionsPane %}
{% set qCol = key in aQuestionsCol1 ? 1 : (key in aQuestionsCol2 ? 2 : (key in aQuestionsCol3 ? 3 : 0)) %}
{# row 179: qCol 4 = the "Overall question" section (one
col-md-6), leaving it emits a full-width hr; border-start
only between the grid columns 1-3 #}
{% set qCol = key in aQuestionsOverall ? 4 : (key in aQuestionsCol1 ? 1 : (key in aQuestionsCol2 ? 2 : (key in aQuestionsCol3 ? 3 : 0))) %}
{% if qCol != qLastCol %}
{% if qLastCol > 0 %}</div>{% endif %}
{% if qCol > 0 %}
<div class="col-md-4{% if qLastCol > 0 %} border-start{% endif %} questions-col-{{ qCol }}">
{% if qLastCol == 4 %}</div></div><div class="row action_hide_on_inherit"><div class="col-12"><hr class="questions-section-hr"></div></div>
{% elseif qLastCol > 0 %}</div>{% endif %}
{% if qCol == 4 %}<div class="row action_hide_on_inherit questions-section-intro"><div class="col-12"><h3>{{ gT("Overall question") }}</h3></div></div><div class="row action_hide_on_inherit questions-overall-row"><div class="col-md-6 questions-col-overall">
{% elseif qCol > 0 %}
<div class="col-md-4{% if qLastCol in [1, 2, 3] %} border-start{% endif %} questions-col-{{ qCol }}">
{% endif %}
{% set qLastCol = qCol %}
{% endif %}
@ -916,7 +931,7 @@
{% elseif fLastSlot == 'bg1' %}</div>
{% endif %}
{% endif %}
{% if tab.category == 'Questions' and qLastCol > 0 %}</div>{% endif %}
{% if tab.category == 'Questions' and qLastCol == 4 %}</div></div>{% elseif tab.category == 'Questions' and qLastCol > 0 %}</div>{% endif %}
{# row 157: close the open Groups column (each groups slot opens exactly
one div: the col-md-6) #}
{% if tab.id == 'groups' and fLastSlot in ['g1', 'g2'] %}</div>{% endif %}

View file

@ -31,7 +31,7 @@
<version>3.3.0</version>
<apiVersion>3</apiVersion>
<description>&lt;strong&gt;Example variant of Respondage Vanilla&lt;/strong&gt;&lt;br&gt;Public example of a build output: only a few house-style option values differ, all views, CSS and JS are inherited from the mother theme via extends.</description>
<lastUpdate>2026-11-29 10:53:15</lastUpdate>
<lastUpdate>2026-11-29 13:20:28</lastUpdate>
<extends>vanilla_respondage</extends>
</metadata>
<compatibility>
@ -303,6 +303,15 @@
<groupdescriptionfontsize type="buttons" category="Groups" width="6" title="Group description font size" options="1.0rem|1.2rem|1.5rem|2.0rem|20px|24px" optionlabels="Same as Base Font Size(BFS)|1.2 BFS|1.5 BFS|2.0 BFS|20px|24px">1.2rem</groupdescriptionfontsize>
<groupdescriptionfontoptions type="buttons" category="Groups" width="6" title="Group description font options" options="normal|bold|italic|bolditalic" optionlabels="Normal|Bold|Italic|Bold italic">normal</groupdescriptionfontoptions>
<!-- Questions tab (options.twig tab 5): first the three columns (col 1 colors+help, col 2 border + children, col 3 checkbox color; width 4 = col-md-4 columns), then the rest full-width (width 12). -->
<!-- Row 179 / plan P1: the Questions tab starts with the "Overall question"
section — ONE col-md-6 column (width 6) holding the two distance options,
followed by a full-width hr in options.twig. Values are free text in px or
rem (default 30px) and are applied as CSS in custom_header.twig:
questiondistance = margin-bottom of .question-container,
questiondistancebottom = margin-top of #navigator-container (the bottom
Previous/Next/Submit buttons). NOT house-style (structural). -->
<questiondistance type="text" category="Questions" width="6" title="Distance between two questions (px or rem)">30px</questiondistance>
<questiondistancebottom type="text" category="Questions" width="6" title="Distance between last question and buttons at bottom of page (px or rem)">30px</questiondistancebottom>
<!-- Questions
HOUSE-STYLE: the colorpicker options in this section (question
title/background/help/help-font/border/checkbox colors) are house-style

View file

@ -91,6 +91,21 @@
}
{% endif %}
{# Row 179 / plan P1: distances in the Questions tab ("Overall question" section).
Free text in px or rem (default 30px); only emitted when the value matches
^<number>(px|rem)$ — anything else falls back to 30px. questiondistance is
the margin-bottom between two question containers (parent theme.css uses
2em), questiondistancebottom the margin-top of the bottom navigator with
the Previous/Next/Submit buttons. #}
{% set sQuestionDistance = aSurveyInfo.options.questiondistance|default('30px') %}
{% set sQuestionDistanceBottom = aSurveyInfo.options.questiondistancebottom|default('30px') %}
.question-container {
margin-bottom: {{ sQuestionDistance matches '/^\\d+(\\.\\d+)?(px|rem)$/' ? sQuestionDistance : '30px' }};
}
#navigator-container {
margin-top: {{ sQuestionDistanceBottom matches '/^\\d+(\\.\\d+)?(px|rem)$/' ? sQuestionDistanceBottom : '30px' }};
}
{% if (aSurveyInfo.options.questionborder == "box" ) %}
.question-container,
#welcome-container,