/
_basic.html.erb
71 lines (64 loc) · 3.17 KB
/
_basic.html.erb
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
<div id="basic-registration-form">
<p>
<%= form_errors @registration %>
<%= render partial: 'flash' %>
<%= form_for [@event, @registration], url: basic_event_registrations_path(@event) do |f| %>
<% if @registration.event.extra_info %>
<%= form_radio_field f, :title, @registration.title, Registration.personal_titles, false, true, Registration.personal_titles_scope %>
<% end %>
<%= form_text_field f, :firstname %>
<%= form_text_field f, :lastname %>
<% if @registration.event.extra_info %>
<%= form_text_field f, :job_function %>
<% end %>
<%= form_email_field f, :email %>
<%= f.hidden_field :student_number %>
<% if @registration.event.ask_phone_number? %>
<%= form_telephone_field f, :phone_number, @event.show_telephone_disclaimer %>
<% end %>
<%= form_collection_select f, :access_levels, @event.access_levels.find_all { |al| can? :register, al }, :id, :name_with_price %>
<% if @registration.event.allow_plus_one %>
<%= form_check_box f, :has_plus_one, options={:onclick=>"$('.plus_one').toggle()"} %>
<div class="plus_one" style="<%= 'display:none' unless @registration.has_plus_one %>">
<% if @registration.event.extra_info %>
<%= form_radio_field f, :plus_one_title, @registration.plus_one_title, Registration.personal_titles, true, true, Registration.personal_titles_scope %>
<% end %>
<%= form_text_field f, :plus_one_firstname %>
<%= form_text_field f, :plus_one_lastname %>
</div>
<% end %>
<%= form_text_area f, :comment, @event.comment_title %>
<%= javascript_tag do %>
window.ticketsWithComments = <%= @event.access_levels.find_all(&:has_comment).map(&:id).to_json %>
<% end %>
<% if @registration.event.can_add_club%>
<p><%= t('event.registration.club.info')%></p>
<%= form_collection_select f, :club_id, Club.ordered_clubs, :id, :name %>
<%= stylesheet_link_tag '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css' %>
<%= stylesheet_link_tag 'https://cdnjs.cloudflare.com/ajax/libs/select2-bootstrap-css/1.4.6/select2-bootstrap.min.css' %>
<%= javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js' %>
<%= javascript_tag do %>
$('#registration_club_id').select2({
'sorter': function(results) {
return results.sort();
}
});
if (window.location.hash) {
setTimeout(function() {
var hash = window.location.hash;
hash = hash.substring(1, hash.length);
$('#registration_club_id').val(hash).trigger('change');
}, 1);
}
<% end %>
<%end%>
<% if true %>
<%= form_radio_field f, :payment_method, @registration.payment_method || 'wiretransfer', @registration.event.payment_methods, true, true, Event.payment_methods_scope %>
<br/>
<% end %>
<%= f.submit t('event.register', default: 'Register'), class: 'btn btn-primary' %>
<% end %>
<div class="well well-sm">
<%= raw t('event.payments') %>
</div>
</div>