From 67737d8dd99f106f4bf3eb90c071e476f6e5ec92 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 10 Sep 2014 10:54:20 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8=E7=BF=BB=E5=88=B0=E7=AC=AC?= =?UTF-8?q?=E4=BA=94=E9=A1=B5=E5=90=8E=E9=A1=B5=E9=9D=A2=E5=B8=83=E5=B1=80?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98=20#1208?= =?UTF-8?q?=20=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9A=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/settings/_members.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/projects/settings/_members.html.erb b/app/views/projects/settings/_members.html.erb index c1d63d03b..f1008363c 100644 --- a/app/views/projects/settings/_members.html.erb +++ b/app/views/projects/settings/_members.html.erb @@ -118,6 +118,7 @@
<%= render_principals_for_new_members(@project) %>
+

<%= l(:label_role_plural) %>: <% roles.each do |role| %> From dec8b70895efa8208a50cd3bba5a068589dca2dc Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 10 Sep 2014 11:14:38 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=80=81=E5=B8=88?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=9C=A8=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=83=85=E5=86=B5=E4=B8=8B=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD=E6=8A=A5500=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84BUG=20#1209=20=E8=A7=A3=E5=86=B3=E6=96=B9?= =?UTF-8?q?=E6=A1=88=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=9C=89=E4=B8=80=E4=B8=AA=E4=BB=A5=E4=B8=8A=E9=99=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=BD=93=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=97=B6=EF=BC=8C=E6=8F=90=E7=A4=BA=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 10aa39df2..dac213ff5 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -76,13 +76,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 + + render_403 :message => :no_file_dowmload ,:layout => "course_base" if has_file == false + zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER #@paths = homeworks_attach_path From f70edc1a0be811d58f892001ca517c7cf68aa4cf Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 10 Sep 2014 14:38:11 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=80=81=E5=B8=88?= =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=9C=A8=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=83=85=E5=86=B5=E4=B8=8B=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E6=89=93=E5=8C=85=E4=B8=8B=E8=BD=BD=E6=8A=A5500=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E7=9A=84BUG=20#1209=20=E8=A7=A3=E5=86=B3=E6=96=B9?= =?UTF-8?q?=E6=A1=88=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E6=9C=89=E4=B8=80=E4=B8=AA=E4=BB=A5=E4=B8=8A=E9=99=84?= =?UTF-8?q?=E4=BB=B6=EF=BC=8C=E5=BD=93=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95?= =?UTF-8?q?=E9=99=84=E4=BB=B6=E6=97=B6=EF=BC=8C=E8=B7=B3=E8=BD=AC=E5=88=B0?= =?UTF-8?q?=E7=9B=B8=E5=BA=94=E9=A1=B5=E9=9D=A2=EF=BC=8C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=B2=A1=E6=9C=89=E4=BB=BB=E4=BD=95=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=8F=AF=E4=BB=A5=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/zipdown_controller.rb | 11 ++++--- config/locales/zh.yml | 2 +- public/no_file_found.html | 42 +++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 7 deletions(-) create mode 100644 public/no_file_found.html diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index dac213ff5..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 @@ -86,9 +85,9 @@ class ZipdownController < ApplicationController has_file = true if has_file == false end end - - render_403 :message => :no_file_dowmload ,:layout => "course_base" if has_file == false - + 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/config/locales/zh.yml b/config/locales/zh.yml index 874c9108a..c24787d26 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -2109,7 +2109,7 @@ zh: label_school_no_course: 该学校未开设任何课程,您可以查看其他学校课程 label_school_less_course: 该学校开设课程较少,您可以查看其他学校课程 - label_file_not_found: 对不起,该文件现在不能下载! + label_file_not_found: 对不起,该文件现在不能下载 label_goto_homepage: 返回主页 label_trustie_team: Trustie开发团队 diff --git a/public/no_file_found.html b/public/no_file_found.html new file mode 100644 index 000000000..7fc343e50 --- /dev/null +++ b/public/no_file_found.html @@ -0,0 +1,42 @@ + + + + + File not found + + + +

+ +

该作业没有任何的附件可以下载

+

返回主页

+ +
+
+

Trustie开发团队.

+
+
+ +
+ + From 9ff4fee8daa50a09a9a9c29f62d29682282e982a Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Wed, 10 Sep 2014 14:49:27 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E4=B8=BA1=E7=BA=A7=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E6=97=B6=E6=96=87=E5=AD=97=E4=BC=9A=E9=87=8D=E5=8F=A0=E7=9A=84?= =?UTF-8?q?BUG=20#1210=20=E8=A7=A3=E5=86=B3=E6=96=B9=E6=A1=88=EF=BC=9A?= =?UTF-8?q?=E4=BF=AE=E6=94=B9css=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_projects.html.erb | 21 ++++++--------------- public/stylesheets/application.css | 3 +-- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index a3b8e267c..a84eff2e2 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -1,7 +1,7 @@ <% @nav_dispaly_project_label = 1 @nav_dispaly_forum_label = 1 %> -<% #@nav_dispaly_project_label = 1 %> +<%#@nav_dispaly_project_label = 1 %> @@ -48,9 +48,6 @@ - - -