To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / app / views / activities / _recent.rhtml @ 378:c80fd1ef305f

History | View | Annotate | Download (1.61 KB)

1 344:1a514b9347d4 chris
<% events = @events_by_day %>
2
<% max = 5 %>
3
<% if (events.nil?)
4
     activity = Redmine::Activity::Fetcher.new(User.current, :project => @project)
5 378:c80fd1ef305f chris
     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)
10 344:1a514b9347d4 chris
   end
11
%>
12
13
<div id="activity">
14
15
<% if @project.nil? %>
16
   <%= content_tag('h3', l(:label_activity_my_recent)) %>
17
   <div class="activity box">
18
<% end %>
19
20
<% if events.empty? %>
21
22
   <% if @project.nil? %>
23
     <p><%= l(:label_activity_my_recent_none) %></p>
24
   <% end %>
25
26
<% else %>
27
28
   <% if !@project.nil? %>
29
     <div class="activity box">
30
     <%= content_tag('h3', l(:label_activity_recent)) %>
31
   <% end %>
32
33
   <dl>
34
   <% events.sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
35
     <dt class="<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
36
        <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
37
     <span class="time"><%= format_time(e.event_datetime) %></span>
38
     <%= content_tag('span', link_to_project(e.project), :class => 'project') if @project.nil? || @project != e.project %>
39
     <% if e.respond_to?(:event_author) %>
40
       <span class="author"><%= e.event_author %></span>
41
     <% end %>
42
     </dt>
43
     <dd><%= link_to format_activity_title(e.event_title), e.event_url %>
44
     <span class="description"><%= format_activity_description(e.event_description) %></span>
45
     </dd>
46
   <% end -%>
47
   </dl>
48
49
   </div>
50
51
<% end %>
52
53
<% if events.empty? and @project.nil? %></div><% end %>
54
55
</div>