-
Notifications
You must be signed in to change notification settings - Fork 988
/
user_forms_layout.twig
233 lines (182 loc) · 12 KB
/
user_forms_layout.twig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
{#
TODO: alignement, some unclosed div (for token + captcha)
#}
<!DOCTYPE html>
<html lang="{{ aSurveyInfo.languagecode }}" dir="{{ aSurveyInfo.dir }}" class="no-js {{ aSurveyInfo.languagecode }} dir-{{ aSurveyInfo.dir }} ">
{# Headers, metadatas, etc #}
{{ include('./subviews/head.twig') }}
<body class="default lang-{{surveylanguage}} {{surveyformat}}">
{# Bootstrap Navigation Bar: the top menu #}
{{ include('./subviews/nav_bar.twig') }}
<!-- Outer Frame Container -->
<div class="outerframe container" id="outerframeContainer">
<!-- Main Row -->
<div id="main-row">
<!-- Main Col -->
<div class="col-centered" id="main-col">
<div class='{{aSurveyInfo.aForm.sType}}-page'>
<div class="h3">
{# OLD FORMHEADING #}
{% if aSurveyInfo.aForm.sType == 'token' %}
{{ "To participate in this restricted survey, you need a valid token." | t }}
{% endif %}
{% if aSurveyInfo.aForm.sType == 'captcha' %}
{{ "Before you start, please prove you are human." }}
{% endif %}
</div>
<div class="well">
{# TOKEN #}
{% if aSurveyInfo.aForm.sType == 'token' %}
{# OLD FORMMESSAGE #}
<p class='text-info'>
{# TODO: convert !isset to null #}
{% if aSurveyInfo.aForm.token == null %}
{{ "If you have been issued a token, please enter it in the box below and click continue." | t }}
{% else %}
{{ "Please confirm the token by answering the security question below and click continue." | t }}
{% endif %}
</p>
{% endif %}
{# OLD FORMERROR #}
{% if not empty(aSurveyInfo.aForm.aEnterErrors) %}
{# TODO: check how is defined $class #}
<ul class='alert alert-danger list-unstyled' role='alert'>
{% for key, error in aSurveyInfo.aForm.aEnterErrors %}
<li>{{ error }}</li>
{% endfor %}
</ul>
{% endif %}
<div class="form-{{ aSurveyInfo.aForm.sType }}">
{# old FORM#}
{#
array of attributes of the form tag.
To add a new attribute, just add an entry:
'attribute' : 'value',
#}
{%
set htmlOptions = {
'id' : 'form-' ~ aSurveyInfo.aForm.sType ,
'name' : 'limesurvey',
'class' : 'ls-form',
}
%}
<!-- Start of the main Form-->
{{
C.Html.form(
( aSurveyInfo.surveyUrl ),
'post',
(htmlOptions)
)
}}
{# TOKEN FORM #}
{% if aSurveyInfo.aForm.sType == 'token' %}
<div class='form-horizontal'>
<div class='form-group'>
<label class='control-label col-sm-3' for='loadname'>
{{ "Token:" | t }}
<small class="text-danger asterisk fa fa-asterisk pull-left small" aria-hidden='true'></small>
<span class="sr-only text-danger asterisk">
( {{ "Mandatory" | t }} )
<span>
</label>
<div class='col-sm-7 load-survey-input input-cell'>
{% if aSurveyInfo.aForm.token == null %}
<input class='form-control' type='password' id='token' name='token' value='' required>
{% else %}
{% set passwordFieldHtmlOptions = {
'id' : 'token',
'required' : true,
'readonly' : true,
}
%}
{{
C.Html.passwordField(
'token',
(( aSurveyInfo.aForm.token )),
(passwordFieldHtmlOptions)
)
}}
{% endif %}
</div>
</div>
</div>
{# CAPTACHA INSIDE TOKEN FORM #}
{% if ( aSurveyInfo.aForm.bCaptchaEnabled == true ) %}
<div class='form-group captcha-item'>
<!-- Don't seems aria capable -->
<label class='control-label col-sm-3' for='loadsecurity'>
{{ "Please enter the letters you see:" }}
<small class="text-danger asterisk fa fa-asterisk pull-left small" aria-hidden='true'></small>
<span class="sr-only text-danger asterisk">
( {{ "Mandatory" | t }} )
<span>
</label>
<div class='col-sm-7'>
<div class='ls-input-group'>
<div class='ls-input-group-extra captcha-widget' >
{{ renderCaptcha() }}
{#
<?php ?>
#}
</div>
<input class='form-control' type='text' size='15' maxlength='15' id='loadsecurity' name='loadsecurity' value='' alt='' required>
</div>
</div>
</div>
{% endif %}
{{ aSurveyInfo.aForm.hiddenFields }}
<div class='form-group load-survey-row load-survey-submit'>
<div class='col-sm-7 col-md-offset-3 load-survey-input input-cell'>
<button type='submit' id='default' name="continue" class='btn btn-default' value='continue'>
{{ "Continue" | t }}
</button>
</div>
</div>
{% endif %}
{% if aSurveyInfo.aForm.sType == 'captcha' %}
<div class='form-horizontal'>
<div class='form-group'>
<div class='form-group captcha-item'>
<label class='control-label col-sm-3' for='loadsecurity'>
{{ "Please enter the letters you see:" | t }}
</label>
<div class='col-sm-7'>
<div class='ls-input-group'>
<div class='ls-input-group-extra captcha-widget' >
{{ renderCaptcha() }}
</div>
<input class='form-control' type='text' size='15' maxlength='15' id='loadsecurity' name='loadsecurity' value='' alt='' required>
</div>
</div>
</div>
{{ aSurveyInfo.aForm.hiddenFields }}
<div class='form-group load-survey-row load-survey-submit'>
<div class='col-sm-7 col-md-offset-3 load-survey-input input-cell'>
<button type='submit' id='default' name="continue" class='btn btn-default' value='continue'>
{{ "Continue" | t }}
</button>
</div>
</div>
</div>
</div>
{% endif %}
</form>
</div>
</div>
</div>
</div> <!-- main col -->
</div> <!-- main row -->
</div> <!-- outer frame container -->
{# Bootstrap alert modal #}
{{ include('./subviews/bootstrap_alert_modal.twig') }}
<!-- some template.js function launched before ready -->
<script type="text/javascript">
/*<![CDATA[*/
sliderSuffixClone();
fixBodyPadding();
hideEmptyPart();
/*]]>*/
</script>
</body>
</html>
<!-- end of startpage.twig -->