277 lines
12 KiB
Plaintext
277 lines
12 KiB
Plaintext
<% # 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" %>
|
|
<%= javascript_include_tag "validator" %>
|
|
|
|
<style>
|
|
.text-error{
|
|
color: red;
|
|
}
|
|
</style>
|
|
|
|
<% 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">
|
|
<label for="name" class="col-sm-2 control-label"><%= @act.has_name ? "*" : "" %><%= t('act_signup.name') %></label>
|
|
<div class="col-sm-10">
|
|
<% 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 %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- IDNO -->
|
|
<div class="form-group">
|
|
<label for="name" class="col-sm-2 control-label"><%= @act.has_idno ? "*" : "" %><%= t('act_signup.idno') %></label>
|
|
<div class="col-sm-10">
|
|
<% 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 %>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Birthday -->
|
|
<div class="form-group">
|
|
<label for="birthday" class="col-sm-2 control-label"><%= @act.has_birthday ? "*" : "" %><%= t('act_signup.birthday') %></label>
|
|
<div class="col-sm-10">
|
|
<% 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 %>
|
|
<%= f.datetime_picker :birthday, :no_label => true, :format=>"yyyy/MM/dd" %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Sex -->
|
|
<div class="form-group">
|
|
<label for="sex" class="col-sm-2 control-label"><%= @act.has_sex ? "*" : "" %><%= t('act_signup.sex') %></label>
|
|
<div class="col-sm-10">
|
|
<label class="radio-inline">
|
|
<%= f.radio_button :sex, "male" %><%= t('users.male')%>
|
|
</label>
|
|
<label class="radio-inline">
|
|
<% if @act.has_sex %>
|
|
<%= f.radio_button :sex, "female", :data => {"fv-validation" => "required;", "fv-messages" => "Cannot be empty.;"} %><%= t('users.female')%>
|
|
<% else %>
|
|
<%= f.radio_button :sex, "female" %><%= t('users.female')%>
|
|
<% end %>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tel -->
|
|
<div class="form-group">
|
|
<label for="tel" class="col-sm-2 control-label"><%= @act.has_tel ? "*" : "" %><%= t('act_signup.tel') %></label>
|
|
<div class="col-sm-10">
|
|
<% 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 %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Phone -->
|
|
<div class="form-group">
|
|
<label for="phone" class="col-sm-2 control-label"><%= @act.has_phone ? "*" : "" %><%= t('act_signup.phone') %></label>
|
|
<div class="col-sm-10">
|
|
<% 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 %>
|
|
<%= f.text_field :phone, :class=>"input-medium form-control", :placeholder=> t('act_signup.phone') %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Fax -->
|
|
<div class="form-group">
|
|
<label for="fax" class="col-sm-2 control-label"><%= @act.has_fax ? "*" : "" %><%= t('act_signup.fax') %></label>
|
|
<div class="col-sm-10">
|
|
<% 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 %>
|
|
<%= f.text_field :fax, :class=>"input-medium form-control", :placeholder=> t('act_signup.fax') %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Email -->
|
|
<div class="form-group">
|
|
<label for="email" class="col-sm-2 control-label"><%= @act.has_email ? "*" : "" %><%= t(:email) %></label>
|
|
<div class="col-sm-10">
|
|
<% 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 %>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Note -->
|
|
<div class="form-group">
|
|
<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>
|
|
<div class="col-sm-10">
|
|
<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>
|
|
</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>
|
|
<input id="agree" name="agree" value="1" type="checkbox" data-fv-validation="required;" data-fv-messages="Please agree to privacy policy.;">
|
|
<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">
|
|
// (function(){
|
|
var vForm = new FormValidator($("#new-act-signup"));
|
|
// })();
|
|
</script>
|
|
|
|
<% elsif @act.sign_up.blank? %>
|
|
|
|
<%= t('act.sign_up_not_yet') %>
|
|
|
|
<% else %>
|
|
|
|
<%= t('act.sign_up_overdue') %>
|
|
|
|
<% end %>
|