From 945b9ff9cfd827bdb7e58790c8f9d4423199beff Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Sat, 7 Mar 2015 11:38:15 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=BF=9B=E5=85=A5?= =?UTF-8?q?=E6=88=91=E7=9A=84=E5=8A=A8=E6=80=81=EF=BC=8C=E5=85=B3=E6=B3=A8?= =?UTF-8?q?=E4=BA=BA=E6=B2=A1=E6=9C=89=E8=BF=9B=E8=A1=8C=E6=9D=83=E9=99=90?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 00af13cb5..5e2f76705 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -443,15 +443,15 @@ class UsersController < ApplicationController activity = Activity.where(where_condition).where('user_id in (?)', watcher).order('id desc') else activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc') - activity = activity.reject { |e| - !User.current.admin? && - (((e.act_type == "Issue") && !e.act.project.visible?(User.current)) || - (e.act_type == "Bid" && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) || - (e.act_type == "Journal" && e.act.respond_to?("Project") && !e.act.project.visible?(User.current)) || - (e.act_type == "News" && ((!e.act.project.nil? && !e.act.project.visible?(User.current)) || (!e.act.course.nil? && e.act.course.is_public == 0 && !User.current.member_of_course?(e.act.course)))) || - (e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course))))) - } end + activity = activity.reject { |e| + !User.current.admin? && + (((e.act_type == "Issue") && !e.act.project.visible?(User.current)) || + (e.act_type == "Bid" && e.act.courses.first.is_public == 0 && !User.current.member_of_course?(e.act.courses.first)) || + (e.act_type == "Journal" && e.act.respond_to?("Project") && !e.act.project.visible?(User.current)) || + (e.act_type == "News" && ((!e.act.project.nil? && !e.act.project.visible?(User.current)) || (!e.act.course.nil? && e.act.course.is_public == 0 && !User.current.member_of_course?(e.act.course)))) || + (e.act_type == "Message" && !e.act.board.nil? && ((!e.act.board.project.nil? && !e.act.board.project.visible?(User.current)) || (!e.act.board.course.nil? && e.act.board.course.is_public == 0 && !User.current.member_of_course?(e.act.board.course))))) + } @activity_count = activity.count @activity_pages = Paginator.new @activity_count, pre_count, params['page'] @activity = activity.slice(@activity_pages.offset,@activity_pages.per_page) From e8bdc13f24e7263375b0cf6afbd2b6d8f5de03e1 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 7 Mar 2015 12:25:42 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E7=BC=BA=E9=99=B71975=EF=BC=8C=E6=89=93?= =?UTF-8?q?=E5=BC=80project=20330=E7=9A=84=E6=97=B6=E5=80=99=E6=8A=A5?= =?UTF-8?q?=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/projects/show.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index 6a47f07f0..37c7a81a7 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -21,7 +21,8 @@