diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 10aa39df2..8896da38c 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -44,15 +44,14 @@ class ZipdownController < ApplicationController zipfile = zip_homework_by_user homework send_file zipfile, :filename => homework.name+".zip", :type => detect_content_type(zipfile) if(zipfile) else - render_403 :message => :no_file_dowmload ,:layout => "course_base" + render file: 'public/no_file_found.html' , :layout => 'course_base' end else - render_403 :message =>:notice_file_not_found ,:layout => "course_base" + render file: 'public/file_not_found.html' , :layout => 'course_base' end else render_403 :message => :notice_not_authorized ,:layout => "course_base" end - rescue => e render file: 'public/file_not_found.html' , :layout => 'course_base' end @@ -76,13 +75,19 @@ class ZipdownController < ApplicationController # Todo: User Access Controll homeattaches = bid.homeworks + #记录所有作业是不是有附件,有一个附件就改为true + has_file = false # 得到每一个人所有文件打包的zip文件 # 并将每一个人的zip打包为一个并返回路径 user_zip_paths = homeattaches.map do |homeattach| if homeattach.attachments.count > 0 zip_homework_by_user homeattach + has_file = true if has_file == false end end + if has_file == false + render file: 'public/no_file_fond.html.erb' , :layout => 'course_base' + end zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER #@paths = homeworks_attach_path diff --git a/app/views/contest_notification/show.html.erb b/app/views/contest_notification/show.html.erb index 93fa1f4af..e04a18c68 100644 --- a/app/views/contest_notification/show.html.erb +++ b/app/views/contest_notification/show.html.erb @@ -9,8 +9,8 @@
<%= link_to h(forum.name), forum_path(forum) %>
-<%= forum.description%>
+<%= textAreailizable forum.description%>
<%= authoring forum.created_at, forum.creator %>
<%= link_to (forum.memo_count), forum_path(forum) %> | <%= link_to (forum.topic_count), forum_path(forum) %> |