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

174 lines
5.6 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" %>
<% 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">*<%= t('act_signup.name') %></label>
<div class="col-sm-10">
<%= f.text_field :name, :class=>"input-medium form-control", :id=>'name', :placeholder=> t('act_signup.name'), :required => true %>
</div>
</div>
<% if @act.has_idno %>
<!-- IDNO -->
<div class="form-group">
<label for="name" class="col-sm-2 control-label">*<%= t('act_signup.idno') %></label>
<div class="col-sm-10">
<%= f.text_field :idno, :class=>"input-medium form-control", :placeholder=> t('act_signup.idno'), :required => true %>
</div>
</div>
<% end %>
<!-- Birthday -->
<div class="form-group">
<label for="birthday" class="col-sm-2 control-label"><%= t('act_signup.birthday') %></label>
<div class="col-sm-10">
<%= f.datetime_picker :birthday, :no_label => true, :format=>"yyyy/MM/dd" %>
</div>
</div>
<!-- Sex -->
<div class="form-group">
<label for="sex" class="col-sm-2 control-label"><%= 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">
<%= f.radio_button :sex, "female" %><%= t('users.female')%>
</label>
</div>
</div>
<!-- Tel -->
<div class="form-group">
<label for="tel" class="col-sm-2 control-label">*<%= t('act_signup.tel') %></label>
<div class="col-sm-10">
<%= f.text_field :tel, :class=>"input-medium form-control", :placeholder=> t('act_signup.tel'), :required => true %>
</div>
</div>
<!-- Phone -->
<div class="form-group">
<label for="phone" class="col-sm-2 control-label"><%= t('act_signup.phone') %></label>
<div class="col-sm-10">
<%= f.text_field :phone, :class=>"input-medium form-control", :placeholder=> t('act_signup.phone') %>
</div>
</div>
<!-- Fax -->
<div class="form-group">
<label for="fax" class="col-sm-2 control-label"><%= t('act_signup.fax') %></label>
<div class="col-sm-10">
<%= f.text_field :fax, :class=>"input-medium form-control", :placeholder=> t('act_signup.fax') %>
</div>
</div>
<!-- Email -->
<div class="form-group">
<label for="email" class="col-sm-2 control-label">*<%= t(:email) %></label>
<div class="col-sm-10">
<%= f.email_field :email, :class=>"input-medium form-control availibility", :placeholder=> t(:email), :required => true %>
</div>
</div>
<!-- Note -->
<div class="form-group">
<label for="note" class="col-sm-2 control-label"><%= t('act.note') %></label>
<div class="col-sm-10">
<%= f.text_area :note, rows: 5, :class=>"input-medium form-control", :placeholder=> t('act.note') %>
</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" required="required">
<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 validated = false,
chks = false
$("form.content").submit(function(event) {
var form = $(this),
val_num = 0,
isChecked = $('#agree:checked').val()?true:false;
if(!isChecked){
return false;
}
});
})();
</script>
<% elsif @act.sign_up.blank? %>
<%= t('act.sign_up_not_yet') %>
<% else %>
<%= t('act.sign_up_overdue') %>
<% end %>