osem-fcy/app/views/conference_registrations/_form.html.haml
2015-06-11 15:20:48 +03:00

40 lines
2.1 KiB
Text

.container
.row
.col-md-12
.page-header
%h1
Registration for
= @conference.title
.row
.col-md-6
- if !current_user
%legend
%span
=link_to('#signup', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do
= CONFIG['name']
Account
%span.pull-right#account-already
=link_to('#signin', role: 'tab', "aria-controls" => "home", "data-toggle" => "tab") do
Already have an account?
.tab-content
.tab-pane.active{role: 'tabpanel', id: 'signup'}
= semantic_form_for(@registration, url: conference_conference_registrations_path(@conference.short_title)) do |f|
= render partial: 'devise/shared/sign_up_form_embedded'
- if @conference.questions.any?
= render partial: 'questions', locals: { f: f }
- if @conference.events.workshops.any?
=f.inputs 'Register to Workshops' do
= f.input :events, as: :check_boxes, label: false, collection: @conference.events.workshops
= f.inputs 'Your Travel Info' do
= f.input :arrival, as: :string, label: 'Your arrival time', input_html: { value: (f.object.arrival.to_formatted_s(:db_without_seconds) unless f.object.arrival.nil?), id: 'registration-arrival-datepicker', readonly: 'readonly' }
= f.input :departure, as: :string, label: 'Your departure time', input_html: { value: (f.object.departure.to_formatted_s(:db_without_seconds) unless f.object.departure.nil?), id: 'registration-departure-datepicker', readonly: 'readonly' }
.row
.col-md-12
%p.pull-right
- if @conference.user_registered?(current_user)
= f.action :submit, button_html: { value: 'Update Registration', class: 'btn btn-primary' }
- else
=f.action :submit, button_html: { value: 'Register', class: 'btn btn-primary', id: 'register' }
.tab-pane{role: 'tabpanel', id: 'signin'}
= render partial: 'devise/shared/sign_in_form_embedded'