<% data = action_data @venue_management = data["venue_management"] @venue_management_signup = data["venue_management_signup"] @time_now = data["time_now"] @form_index = 0 %> <% begin %> <% if !@venue_management.registration_status.blank? and @venue_management.signup_start_date < @time_now and ( @venue_management.signup_end_date.nil? or @venue_management.signup_end_date+1 > @time_now ) %> <%#= stylesheet_link_tag "lib/main-forms" %> <%= stylesheet_link_tag "basic/bootstrap-datetimepicker" %> <%= javascript_include_tag "lib/bootstrap-datetimepicker" %> <%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %> <%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %> <% flash.each do |key, msg| %> <%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %> <% end %> <%= form_for @venue_management_signup, url: venue_managements_path, html: {class: "content form-horizontal" , :id=>"new-venue_management-signup"} do |f| %>
<%= @venue_management.title %>
<% if @venue_management.venue_management_signup_field_sets.count != 0 %> <% @venue_management.venue_management_signup_field_sets.each do |signup_field| %> <% if signup_field.field_name == 'name' %>
*(<%= t('venue_management.required') %>)
<% end %> <% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' %>
<% if signup_field.field_name == 'status' %>
<% if @venue_management.registration_status.include?('G') %> <% end %> <% if @venue_management.registration_status.include?('C') %> <% end %>
<% elsif signup_field.field_name == 'unit' %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
" id="unit_<%= locale %>"> <%= f.fields_for "unit_translations".to_sym do |f| %> <%= f.text_field locale, :class=>"input-medium form-control", :value => (@venue_management_signup.send("unit_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}", :required => true %> <% end %>
<% end %>
<% @site_in_use_locales.each_with_index do |locale, i| %> " href="#unit_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %> <% end %>
<% elsif signup_field.field_name == 'address' %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
" id="address_<%= locale %>"> <%= f.fields_for "address_translations".to_sym do |f| %> <%= f.text_field locale, :class=>"input-medium form-control", :value => (@venue_management_signup.send("address_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}" %> <% end %>
<% end %>
<% @site_in_use_locales.each_with_index do |locale, i| %> " href="#address_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %> <% end %>
<% elsif signup_field.field_name == 'email' %>
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> signup_field.placeholder[I18n.locale], :required => true %> check mail
<% elsif signup_field.field_name == 'note' %>
<% @site_in_use_locales.each_with_index do |locale, i| %>
" id="note_<%= locale %>"> <%= f.fields_for "note_translations".to_sym do |f| %> <%= f.text_area locale, rows: 5, :class=>"input-medium form-control", :value => (@venue_management_signup.send("note_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}" %> <% end %>
<% end %>
<% @site_in_use_locales.each_with_index do |locale, i| %> " href="#note_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %> <% end %>
<% else %>
<%= f.text_field signup_field['field_name'], :class=>"input-medium form-control", :id=>signup_field['field_name'], :placeholder=> signup_field.placeholder[I18n.locale], :required => (signup_field.field_name=='password' ? false : true) %>
<% end %>
<% end %> <% end %> <% else %>
<% if @venue_management.registration_status.include?('G') %> <% end %> <% if @venue_management.registration_status.include?('C') %> <% end %>
*(<%= t('venue_management.required') %>)
<%= f.text_field :name, :class=>"input-medium form-control", :id=>'name', :placeholder=> t('venue_management_signup.name'), :required => true %>
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('venue_management_signup.tel'), :required => true %>
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> t(:email), :required => true %> check mail
<%= f.text_field :password, :class=>"input-medium form-control", :placeholder=> t('venue_management_signup.password') %> <%= t('venue_management_signup.password_message') %>
<% end %> <% @venue_management.venue_management_signup_fields.asc(:_id).each do |rf| %>
<%= rf.block_helper(@venue_management,@form_index,false,"venue_management_signup",@venue_management_signup, rf.to_require) %>
<% @form_index = @form_index +1 %> <% end %> <% if @venue_management.venue_management_signup_field_sets.count != 0 %> <% if !(@venue_management.venue_management_signup_field_sets.select{|v| v.field_name=='recaptcha'}[0].disabled) %>
<%= gotcha_error %> <%= gotcha %>
<% end %> <% end %>
"> <%= f.submit t('submit'), class: 'btn btn-primary', :id => 'button-mail' %> <%= f.button t('cancel'), type: 'reset', class: 'btn' %>
<% end %> <% elsif @venue_management.registration_status.blank? %> <%= t('venue_management.sign_up_not_open') %> <% elsif @venue_management.signup_start_date > @time_now %> <%= t('venue_management.sign_up_not_yet') %> <% else %> <%= t('venue_management.sign_up_overdue') %> <% end %> <% rescue Exception => e %> <%= e.inspect %> <%= e.backtrace %> <%end %>