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