Skip to content

Commit 20c212e

Browse files
committed
feat(question): allow gaps in rows
a row may habe empty spavec before its first question
1 parent 1f73c65 commit 20c212e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

templates/pages/userform.html.twig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,17 @@
8181
{% if not (lastQuestion is null) %}
8282
{% if lastQuestion.fields['row'] < question.fields['row'] %}
8383
<div class="plugin_formcreator_newRow"></div>
84+
{% if question.fields['col'] > 0 %}
85+
{# There is a gap before the question #}
86+
{% set x = 0 %}
87+
{% set width = question.fields['col'] %}
88+
<div class="plugin_formcreator_gap" gs-x="{{ x }}" gs-w="{{ width }}"></div>
89+
{% endif %}
8490
{% else %}
8591
{% set x = lastQuestion.fields['col'] + lastQuestion.fields['width'] %}
8692
{% set width = question.fields['col'] - x %}
8793
{% if x < question.fields['col'] %}
94+
{# There is a gap before the question #}
8895
<div class="plugin_formcreator_gap" gs-x="{{ x }}" gs-w="{{ width }}"></div>
8996
{% endif %}
9097
{% endif %}

0 commit comments

Comments
 (0)