venue_management/app/views/admin/venue_management_signups/edit.html.erb

204 lines
11 KiB
Plaintext
Raw Normal View History

2020-05-07 15:26:34 +00:00
<%= form_for @venue_management_signup, url: admin_venue_management_signup_path(@venue_management_signup), html: {class: "form-horizontal main-forms"} do |f| %>
<fieldset>
<% content_for :page_specific_css do %>
<%= stylesheet_link_tag "lib/main-forms" %>
<%= stylesheet_link_tag "lib/fileupload" %>
<%= stylesheet_link_tag "lib/main-list" %>
<% end %>
<% content_for :page_specific_javascript do %>
<%= javascript_include_tag "lib/bootstrap-fileupload" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %>
<%= javascript_include_tag "lib/file-type" %>
<%= javascript_include_tag "lib/module-area" %>
<% end %>
<!-- Input Area -->
<div class="input-area">
<!-- Language -->
<div class="tab-content">
<!-- Title -->
<div class="control-group">
<label for="title" class="control-label muted"><%= t('venue_management.title') %></label>
<div class="controls">
<%= @venue_management.title %>
</div>
</div>
<% if @venue_management.venue_management_signup_field_sets.count != 0 %>
<% @venue_management.venue_management_signup_field_sets.each do |signup_field| %>
<% if !(signup_field.disabled) && signup_field.field_name != 'recaptcha' %>
<div class="control-group<%= (@venue_management.registration_status[0] == 'G' && signup_field.field_name == 'password') ? ' hide' : '' %>" id="<%= signup_field.field_name == 'password' ? 'registration_status' : '' %>">
<label for="<%= signup_field['name'][I18n.locale] %>" class="control-label muted">
<%= signup_field['name'][I18n.locale] %>
</label>
<% if signup_field.field_name == 'status' %>
<div class="controls">
<% if @venue_management.registration_status.include?('G') %>
<label class="radio-inline">
<%= f.radio_button :status, 'G', :checked => (@venue_management_signup.status=='G'), :onclick => "$('#registration_status').addClass('hide');" %> <%= t('venue_management.registration_status_G') %>
</label>
<% end %>
<% if @venue_management.registration_status.include?('C') %>
<label class="radio-inline">
<%= f.radio_button :status, 'C', :onclick => "$('#registration_status').removeClass('hide');", :checked => (@venue_management_signup.status=='C') %> <%= t('venue_management.registration_status_C') %>
</label>
<% end %>
</div>
<% elsif signup_field.field_name == 'unit' %>
<div class="controls">
<div class="input-append">
<div class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="unit_<%= locale %>">
<%= f.fields_for "unit_translations".to_sym do |f| %>
<%= f.text_field locale, :class=>"input-block-level", :value => (@venue_management_signup.send("unit_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}", :required => true %>
<% end %>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#unit_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
<% end %>
</div>
</div>
</div>
<% elsif signup_field.field_name == 'address' %>
<div class="controls">
<div class="input-append">
<div class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="address_<%= locale %>">
<%= f.fields_for "address_translations".to_sym do |f| %>
<%= f.text_field locale, :class=>"input-block-level", :value => (@venue_management_signup.send("address_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}" %>
<% end %>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#address_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
<% end %>
</div>
</div>
</div>
<% elsif signup_field.field_name == 'email' %>
<div class="controls">
<%= f.email_field :email, :class=>"input-block-level", :placeholder=> signup_field.placeholder[I18n.locale], :required => true %>
</div>
<% elsif signup_field.field_name == 'note' %>
<div class="controls">
<div class="input-append">
<div class="tab-content">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<div class="tab-pane fade <%= ( i == 0 ) ? "active in" : '' %>" id="note_<%= locale %>">
<%= f.fields_for "note_translations".to_sym do |f| %>
<%= f.text_area locale, rows: 5, :class=>"input-block-level", :value => (@venue_management_signup.send("note_translations")[locale] rescue nil), :placeholder=> "#{signup_field.placeholder[I18n.locale]}" %>
<% end %>
</div>
<% end %>
</div>
<div class="btn-group" data-toggle="buttons-radio">
<% @site_in_use_locales.each_with_index do |locale, i| %>
<a class="btn <%= ( i == 0 ) ? "active" : '' %>" href="#note_<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
<% end %>
</div>
</div>
</div>
<% else %>
<div class="controls">
<%= f.text_field signup_field['field_name'], :class=>"input-block-level", :id=>signup_field['field_name'], :placeholder=> signup_field.placeholder[I18n.locale], :required => (signup_field.field_name=='password' ? false : true) %>
</div>
<% end %>
</div>
<% end %>
<% end %>
<% else %>
<div class="control-group">
<label for="status" class="control-label muted"><%= t('venue_management.registration_status') %></label>
<div class="controls">
<% if @venue_management.registration_status.include?('G') %>
<label class="radio-inline">
<%= f.radio_button :status, 'G', :checked => true , :onclick => "$('#registration_status').addClass('hide');" %> <%= t('venue_management.registration_status_G') %>
</label>
<% end %>
<% if @venue_management.registration_status.include?('C') %>
<label class="radio-inline">
<%= f.radio_button :status, 'C', :onclick => "$('#registration_status').removeClass('hide');", :checked => (@venue_management.registration_status.count == 1 and @venue_management.registration_status.include?('C') ? true : false) %> <%= t('venue_management.registration_status_C') %>
</label>
<% end %>
</div>
</div>
<div>
<div class="col-sm-12"> *(required) </div>
</div>
<!-- Name to Last Name -->
<div class="control-group">
<label for="name" class="control-label muted">*<%= t('venue_management_signup.name') %></label>
<div class="controls">
<%= f.text_field :name, :class=>"input-block-level", :id=>'name', :placeholder=> t('venue_management_signup.name'), :required => true %>
</div>
</div>
<!-- Tel to First Name -->
<div class="control-group">
<label for="tel" class="control-label muted">*<%= t('venue_management_signup.tel') %></label>
<div class="controls">
<%= f.text_field :tel, :class=>"input-block-level", :placeholder=> t('venue_management_signup.tel'), :required => true %>
</div>
</div>
<!-- Email -->
<div class="control-group">
<label for="email" class="control-label muted">*<%= t(:email) %></label>
<div class="controls">
<%= f.email_field :email, :class=>"input-block-level", :placeholder=> t(:email), :required => true %> <a href="#" onclick="window.open(' <%= OrbitHelper.url_to_show(@venue_management.to_param) %>?method=check_email&no=<%=@venue_management.id%>&layout=false&email='+ $('input[type=email]').val() , 'check mail', config='height=100,width=300');" class="btn btn-primary">check mail</a>
</div>
</div>
<div class="control-group <%= @venue_management.registration_status[0] == 'C' ? '' : 'hide' %>" id="registration_status">
<label for="password" class="control-label muted">*<%= t('venue_management_signup.password') %></label>
<div class="controls">
<%= f.text_field :password, :class=>"input-block-level", :placeholder=> t('venue_management_signup.password') %>
<%= t('venue_management_signup.password_message') %>
</div>
</div>
<% end %>
<% @form_index = 0 %>
<% @venue_management.venue_management_signup_fields.asc(:_id).each do |rf| %>
<div class="control-group">
<%= rf.block_helper(@venue_management,@form_index,false,"venue_management_signup",@venue_management_signup, rf.to_require) %>
</div>
<% @form_index = @form_index +1 %>
<% end %>
</div>
</div>
<!-- Form Actions -->
<div class="form-actions">
<%#= get_referer_url[:action] rescue "" %>
<%= f.submit t('submit'), class: 'btn btn-primary' %>
<%= link_to t('cancel'), "/admin/venue_managements/#{@venue_management.id}/venue_management_signup", :class=>"btn" %>
</div>
</fieldset>
<% end %>