Files
ch420/app/views/supporters/_form.slim
T

84 lines
2.7 KiB
Plaintext
Raw Normal View History

2016-04-16 17:01:39 +02:00
.row
.col-md-1.col-xs-4
2017-02-26 16:19:43 +01:00
= image_tag('ch420_logo.png', class:'img-responsive pagelogo', alt: t('.logo'))
2016-04-16 17:01:39 +02:00
.col-md-8.col-xs-8
h1
= title t('.title_html')
.col-xs-12.col-md-3
2017-02-26 16:39:42 +01:00
nav.pull-right
h2.sr-only =t('.lang')
a href='/' lang='de'
2016-04-21 16:51:35 +02:00
| Deutsch
2016-04-22 08:02:51 +02:00
|   |  
2017-02-26 16:39:42 +01:00
a href='/it' lang='it'
2016-04-22 09:38:02 +02:00
| Italiano
2016-04-22 08:02:51 +02:00
|   |  
2017-02-26 16:39:42 +01:00
a href='/fr' lang='fr'
2016-04-28 10:14:42 +02:00
| Français
br/
2016-04-16 17:01:39 +02:00
= render 'shared/counter'
.row
.col-xs-12.col-md-7
= simple_form_for @supporter do |f|
= f.input :first_name, placeholder: t('.placeholders.first_name')
= f.input :last_name, placeholder: t('.placeholders.last_name')
= f.input :street, placeholder: t('.placeholders.street')
= f.input :city, placeholder: t('.placeholders.city')
= f.input :zip, placeholder: t('.placeholders.zip')
= f.input :email, placeholder: t('.placeholders.email')
2015-11-09 09:52:31 +01:00
= f.input :support, as: :radio_buttons, collection: t('support_type').map{ |x| [x.first, raw(x.last)]}, label_method: :last, value_method: :first
2016-03-29 21:57:14 +02:00
= f.input :li_membership, as: :boolean
= f.input :age_category, as: :radio_buttons, collection: t('age_category'), label_method: :last, value_method: :first
2015-11-01 11:03:54 +01:00
= f.input :comments, as: :text
2015-10-18 22:54:07 +02:00
.form-group
= f.submit value: t('.submit'), class: 'btn btn-success'
.form-group
= link_to t('.terms_and_conditions'),'#', data: { toggle: :modal, target: '#terms_and_conditions'}, class: 'small'
javascript:
var cities = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.whitespace,
queryTokenizer: Bloodhound.tokenizers.whitespace,
remote: {
url: '/cities_autocomplete.json?query=%QUERY',
wildcard: '%QUERY',
}
});
var suggestion_template = function (data) {
return '<p>' + data.plz + ' - ' + data.city + '</p>';
2015-10-06 16:18:04 +02:00
}
$('#supporter_city').typeahead({
minLength: 2,
},{
limit: 20,
display: 'city',
templates: {
suggestion: function (data) {
return suggestion_template(data);
}
},
source: cities
}).on('typeahead:selected', function(event, datum) {
$("#supporter_zip").val(datum.plz);
});
$('#supporter_zip').typeahead({
minLength: 2,
},{
limit: 20,
display: 'plz',
templates: {
suggestion: function (data) {
return suggestion_template(data);
}
},
source: cities
}).on('typeahead:selected', function(event, datum) {
$("#supporter_city").val(datum.city);
});
2015-11-02 13:42:35 +01:00
.col-md-5.col-xs-12
2016-04-21 16:51:35 +02:00
= render 'right_side'
2016-04-22 08:02:51 +02:00
= render 'shared/terms_and_conditions'