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 @@ - contest.trustie.net - <%=link_to l(:field_homepage), home_path %> > <%=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> > 详情 + contest.trustie.net + <%=link_to l(:field_homepage), home_path %> > <%#=link_to l(:label_contest_innovate), :controller => 'welcome', :action => 'contest' %> 详情 diff --git a/app/views/forums/_forum_list.html.erb b/app/views/forums/_forum_list.html.erb index 2b8f98494..df897151e 100644 --- a/app/views/forums/_forum_list.html.erb +++ b/app/views/forums/_forum_list.html.erb @@ -10,7 +10,7 @@

<%= link_to h(forum.name), forum_path(forum) %>

-

<%= forum.description%>

+

<%= textAreailizable forum.description%>

<%= authoring forum.created_at, forum.creator %>

diff --git a/app/views/forums/show.html.erb b/app/views/forums/show.html.erb index 1622bbe02..6e41cc904 100644 --- a/app/views/forums/show.html.erb +++ b/app/views/forums/show.html.erb @@ -3,24 +3,12 @@

<%=l(:label_memo_new)%>

<% if User.current.logged? %> <%= labelled_form_for(@memo, :url => create_memo_forum_path(@forum), :html => {:multipart => true} ) do |f| %> -

<%= f.text_field :subject, :required => true%>

<%= f.text_area :content, :required => true, :id => 'editor02' %>

(<%= l(:label_memos_max_length) %>)

- <%= l(:label_attachment_plural) %>
<%= render :partial => 'attachments/form', :locals => {:container => @memo} %>

diff --git a/app/views/layouts/base_forums.html.erb b/app/views/layouts/base_forums.html.erb index 4d981c23a..e5597afcf 100644 --- a/app/views/layouts/base_forums.html.erb +++ b/app/views/layouts/base_forums.html.erb @@ -52,7 +52,7 @@
<%= link_to (forum.memo_count), forum_path(forum) %><%= link_to (forum.topic_count), forum_path(forum) %>
- - -