chris@344
|
1 <% events = @events_by_day %>
|
chris@344
|
2 <% max = 5 %>
|
chris@344
|
3 <% if (events.nil?)
|
chris@344
|
4 activity = Redmine::Activity::Fetcher.new(User.current, :project => @project)
|
chris@361
|
5 if @project
|
chris@361
|
6 # Don't show news (duplicated with News box) or wiki edits (too
|
chris@361
|
7 # tedious) in project front page
|
chris@361
|
8 activity.scope = [ "changesets", "files", "issues", "documents" ]
|
chris@361
|
9 end
|
chris@361
|
10
|
chris@344
|
11 events = activity.events(Date.today - 28, Date.today + 1).first(max)
|
chris@344
|
12 end
|
chris@344
|
13 %>
|
chris@344
|
14
|
chris@344
|
15 <div id="activity">
|
chris@344
|
16
|
chris@344
|
17 <% if @project.nil? %>
|
chris@344
|
18 <%= content_tag('h3', l(:label_activity_my_recent)) %>
|
chris@344
|
19 <div class="activity box">
|
chris@344
|
20 <% end %>
|
chris@344
|
21
|
chris@344
|
22 <% if events.empty? %>
|
chris@344
|
23
|
chris@344
|
24 <% if @project.nil? %>
|
chris@344
|
25 <p><%= l(:label_activity_my_recent_none) %></p>
|
chris@344
|
26 <% end %>
|
chris@344
|
27
|
chris@344
|
28 <% else %>
|
chris@344
|
29
|
chris@344
|
30 <% if !@project.nil? %>
|
chris@344
|
31 <div class="activity box">
|
chris@344
|
32 <%= content_tag('h3', l(:label_activity_recent)) %>
|
chris@344
|
33 <% end %>
|
chris@344
|
34
|
chris@344
|
35 <dl>
|
chris@344
|
36 <% events.sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
|
chris@344
|
37 <dt class="<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
|
chris@344
|
38 <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
|
chris@344
|
39 <span class="time"><%= format_time(e.event_datetime) %></span>
|
chris@344
|
40 <%= content_tag('span', link_to_project(e.project), :class => 'project') if @project.nil? || @project != e.project %>
|
chris@344
|
41 <% if e.respond_to?(:event_author) %>
|
chris@344
|
42 <span class="author"><%= e.event_author %></span>
|
chris@344
|
43 <% end %>
|
chris@344
|
44 </dt>
|
chris@344
|
45 <dd><%= link_to format_activity_title(e.event_title), e.event_url %>
|
chris@344
|
46 <span class="description"><%= format_activity_description(e.event_description) %></span>
|
chris@344
|
47 </dd>
|
chris@344
|
48 <% end -%>
|
chris@344
|
49 </dl>
|
chris@344
|
50
|
chris@344
|
51 </div>
|
chris@344
|
52
|
chris@344
|
53 <% end %>
|
chris@344
|
54
|
chris@344
|
55 <% if events.empty? and @project.nil? %></div><% end %>
|
chris@344
|
56
|
chris@344
|
57 </div>
|