active/app/views/actives/show.html.erb

277 lines
12 KiB
Plaintext
Raw Normal View History

2014-11-10 02:24:07 +00:00
<% # encoding: utf-8 %>
<%
data = action_data
@act = data["act"]
@act_signup = data["act_signup"]
@time_now = data["time_now"]
%>
<% if !@act.sign_up.blank? and @act.sign_start_date < @time_now and ( @act.sign_end_date > @time_now or @act.sign_end_date.nil? ) %>
<%= stylesheet_link_tag "basic/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/bootstrap-datetimepicker" %>
<%= javascript_include_tag "lib/datetimepicker/datetimepicker.js" %>
<%= javascript_include_tag "lib/module-area" %>
2017-08-08 09:04:59 +00:00
<%= javascript_include_tag "validator" %>
2014-11-10 02:24:07 +00:00
2017-08-08 09:04:59 +00:00
<style>
.text-error{
color: red;
}
</style>
2014-11-10 02:24:07 +00:00
<% flash.each do |key, msg| %>
<%= content_tag :p, msg, :class => [key, "alert alert-error in fade"] %>
<% end %>
<%= form_for @act_signup, url: actives_path, html: {class: "content form-horizontal" , :id=>"new-act-signup"} do |f| %>
<fieldset>
<!-- Title -->
<div class="form-group">
<label for="title" class="col-sm-2 control-label"><%= t('act.title') %></label>
<div class="col-sm-10">
<%= @act.title %>
</div>
</div>
<!-- Name -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="name" class="col-sm-2 control-label"><%= @act.has_name ? "*" : "" %><%= t('act_signup.name') %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
2017-08-08 09:04:59 +00:00
<% if @act.has_name %>
<%= f.text_field :name, :class=>"input-medium form-control", :id=>'name', :placeholder=> t('act_signup.name'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_field :name, :class=>"input-medium form-control", :id=>'name', :placeholder=> t('act_signup.name') %>
<% end %>
2014-11-10 02:24:07 +00:00
</div>
</div>
<!-- IDNO -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="name" class="col-sm-2 control-label"><%= @act.has_idno ? "*" : "" %><%= t('act_signup.idno') %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
2017-08-08 09:04:59 +00:00
<% if @act.has_idno %>
<%= f.text_field :idno, :class=>"input-medium form-control", :placeholder=> t('act_signup.idno'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_field :idno, :class=>"input-medium form-control", :placeholder=> t('act_signup.idno') %>
<% end %>
2014-11-10 02:24:07 +00:00
</div>
</div>
<!-- Birthday -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="birthday" class="col-sm-2 control-label"><%= @act.has_birthday ? "*" : "" %><%= t('act_signup.birthday') %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
2017-08-08 09:04:59 +00:00
<% if @act.has_birthday %>
<%= f.datetime_picker :birthday, :no_label => true, :format=>"yyyy/MM/dd", :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
2014-11-10 02:24:07 +00:00
<%= f.datetime_picker :birthday, :no_label => true, :format=>"yyyy/MM/dd" %>
2017-08-08 09:04:59 +00:00
<% end %>
2014-11-10 02:24:07 +00:00
</div>
</div>
<!-- Sex -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="sex" class="col-sm-2 control-label"><%= @act.has_sex ? "*" : "" %><%= t('act_signup.sex') %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
<label class="radio-inline">
<%= f.radio_button :sex, "male" %><%= t('users.male')%>
</label>
<label class="radio-inline">
2017-08-08 09:04:59 +00:00
<% if @act.has_sex %>
<%= f.radio_button :sex, "female", :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %><%= t('users.female')%>
<% else %>
2014-11-10 02:24:07 +00:00
<%= f.radio_button :sex, "female" %><%= t('users.female')%>
2017-08-08 09:04:59 +00:00
<% end %>
2014-11-10 02:24:07 +00:00
</label>
</div>
</div>
<!-- Tel -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="tel" class="col-sm-2 control-label"><%= @act.has_tel ? "*" : "" %><%= t('act_signup.tel') %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
2017-08-08 09:04:59 +00:00
<% if @act.has_tel %>
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('act_signup.tel'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('act_signup.tel') %>
<% end %>
2014-11-10 02:24:07 +00:00
</div>
</div>
<!-- Phone -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="phone" class="col-sm-2 control-label"><%= @act.has_phone ? "*" : "" %><%= t('act_signup.phone') %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
2017-08-08 09:04:59 +00:00
<% if @act.has_phone %>
<%= f.text_field :phone, :class=>"input-medium form-control", :placeholder=> t('act_signup.phone'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
2014-11-10 02:24:07 +00:00
<%= f.text_field :phone, :class=>"input-medium form-control", :placeholder=> t('act_signup.phone') %>
2017-08-08 09:04:59 +00:00
<% end %>
2014-11-10 02:24:07 +00:00
</div>
</div>
<!-- Fax -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="fax" class="col-sm-2 control-label"><%= @act.has_fax ? "*" : "" %><%= t('act_signup.fax') %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
2017-08-08 09:04:59 +00:00
<% if @act.has_fax %>
<%= f.text_field :fax, :class=>"input-medium form-control", :placeholder=> t('act_signup.fax'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
2015-02-04 03:50:02 +00:00
<%= f.text_field :fax, :class=>"input-medium form-control", :placeholder=> t('act_signup.fax') %>
2017-08-08 09:04:59 +00:00
<% end %>
2014-11-10 02:24:07 +00:00
</div>
</div>
<!-- Email -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="email" class="col-sm-2 control-label"><%= @act.has_email ? "*" : "" %><%= t(:email) %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
2017-08-08 09:04:59 +00:00
<% if @act.has_email %>
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> t(:email), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> t(:email) %>
<% end %>
2014-11-10 02:24:07 +00:00
</div>
</div>
<!-- Note -->
<div class="form-group">
2017-08-08 09:04:59 +00:00
<label for="note" class="col-sm-2 control-label"><%= @act.has_note ? "*" : "" %><%= t('act_signup.note') %></label>
<div class="col-sm-10">
<% if @act.has_note %>
<%= f.text_area :note, rows: 5, :class=>"input-medium form-control", :placeholder=> t('act_signup.note'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_area :note, rows: 5, :class=>"input-medium form-control", :placeholder=> t('act_signup.note') %>
<% end %>
</div>
</div>
<!-- Organization -->
<div class="form-group">
<label for="fax" class="col-sm-2 control-label"><%= @act.has_organization ? "*" : "" %><%= t('act_signup.organization') %></label>
<div class="col-sm-10">
<% if @act.has_fax %>
<%= f.text_field :organization, :class=>"input-medium form-control", :placeholder=> t('act_signup.organization'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_field :organization, :class=>"input-medium form-control", :placeholder=> t('act_signup.organization') %>
<% end %>
</div>
</div>
<!-- Title -->
<div class="form-group">
<label for="fax" class="col-sm-2 control-label"><%= @act.has_title ? "*" : "" %><%= t('act_signup.title') %></label>
<div class="col-sm-10">
<% if @act.has_fax %>
<%= f.text_field :title, :class=>"input-medium form-control", :placeholder=> t('act_signup.title'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_field :title, :class=>"input-medium form-control", :placeholder=> t('act_signup.title') %>
<% end %>
</div>
</div>
<!-- Address -->
<div class="form-group">
<label for="note" class="col-sm-2 control-label"><%= @act.has_address ? "*" : "" %><%= t('act_signup.address') %></label>
<div class="col-sm-10">
<% if @act.has_address %>
<%= f.text_area :address, rows: 5, :class=>"input-medium form-control", :placeholder=> t('act_signup.address'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_area :address, rows: 5, :class=>"input-medium form-control", :placeholder=> t('act_signup.address') %>
<% end %>
</div>
</div>
<!-- Emergency Contact Person -->
<div class="form-group">
<label for="fax" class="col-sm-2 control-label"><%= @act.has_emergency_contact_person ? "*" : "" %><%= t('act_signup.emergency_contact_person') %></label>
<div class="col-sm-10">
<% if @act.has_fax %>
<%= f.text_field :emergency_contact_person, :class=>"input-medium form-control", :placeholder=> t('act_signup.emergency_contact_person'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_field :emergency_contact_person, :class=>"input-medium form-control", :placeholder=> t('act_signup.emergency_contact_person') %>
<% end %>
</div>
</div>
<!-- Emergency Contact Number -->
<div class="form-group">
<label for="fax" class="col-sm-2 control-label"><%= @act.has_emergency_contact_number ? "*" : "" %><%= t('act_signup.emergency_contact_number') %></label>
<div class="col-sm-10">
<% if @act.has_fax %>
<%= f.text_field :emergency_contact_number, :class=>"input-medium form-control", :placeholder=> t('act_signup.emergency_contact_number'), :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %>
<% else %>
<%= f.text_field :emergency_contact_number, :class=>"input-medium form-control", :placeholder=> t('act_signup.emergency_contact_number') %>
<% end %>
</div>
</div>
<!-- Vegetarian -->
<div class="form-group">
<label for="sex" class="col-sm-2 control-label"><%= @act.has_vegetarian ? "*" : "" %><%= t('act_signup.vegetarian') %></label>
2014-11-10 02:24:07 +00:00
<div class="col-sm-10">
2017-08-08 09:04:59 +00:00
<label class="radio-inline">
<%= f.radio_button :vegetarian, "true" %><%= t(:yes_)%>
</label>
<label class="radio-inline">
<% if @act.has_vegetarian %>
<%= f.radio_button :vegetarian, "false", :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %><%= t(:no_) %>
<% else %>
<%= f.radio_button :vegetarian, "false" %><%= t(:no_) %>
<% end %>
</label>
2014-11-10 02:24:07 +00:00
</div>
</div>
<!-- 驗證碼 -->
<div class="form-group">
<label for="note" class="col-sm-2 control-label"><%= t('act_signup.recaptcha') %></label>
<div class="col-sm-10">
<%= gotcha_error %>
<%= gotcha %>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<label>
2017-08-08 09:04:59 +00:00
<input id="agree" name="agree" value="1" type="checkbox" data-fv-validation="required;" data-fv-messages="Please agree to privacy policy.;">
2014-11-10 02:24:07 +00:00
<a href="<%= OrbitHelper.url_to_show(@act.to_param) %>?method=show_privacy" target="_blank"><%= t("act_signup.agree")%></a>
</label>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="hidden" name="referer_url" value="<%= request.original_url.split(request.env["HTTP_HOST"]).last %>">
<input type="hidden" name="act_signup[act_id]" value="<%= @act.id %>">
<%= f.submit t('submit'), class: 'btn btn-primary', :id => 'button-mail' %>
<%= f.button t('cancel'), type: 'reset', class: 'btn' %>
</div>
</div>
</fieldset>
<% end %>
<script type="text/javascript">
2017-08-08 09:04:59 +00:00
// (function(){
var vForm = new FormValidator($("#new-act-signup"));
// })();
2014-11-10 02:24:07 +00:00
</script>
<% elsif @act.sign_up.blank? %>
<%= t('act.sign_up_not_yet') %>
<% else %>
<%= t('act.sign_up_overdue') %>
<% end %>