This commit is contained in:
parent
1cb1eeeb1d
commit
9b707f2b5a
|
@ -27,7 +27,7 @@ class ZipdownController < ApplicationController
|
|||
else
|
||||
logger.error "[ZipDown#assort] ===> #{obj.class.to_s.to_sym} unKown !!"
|
||||
end
|
||||
send_file zipfile, :filename => obj.name, :type => detect_content_type(zipfile) if zipfile
|
||||
send_file zipfile, :filename => obj.name+".zip", :type => detect_content_type(zipfile) if zipfile
|
||||
|
||||
#rescue NameError, ActiveRecord::RecordNotFound => e
|
||||
#logger.error "[ZipDown] ===> #{e}"
|
||||
|
@ -39,7 +39,7 @@ class ZipdownController < ApplicationController
|
|||
homework = HomeworkAttach.find params[:homework]
|
||||
if homework != nil && (User.current.admin? || User.current.member_of?(homework.bid.courses.first))
|
||||
zipfile = zip_homework_by_user homework
|
||||
send_file zipfile, :filename => homework.name, :type => detect_content_type(zipfile) if zipfile
|
||||
send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if zipfile
|
||||
else
|
||||
render_403 :message => :notice_not_authorized
|
||||
end
|
||||
|
@ -88,7 +88,7 @@ class ZipdownController < ApplicationController
|
|||
#length = attach.storage_path.length
|
||||
homeworks_attach_path << attach.diskfile#.to_s.slice((length+1)..-1)
|
||||
end
|
||||
zipping "#{homeattach.user.name.to_s}.zip", homeworks_attach_path, OUTPUT_FOLDER, true
|
||||
zipping "#{homeattach.user.name.to_s}_#{Time.now.to_i}.zip", homeworks_attach_path, OUTPUT_FOLDER, true
|
||||
#user_attaches_paths
|
||||
end
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
(Member.where('user_id = ? and project_id = ?', User.current.id,
|
||||
@bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0) && cur_user_homework_for_bid(@bid).count == 0 %>
|
||||
<div class='icon icon-add'>
|
||||
<!-- <%= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %> -->
|
||||
<%#= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
|
||||
<%= link_to l(:label_course_new_homework),new_homework_attach_path %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<table width="100%" valign="center">
|
||||
<tr>
|
||||
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span>
|
||||
<%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(
|
||||
<%#= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), remote: false, class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(
|
||||
User.current.admin? ||
|
||||
!(User.current.roles_for_project(@bid.courses.first).map(&:id) & ([7,9])).empty? ) ||
|
||||
(Rails.env.development?) %>
|
||||
|
|
Loading…
Reference in New Issue