changeset 380:6627ac1de32b live

Merge from branch "cannam-pre-20110113-merge" (includes merge from feature_121)
author Chris Cannam
date Mon, 04 Apr 2011 10:31:10 +0100
parents 0802551af0a5 (current diff) f25c73364bfb (diff)
children 0f793aa84f75
files
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/app/views/activities/_recent.rhtml	Fri Apr 01 17:24:48 2011 +0100
+++ b/app/views/activities/_recent.rhtml	Mon Apr 04 10:31:10 2011 +0100
@@ -2,13 +2,21 @@
 <% max = 5 %>
 <% if (events.nil?) 
      activity = Redmine::Activity::Fetcher.new(User.current, :project => @project)
+     
      if @project
         # Don't show news (duplicated with News box) or wiki edits (too
 	# tedious) in project front page
         activity.scope = [ "changesets", "files", "issues", "documents" ]
      end
+     
+     events = activity.events(Date.today - 28, Date.today + 1)
+     
+     if defined? user
+       events = events.select { |e| user.member_of? e.project }
+     end
+     
+     events = events.first(max)
 
-     events = activity.events(Date.today - 28, Date.today + 1).first(max)
    end
 %>
 
--- a/app/views/my/blocks/_activitymyprojects.rhtml	Fri Apr 01 17:24:48 2011 +0100
+++ b/app/views/my/blocks/_activitymyprojects.rhtml	Mon Apr 04 10:31:10 2011 +0100
@@ -1,4 +1,4 @@
 
-<%= render :partial => 'activities/recent' %>
+<%= render :partial => 'activities/recent', :locals => { :user => User.current } %>