Mercurial > hg > soundsoftware-site
comparison app/views/activities/_recent.rhtml @ 378:c80fd1ef305f feature_121
Ensure Recent Activity shows only activity on projects the user is actually a member of, if invoked from My Page (rather than on all permitted projects)
author | Chris Cannam <chris.cannam@soundsoftware.ac.uk> |
---|---|
date | Mon, 04 Apr 2011 10:28:08 +0100 |
parents | 1a514b9347d4 |
children | f25c73364bfb |
comparison
equal
deleted
inserted
replaced
344:1a514b9347d4 | 378:c80fd1ef305f |
---|---|
1 <% events = @events_by_day %> | 1 <% events = @events_by_day %> |
2 <% max = 5 %> | 2 <% max = 5 %> |
3 <% if (events.nil?) | 3 <% if (events.nil?) |
4 activity = Redmine::Activity::Fetcher.new(User.current, :project => @project) | 4 activity = Redmine::Activity::Fetcher.new(User.current, :project => @project) |
5 events = activity.events(Date.today - 28, Date.today + 1).first(max) | 5 events = activity.events(Date.today - 28, Date.today + 1) |
6 if defined? user | |
7 events = events.select { |e| user.member_of? e.project } | |
8 end | |
9 events = events.first(max) | |
6 end | 10 end |
7 %> | 11 %> |
8 | 12 |
9 <div id="activity"> | 13 <div id="activity"> |
10 | 14 |