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

63 lines
2.2 KiB
Plaintext
Raw Permalink Normal View History

2016-06-29 06:57:45 +00:00
<% # encoding: utf-8 %>
2019-11-13 04:07:16 +00:00
<%= stylesheet_link_tag "lib/jquery-ui-1.12.1/jquery-ui.min.css" %>
<%= javascript_include_tag 'basic.js' %>
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">
2019-11-13 04:07:16 +00:00
<%= f.text_area :description, rows: 5, :class=>"ckeditor input-medium form-control", :placeholder=> t('seminar_signup.file_note') %>
2016-06-29 06:57:45 +00:00
</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 %>