From 629641d065e6c0ceb0678daecf70308aabad5d0a Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Mon, 22 Dec 2014 17:02:32 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=8A=E8=B0=83=E6=95=B4=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E9=A1=B5=E9=9D=A2=E3=80=8B=E5=92=8C=E3=80=8A?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=AA=E4=BA=BA=E4=B8=BB=E9=A1=B5=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E3=80=8B=20Signed-off-by:=20alan=20<547533434@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 14 ++++++++------ app/views/courses/_groups_name.html.erb | 9 ++++++--- app/views/courses/_member_list.html.erb | 4 ++-- app/views/courses/member.html.erb | 22 +++++++++++----------- public/stylesheets/course_group.css | 8 +++++--- 5 files changed, 32 insertions(+), 25 deletions(-) diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 48a7aa898..155932587 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -433,14 +433,16 @@ class UsersController < ApplicationController else activity = Activity.where(where_condition).where('user_id = ?', @user.id).order('id desc') end - activity = activity.reject { |e| - ((e.act_type=="Issue") && ( !e.act.visible?(User.current))) || - ((e.act_type == "Journal") && (!e.act.project.visible?(User.current))) || - ((e.act_type == "Bid") && ((!User.current.member_of_course?(e.act.courses.first) || !User.current.admin?))) - } + @activity_count = activity.count @activity_pages = Paginator.new @activity_count, pre_count, params['page'] - @activity = activity.slice(@activity_pages.offset,@activity_pages.per_page) + activity_page = activity.slice(@activity_pages.offset,@activity_pages.per_page * 2) + activity_page = activity_page.reject { |e| + ((e.act_type=="Issue") && ( !e.act.visible?(User.current))) || + ((e.act_type == "Journal") && (!e.act.project.visible?(User.current))) || + ((e.act_type == "Bid") && ((!User.current.member_of_course?(e.act.courses.first) || !User.current.admin?))) + } + @activity = activity.slice(0,@activity_pages.per_page) @state = 0 end diff --git a/app/views/courses/_groups_name.html.erb b/app/views/courses/_groups_name.html.erb index f02794648..1fe02dfeb 100644 --- a/app/views/courses/_groups_name.html.erb +++ b/app/views/courses/_groups_name.html.erb @@ -2,15 +2,18 @@