seminar/app/views/admin/seminar_signups/edit.html.erb

191 lines
7.5 KiB
Plaintext
Raw Permalink Normal View History

2016-06-29 06:57:45 +00:00
<%= form_for @seminar_signup, url: admin_seminar_signup_path(@seminar_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 class="control-label muted"><%= t('seminar.title') %></label>
<div class="controls">
<%= @seminar.title %>
</div>
</div>
<div class="control-group">
<label for="status" class="control-label muted"><%= t('seminar.registration_status') %></label>
<div class="controls">
<label class="radio inline">
<%= f.radio_button :status, 'G', :checked => true , :onclick => "$('#registration_status').addClass('hide');" %> <%= t('seminar.registration_status_G') %>
</label>
<label class="radio inline">
<%= f.radio_button :status, 'C', :onclick => "$('#registration_status').removeClass('hide');" %> <%= t('seminar.registration_status_C') %>
</label>
</div>
</div>
<!-- Name -->
<div class="control-group">
<label class="control-label muted"><%= t('seminar_signup.name') %></label>
<div class="controls">
<%= f.text_field :name, :class => "input-block-level", placeholder: t('seminar_signup.name') %>
</div>
</div>
<!-- unit -->
<div class="control-group">
<label class="control-label muted"><%= t('seminar_signup.unit') %></label>
<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 => (@seminar_signup.send("unit_translations")[locale] rescue nil), :placeholder=> "#{t(locale.to_s)}", :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>
</div>
<!-- Tel -->
<div class="control-group">
<label class="control-label muted"><%= t('seminar_signup.tel') %></label>
<div class="controls">
<%= f.text_field :tel, :class=>"input-block-level", :placeholder=> t('seminar_signup.tel'), :required => true %>
</div>
</div>
<!-- Phone -->
<div class="control-group">
<label class="control-label muted"><%= t('seminar_signup.phone') %></label>
<div class="controls">
<%= f.text_field :phone, :class=>"input-block-level", :placeholder=> t('seminar_signup.phone') %>
</div>
</div>
<!-- Fax -->
<div class="control-group">
<label class="control-label muted"><%= t('seminar_signup.fax') %></label>
<div class="controls">
<%= f.text_field :phone, :class=>"input-block-level", :placeholder=> t('seminar_signup.fax') %>
</div>
</div>
<!-- address -->
<div class="control-group">
<label class="control-label muted"><%= t("seminar_signup.address") %></label>
<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 => (@seminar_signup.send("address_translations")[locale] rescue nil), :placeholder=> "#{t(locale.to_s)}" %>
<% 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>
</div>
<!-- Email -->
<div class="control-group">
<label class="control-label muted"><%= t(:email) %></label>
<div class="controls">
<%= f.email_field :email, :class=>"input-block-level", :placeholder=> t(:email), :required => true %>
</div>
</div>
<!-- password -->
<div class="control-group <%= @seminar_signup.status == 'C' ? '' : 'hide' %>" id="registration_status">
<label class="control-label muted"><%= t('seminar_signup.password') %></label>
<div class="controls">
<%= f.text_field :password, :class=>"input-block-level", :placeholder=> t('seminar_signup.password') %>
</div>
</div>
<!-- Note -->
<div class="control-group">
<label class="control-label muted"><%= t('seminar_signup.note') %></label>
<div class="controls">
<div class="tab-content textarea-lang">
<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 %>" for="<%= locale %>" data-toggle="tab"><%= t(locale.to_s) %></a>
<% end %>
</div>
<% @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 => (@seminar_signup.send("note_translations")[locale] rescue nil), :placeholder=> "#{t(locale.to_s)}" %>
<% end %>
</div>
<% end %>
</div>
</div>
</div>
<hr>
<% @seminar.seminar_signup_fields.asc(:_id).each do |rf| %>
<div class="control-group">
<%= rf.block_helper(@seminar,@form_index,false,"seminar_signup", @seminar_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/seminars/#{@seminar.id}/seminar_signup", :class=>"btn" %>
</div>
</fieldset>
<% end %>