/
Donation_Form.html.twig
299 lines (273 loc) · 14.4 KB
/
Donation_Form.html.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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
{% extends 'Base_Layout.html.twig' %}
{% set COUNTRIES = [ 'DE', 'AT', 'CH', 'BE', 'IT', 'LI', 'LU' ] %}
{% set PAYMENT_INTERVALS = [ 0, 1, 3, 6, 12 ] %}
{% block page_identifier %}donation{% endblock %}
{% block main %}
<div class="introduction container default">
<div class="row">
<div class="col-xs-12">
<h2 class="sr-only">{$ 'donation_title' | trans $}</h2>
<p class="h1">
{$ 'wikimedia_tagline' | trans $}
</p>
<a href="#donation-amount" class="btn btn-donation btn-introduction bk-blue text-center text-uppercase">
{$ 'donation_banner_anchor' | trans $}
</a>
</div>
</div>
</div>
<form id="form-donation" class="main-form" action="{$ basepath $}/donation/add" method="post" novalidate>
<div class="container">
<section class="state-bar state-overview col-xs-12 ">
<div class="wrap-bar container ">
<ul class="">
{% include 'partials/donation/state_bar_sections.html.twig' only %}
</ul>
</div>
</section>
<div class="row">
<div class="form-shadow-wrap col-xs-12 col-sm-8">
<section class="introduction-banner banner hidden">
{$ 'donation_banner_deeplink_summary' | trans( {
'%frequency%': '<span class="frequency"><span class="text"></span></span>',
'%amount%': '<span class="amount"><span class="text"></span></span>',
'%payment_method%': '<span class="payment-method"><span class="text"></span></span>'
} ) | raw $}
<a href="#donation-amount">{$ 'donation_banner_correction_anchor' | trans $}</a>
</section>
<section id="donation-amount" class="donation-amount clearfix">
<h2>{$ 'donation_section_amount_title' | trans $}</h2>
<p class="legend">
{$ 'donation_section_amount_legend' | trans $}
</p>
<fieldset
class="amount-qty padding-right-4 col-xs-12 col-sm-8 col-sm-offset-right-4 col-md-6 col-md-offset-right-7 no-gutter-left">
<legend class="sr-only">{$ 'donation_section_amount_legend' | trans $}</legend>
<div class="wrap-amounts">
{% include 'partials/payment_preset_amounts.html.twig' with { 'presetAmounts': presetAmounts } %}
<div class="{% if initialFormValues.isCustomAmount %} filled {% endif %} wrap-amount-typed field-grp" data-currency="€">
<input type="text" id="amount-typed">
</div>
<span class="error-text">{$ 'form_amount_error' | trans $}</span>
<input type="hidden" name="betrag" id="amount-hidden">
<label for="amount-typed" class="sr-only">{$ 'payment_amount_legend' | trans $}</label>
</div>
</fieldset>
<fieldset id="recurrence"
class="show-info padding-right-4 col-xs-12 col-sm-8 col-sm-offset-right-4 col-md-6 col-md-offset-right-7 no-gutter-left wrap-recurrence">
<legend class="sr-only">{$ 'payment_interval_legend' | trans $}</legend>
{% include 'partials/payment_intervals.html.twig' with { 'context': 'donation', 'intervals': PAYMENT_INTERVALS, 'fieldName': 'periode' } only %}
</fieldset>
</section>
<section id="donation-payment" class="donation-payment-method clearfix">
<h2>{$ 'donation_section_payment_title' | trans $}</h2>
<p class="legend">
{$ 'donation_section_payment_legend' | trans $}
</p>
<fieldset id="payment-method"
class="show-info padding-right-4 col-xs-12 col-sm-8 col-sm-offset-right-4 col-md-6 col-md-offset-right-7 no-gutter-left wrap-payment">
<legend class="sr-only">{$ 'donation_section_payment_legend' | trans $}</legend>
{% include 'partials/payment_types.html.twig' with { 'paymentTypes': paymentTypes, 'fieldName': 'zahlweise' } only %}
</fieldset>
</section>
<section id="donation-type" class="donation-data clearfix">
<h2>{$ 'donation_section_donor_title' | trans $}</h2>
<p class="legend">
{$ 'donation_section_donor_legend' | trans $}
</p>
<fieldset id="type-donor"
class="show-info padding-right-4 col-xs-12 col-sm-8 col-sm-offset-right-4 col-md-6 col-md-offset-right-7 no-gutter-left">
<legend class="sr-only">{$ 'donation_section_donor_legend' | trans $}</legend>
<div class="wrap-field personal">
<div class="wrap-input">
<input type="radio" name="addressType" id="personal" value="person">
<label for="personal">
<span>{$ 'donation_addresstype_option_private' | trans $}</span>
<i class="icon-account_circle"></i>
</label>
</div>
<div class="wrap-info">
<div class="info-text" data-info="personal">
<div class="field-grp field-salutation">
<div class="wrap-select-50 clearfix ">
<select class="no-outline salutation" id="salutation" name="salutation"
data-jcf='{"wrapNative": false, "wrapNativeOnMobile": true }'>
<option hidden class="hideme" value="">{$ 'salutation_label' | trans $}</option>
<option value="Herr">{$ 'salutation_option_mr' | trans $}</option>
<option value="Frau">{$ 'salutation_option_mrs' | trans $}</option>
</select>
<select class="no-outline personal-title" id="title" name="title"
data-jcf='{"wrapNative": false, "wrapNativeOnMobile": true}'>
<option value="">{$ 'title_option_none' | trans $}</option>
<option value="Dr.">Dr.</option>
<option value="Prof.">Prof.</option>
<option value="Prof. Dr.">Prof. Dr.</option>
</select>
</div>
<span class="error-text">{$ 'form_salutation_error' | trans $}</span>
</div>
<div class="field-grp field-firstname">
<input type="text" id="first-name" name="firstName" placeholder="{$ 'firstname_label' | trans $}" data-pattern="^.+$">
<label for="first-name" class="sr-only">{$ 'firstname_label' | trans $}</label>
<span class="error-text">{$ 'form_firstname_error' | trans $}</span>
</div>
<div class="field-grp field-lastname">
<input type="text" id="last-name" name="lastName" placeholder="{$ 'lastname_label' | trans $}" data-pattern="^.+$">
<label for="last-name" class="sr-only">{$ 'lastname_label' | trans $}</label>
<span class="error-text">{$ 'form_lastname_error' | trans $}</span>
</div>
<div class="field-grp field-street">
<input type="text" id="street" placeholder="{$ 'street_label' | trans $}" data-pattern="^.+$">
<label for="street" class="sr-only">{$ 'street_label' | trans $}</label>
<span class="error-text">{$ 'form_street_error' | trans $}</span>
<span class="warning-text">{$ "form_street_number_warning" | trans $}</span>
</div>
<div class="field-grp field-postcode">
<input type="text" id="post-code" placeholder="{$ 'zip_label' | trans $}" data-pattern="^[0-9]{4,5}$">
<label for="post-code" class="sr-only">{$ 'zip_label' | trans $}</label>
<span class="error-text">{$ 'form_zip_error' | trans $}</span>
</div>
<div class="field-grp field-city">
<input type="text" id="city" placeholder="{$ 'city_label' | trans $}" data-pattern="^.+$">
<label for="city" class="sr-only">{$ 'city_label' | trans $}</label>
<span class="error-text">{$ 'form_city_error' | trans $}</span>
</div>
<select id="country" title="{$ 'country_label' | trans | e( 'html_attr' ) $}"
data-jcf='{"wrapNative": false, "wrapNativeOnMobile": true, "flipDropToFit": true, "maxVisibleItems": 6}'
class="no-outline country-select">
{% for countryCode in COUNTRIES %}
<option value="{$ countryCode $}">{$ ( 'country_option_' ~ countryCode ) | trans $}</option>
{% endfor %}
</select>
<div class="field-grp field-email">
<input type="email" id="email" placeholder="{$ 'email_label' | trans $}" data-pattern="^[^@]+@.+$">
<label for="email" class="sr-only">{$ 'email_label' | trans $}</label>
<span class="error-text">{$ 'form_email_error' | trans $}</span>
</div>
<div class="field-grp wrap-check">
<input type="checkbox" id="newsletter" data-jcf='{"wrapNative": true}' class="jcf">
<label class="news" for="newsletter">
{$ 'donation_sendinfo_label' | trans | raw $}
</label>
</div>
</div>
<div class="wrap-check">
<div>
<input type="checkbox" id="donation-receipt" data-jcf='{"wrapNative": true}' class="jcf">
<label for="donation-receipt">
{$ 'donation-no-donation-receipt' | trans $}
</label>
</div>
</div>
</div>
</div>
<div class="wrap-field firma">
<div class="wrap-input">
<input type="radio" name="addressType" id="company" value="firma">
<label for="company">
<span>{$ 'donation_addresstype_option_company' | trans $}</span>
<i class="icon-work"></i>
</label>
</div>
<div class="wrap-info">
<div class="info-text" data-info="company">
<div class="field-grp field-company">
<input type="text" id="company-name" name="companyName" placeholder="{$ 'companyname_label' | trans $}" data-pattern="^.+$">
<label for="company-name" class="sr-only">{$ 'companyname_label' | trans $}</label>
<span class="error-text">{$ 'form_companyname_error' | trans $}</span>
</div>
<div class="field-grp field-street">
<input type="text" id="adress-company" name="street" placeholder="{$ 'street_label' | trans $}" data-pattern="^.+$">
<label for="adress-company" class="sr-only">{$ 'street_label' | trans $}</label>
<span class="error-text">{$ 'form_street_error' | trans $}</span>
<span class="warning-text">{$ "form_street_number_warning" | trans $}</span>
</div>
<div class="field-grp field-postcode">
<input type="text" id="post-code-company" name="postcode" placeholder="{$ 'zip_label' | trans $}" data-pattern="^[0-9]{4,5}$">
<label for="post-code" class="sr-only">{$ 'zip_label' | trans $}</label>
<span class="error-text">{$ 'form_zip_error' | trans $}</span>
</div>
<div class="field-grp field-city">
<input type="text" id="city-company" name="city" placeholder="{$ 'city_label' | trans $}" data-pattern="^.+$">
<label for="city-company" class="sr-only">{$ 'city_label' | trans $}</label>
<span class="error-text">{$ 'form_city_error' | trans $}</span>
</div>
<select id="country-company" name="country" title="{$ 'country_label' | trans | e( 'html_attr' ) $}"
data-jcf='{"wrapNative": false, "wrapNativeOnMobile": true, "maxVisibleItems": 6}'
class="no-outline country-select">
{% for countryCode in COUNTRIES %}
<option value="{$ countryCode $}">{$ ( 'country_option_' ~ countryCode ) | trans $}</option>
{% endfor %}
</select>
<div class="field-grp field-email">
<input type="email" id="email-company" name="email" placeholder="{$ 'email_label' | trans $}" data-pattern="^[^@]+@.+$">
<label for="email-company" class="sr-only">{$ 'email_label' | trans $}</label>
<span class="error-text">{$ 'form_email_error' | trans $}</span>
</div>
<div class="field-grp wrap-check">
<input type="checkbox" id="newsletter-company" name="info" value="1">
<label class="news" for="newsletter-company">
{$ 'donation_sendinfo_label' | trans | raw $}
</label>
</div>
</div>
<div class="wrap-check">
<div>
<input type="checkbox" id="donation-receipt-company" name="donationReceipt" value="0" data-jcf='{"wrapNative": true}' class="jcf">
<label for="donation-receipt-company">
{$ 'donation-no-donation-receipt' | trans $}
</label>
</div>
</div>
</div>
</div>
<div class="wrap-field anonym">
<div class="wrap-input">
<input type="radio" name="addressType" id="anonymus" value="anonym">
<label for="anonymus">
<span>{$ 'donation_addresstype_option_anonymous' | trans $}</span>
<i class="icon-visibility_off"></i>
</label>
</div>
<p class="info-text" data-info="anonymus">
{$ 'donation_addresstype_option_anonymous_disclaimer' | trans $}
</p>
</div>
</fieldset>
</section>
</div>
{% include 'partials/donation/state_bar.html.twig' %}
</div>
</div>
<hr id="form-end">
{% include 'partials/donation/overview.html.twig' %}
<div class="fixed-button hidden-lg">
<div class="switch-container container-fluid container">
<div class="row">
<div class=" col-sm-5 col-sm-offset-7 col-md-4 col-md-offset-8 clearfix">
<input type="submit" value="Spende abschließen" class="btn btn-donation">
</div>
</div>
</div>
</div>
<div id="submit-bottom">
<input type="submit" value="Spende abschließen" class="btn btn-donation visible-xs-block">
</div>
<input type="hidden" name="impCount" value="{$ tracking.impressionCount $}">
<input type="hidden" name="bImpCount" value="{$ tracking.bannerImpressionCount $}">
</form>
{% endblock %}
{% block scripts %}
<script src="{$ basepath|e('html_attr') $}{$ '/skins/cat17/scripts/wmde.js'|prefix_file $}"></script>
<script id="init-form" src="{$ basepath|e('html_attr') $}{$ '/skins/cat17/scripts/donationForm.js'|prefix_file $}"
data-initial-form-values="{% if initialFormValues %}{$ initialFormValues|json_encode|e('html_attr') $}{% else %}{}{% endif %}"
data-violated-fields="{% if violatedFields %}{$ violatedFields|json_encode|e('html_attr') $}{% else %}{}{% endif %}"
data-initial-validation-result="{% if validationResult %}{$ validationResult|json_encode|e('html_attr') $}{% else %}{}{% endif %}"
data-validate-amount-url="{$ basepath | e( 'html_attr' ) $}/validate-donation-amount"
data-validate-address-url="{$ basepath|e('html_attr') $}/validate-address"
data-validate-email-address-url="{$ basepath|e('html_attr') $}/validate-email"
data-validate-iban-url="{$ basepath|e('html_attr') $}/check-iban"
data-generate-iban-url="{$ basepath|e('html_attr') $}/generate-iban"
data-messages="{$ messages $}"
></script>
{% endblock %}