To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / activities / _recent.rhtml @ 443:350acce374a2
History | View | Annotate | Download (1.84 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 | 379:f25c73364bfb | Chris | |
| 6 | 361:30f68ecfdde4 | chris | 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 | 379:f25c73364bfb | Chris | |
| 12 | 378:c80fd1ef305f | chris | events = activity.events(Date.today - 28, Date.today + 1)
|
| 13 | 379:f25c73364bfb | Chris | |
| 14 | 378:c80fd1ef305f | chris | if defined? user
|
| 15 | events = events.select { |e| user.member_of? e.project }
|
||
| 16 | end
|
||
| 17 | 379:f25c73364bfb | Chris | |
| 18 | 378:c80fd1ef305f | chris | events = events.first(max)
|
| 19 | 361:30f68ecfdde4 | chris | |
| 20 | 344:1a514b9347d4 | chris | 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> |