seminar2_old/app/views/seminars/add_file.html.erb

61 lines
2.1 KiB
Plaintext
Raw Normal View History

2016-06-29 06:57:45 +00:00
<% # encoding: utf-8 %>
2019-10-29 15:14:38 +00:00
<% @@session = session %>
<%= yield %>
2016-06-29 06:57:45 +00:00
<%
data = action_data
@con = data["con"]
@seminar = data["seminar"]
@seminar_signup = data["seminar_signup"]
%>
<% if !session[:seminar_signup_id].blank? %>
<% if ( @seminar.contribute_file_count.blank? or @seminar_signup.seminar_signup_contributes.count < @seminar.contribute_file_count.to_i ) %>
<%= form_for @con, url: add_file_proc_seminars_path, html: {class: "content form-horizontal" , :id=>"new-seminar-signup-contribute"} do |f| %>
<fieldset>
<div class="form-group">
<label for="file_name" class="col-sm-2 control-label">*<%= t('seminar_signup.file_name') %></label>
<div class="col-sm-10">
<%= f.text_field :title, :class=>"input-medium form-control", :id=>'name', :placeholder=> t('seminar_signup.file_name'), :required => true %>
</div>
</div>
<div class="form-group">
<label for="note" class="col-sm-2 control-label"><%= t('seminar_signup.file_note') %></label>
<div class="col-sm-10">
<%= f.text_area :description, rows: 5, :class=>"input-medium form-control", :placeholder=> t('seminar_signup.file_note') %>
</div>
</div>
<div class="form-group">
<label for="file" class="col-sm-2 control-label"><%= t('seminar_signup.files') %></label>
<div class="col-sm-10">
<%= f.file_field :file %>
</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.split('?').first %>">
<input type="hidden" name="seminar_signup_contribute[seminar_signup_id]" value="<%= session[:seminar_signup_id] %>">
<%= f.submit t('submit'), class: 'btn btn-primary', :id => 'button-mail' %>
<%= f.button t('cancel'), type: 'reset', class: 'btn' %>
</div>
</div>
<% end %>
<% else %>
上傳檔案數已滿
<% end %>
<% else %>
請先登入
<br />
<a href="<%= page_for_seminar_url %>">回列表頁</a>
<% end %>