From ec8e609ddc8d7cd40abb11c169556431bf04b8ef Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 3 Apr 2015 13:10:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=93=E7=88=86=E4=B8=8B=E8=BD=BD=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=9D=83=E9=99=90=E3=80=81=E5=A2=9E=E5=8A=A0=E6=89=93?= =?UTF-8?q?=E5=8C=85=E4=B8=8B=E8=BD=BD=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 2 ++ app/views/homework_attach/_homework.html.erb | 2 +- public/stylesheets/css.css | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index a3bee3c95..df354f107 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -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 diff --git a/app/views/homework_attach/_homework.html.erb b/app/views/homework_attach/_homework.html.erb index 2b5c48cd4..fca25e8ee 100644 --- a/app/views/homework_attach/_homework.html.erb +++ b/app/views/homework_attach/_homework.html.erb @@ -26,7 +26,7 @@
  • - <%#= link_to "(#{homework.attachments.count.to_s}个附件)", "javascript:"%> + <%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
  • <% unless is_student_batch_homework %> diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index f311d3100..6c7f533ac 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -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; }