打爆下载增加权限、增加打包下载功能

This commit is contained in:
sw 2015-04-03 13:10:18 +08:00
parent b8cc431f13
commit ec8e609ddc
3 changed files with 4 additions and 2 deletions

View File

@ -16,9 +16,11 @@ class ZipdownController < ApplicationController
end
end
#一个作业下所有文件打包下载只有admin和课程老师有权限
def assort
if params[:obj_class] == "Bid"
bid = Bid.find params[:obj_id]
render_403 if User.current.allowed_to?(:as_teacher,bid.courses.first)
file_count = 0
bid.homeworks.map { |homework| file_count += homework.attachments.count}
if file_count > 0

View File

@ -26,7 +26,7 @@
</span>
</li>
<li class="wdown">
<%#= link_to "(#{homework.attachments.count.to_s}个附件)", "javascript:"%>
<%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
</li>
<li class="wscore">
<% unless is_student_batch_homework %>

View File

@ -38,7 +38,7 @@ a:hover.tb_all{ background:#eaeaea; text-decoration:none;}
.pic_head a{ text-align:center; width:42px; overflow:hidden;text-overflow:ellipsis; white-space:nowrap;}
.pic_head img{ border:1px solid #fff;}
.pic_head img:hover{border:1px solid #15bccf;}
.dis ul li.wname a{ width:360px; font-size:14px; color:#595959; padding:15px 0 0 0px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:15px 0 0 0px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.dis ul li.wdown a{padding-top:22px; color:#3d7ec2; margin-right:35px;}
.wscore{ padding-top:22px; color:#888888; width:96px;}
.dis ul li.wping{margin-left:12px; }