From 96bc35552a134e22a080df1dce0ffcd874aa3753 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 14 Nov 2016 15:11:37 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E6=9C=AA=E6=94=B6=E8=97=8F=E7=9A=84?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=92=8C=E9=A1=B9=E7=9B=AE=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E4=B8=8D=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index c95366835..cf1fc7f4e 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1653,8 +1653,8 @@ class UsersController < ApplicationController shield_project_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Project'").map(&:shield_id) shield_course_ids = ShieldActivity.select("shield_id").where("container_type='User' and container_id=#{@user.id} and shield_type='Course'").map(&:shield_id) @page = params[:page] ? params[:page].to_i + 1 : 0 - user_project_ids = (@user.projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" - user_course_ids = (@user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" + user_project_ids = (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).empty? ? "(-1)" : "(" + (@user.favorite_projects.visible.map{|project| project.id}-shield_project_ids).join(",") + ")" + user_course_ids = (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).empty? ? "(-1)" : "(" + (@user.favorite_courses.visible.where("is_delete = 0").map{|course| course.id}-shield_course_ids).join(",") + ")" course_types = "('Message','News','HomeworkCommon','Poll','Course','JournalsForMessage')" project_types = "('Message','Issue','Project')" principal_types = "JournalsForMessage" From 0ed878e718df24c2b75489ce6e675f10d6aa9816 Mon Sep 17 00:00:00 2001 From: cxt Date: Mon, 14 Nov 2016 15:36:36 +0800 Subject: [PATCH 02/15] =?UTF-8?q?404=E3=80=81403=E3=80=81500=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/courses_controller.rb | 2 +- app/views/common/403.html | 56 ++++++++++++++++-------- app/views/common/404.html | 59 ++++++++++++++++++-------- public/500.html | 48 +++++++++++++++++++-- public/images/404/pic_403.jpg | Bin 0 -> 26392 bytes public/images/404/pic_404.jpg | Bin 0 -> 28199 bytes public/images/404/pic_500.jpg | Bin 0 -> 27994 bytes public/stylesheets/css/common.css | 30 +++++++++++++ public/stylesheets/css/public.css | 8 +++- 9 files changed, 162 insertions(+), 41 deletions(-) create mode 100644 public/images/404/pic_403.jpg create mode 100644 public/images/404/pic_404.jpg create mode 100644 public/images/404/pic_500.jpg diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 4af7d6644..0bb027153 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -1457,7 +1457,7 @@ class CoursesController < ApplicationController WHERE student_works.homework_common_id = homework_commons.id AND homework_commons.course_id = #{@course.id} AND student_works.user_id = members.user_id - ) AS score,(SELECT (message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 + + ) AS score,(SELECT max(message_num*2 + message_reply_num*1 + news_reply_num*1 + news_num*1 + resource_num*5 + journal_num*1 + homework_journal_num*1 ) FROM `course_contributor_scores` AS ccs WHERE ccs.course_id = #{@course.id} AND ccs.user_id = members.user_id ) AS act_score,(SELECT SUM(exercise_users.score) FROM exercise_users,exercises WHERE exercise_users.exercise_id = exercises.id AND exercises.course_id = #{@course.id} AND exercise_users.user_id = members.user_id) AS ex_score, diff --git a/app/views/common/403.html b/app/views/common/403.html index d063b315e..78dc6dae7 100644 --- a/app/views/common/403.html +++ b/app/views/common/403.html @@ -12,13 +12,6 @@ .cl{ clear:both; overflow:hidden; } a{ text-decoration:none !important; } a:hover{ } - - .error_content{ width:550px; height:200px; margin:0 auto; padding:10px 0;} - .error_left{color:#15bccf; font-size:100px; font-weight:bold; font-style:oblique; width:200px; height:120px; padding-right:30px; float:left;} - .error_right{ width:240px; height:120px; float:left;color:#15bccf; font-size: 17px; font-weight:bold; padding-left:30px; margin-top:40px; border-left:1px dashed #CCC; } - .error_link{ margin-top:8px;} - .error_link a{ display:block; width:80px; height:28px; font-size:14px; font-weight:bold; color:#fff; text-align:center; background:#15bccf; float:left; margin-right:10px;} - .error_link a:hover{ background:#ff8417;} - -
-
403
-
-

ERROR FORBIDDEN
- 没有访问权限!建议您

-