<% data = action_data @seminar = data["seminar"] @seminar_signup = data["seminar_signup"] @time_now = data["time_now"] @form_index = 0 if data["prefix_url"] prefix_url = data["prefix_url"] else prefix_url = OrbitHelper.url_to_show(@seminar.to_param) end registration_is_open = @seminar.registration_status.present? sign_up_not_yet = @seminar.signup_start_date && @time_now && @seminar.signup_start_date > @time_now sign_up_overdue = @seminar.signup_end_date && @time_now && (@seminar.signup_end_date + 1.day <= @time_now) signup_is_full = @seminar.signup_is_full? %> <% if !registration_is_open %> <%= t('seminar.sign_up_not_open') %> <% elsif sign_up_not_yet %> <%= t('seminar.sign_up_not_yet') %> <% elsif sign_up_overdue %> <%= t('seminar.sign_up_overdue') %> <% elsif signup_is_full %> <%= t('seminar.sign_up_is_full') %> <% else %> <%#= 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" %> <% notice = flash["notice"] || params[:notice] %> <% flash.each do |key, msg| %> <% next if key.to_s == "notice" %> <%= content_tag :p, msg, :class => [key, "alert alert-error in fade"], :style => "color: red; font-weight: bold;" %> <% end %> <% if notice.present? %> <%= content_tag :p, params[:notice], :class => ["notice alert alert-error in fade"], :style => "color: red; font-weight: bold;" %> <% end %> <%= form_for @seminar_signup, url: seminars_path, html: {class: "content form-horizontal" , :id=>"new-seminar-signup", multipart: true} do |f| %>

<%= @seminar.title %>

<% if !@seminar.signup_note.blank? %>
<%= @seminar.signup_note.html_safe %>
<% end %>
*(<%= t('seminar.required') %>)
<% if @seminar.seminar_signup_field_sets.count != 0 %> <% @seminar.seminar_signup_field_sets.each do |signup_field| %> <% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' %>
" id="<%= signup_field.field_name == 'password' ? 'registration_status' : '' %>"> <% if signup_field.field_name == 'status' %> <% status_translations = ['G','C'].map{|c| [c, t("seminar.registration_status_#{c}")] }.to_h %> <% status_translations = {'G'=>'No','C'=>'Yes'} if (signup_field.name.values.select{|v| v.include?('?') || v.include?('是否')}.count != 0 rescue false) %>
<% if @seminar.registration_status.include?('G') %> <% end %> <% if @seminar.registration_status.include?('C') %> <% end %>
<% elsif signup_field.field_name == 'unit' %>
<%= f.text_field 'unit', :class=>"input-medium form-control", :value => (@seminar_signup.send("unit_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}", :required => true %>
<% 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 => (@seminar_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, :title => t("seminar_signup.email_check") %>
<% elsif signup_field.field_name == 'password' %>
<%= f.password_field :password, :class=>"input-medium form-control availibility", :id=>signup_field['field_name'], :placeholder=> signup_field.placeholder[I18n.locale], :pattern => signup_field.validator, :title => t("seminar_signup.password_check") %>
<% 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 => (@seminar_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 => true %>
<% end %>
<% end %> <% end %> <% else %>
<% if @seminar.registration_status.include?('G') %> <% end %> <% if @seminar.registration_status.include?('C') %> <% end %>
<%= f.text_field :name, :class=>"input-medium form-control", :id=>'name', :placeholder=> t('seminar_signup.name'), :required => true %>
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('seminar_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('seminar_signup.password') %> <%= t('seminar_signup.password_message') %>
<% end %> <% group = 1 counter = 0 %> <% @seminar.seminar_signup_fields.where(:disabled=>false).asc(:sort_number, :_id).each_with_index do |rf, idx| %> <% if(idx == 5) %>
<% end %> <% if(idx % 5 == 0) && idx != 0 %> <% group += 1 %> <% end %> <% if(idx == 25) %>
<% end %> <% @form_index = @form_index +1 %> <% end %>
<% if @seminar.seminar_signup_field_sets.count != 0 %> <% if !(@seminar.seminar_signup_field_sets.select{|v| v.field_name=='recaptcha'}[0].disabled) %>
<%= gotcha_error %> <%= gotcha %>
<% end %> <% end %>
"> <%= f.submit "Submit", class: 'btn btn-primary', :id => 'button-mail' %> <%= f.button "Delete", type: 'reset', class: 'btn' %>
<% end %> <% end %>