To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / plugins / redmine_bibliography / app / views / activities / _recent.html.erb @ 1432:ebda59ca84db
History | View | Annotate | Download (2.86 KB)
| 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|
|
| 16 |
|
| 17 |
if e.class != Publication
|
| 18 |
user.member_of? e.project
|
| 19 |
else
|
| 20 |
e.projects.map {|p| user.member_of? p }.any?
|
| 21 |
end
|
| 22 |
}
|
| 23 |
|
| 24 |
end
|
| 25 |
|
| 26 |
events = events.first(max)
|
| 27 |
|
| 28 |
end
|
| 29 |
%>
|
| 30 |
|
| 31 |
<div id="activity"> |
| 32 |
|
| 33 |
<% if @project.nil? %>
|
| 34 |
<%= content_tag('h3', l(:label_activity_my_recent)) %>
|
| 35 |
<div class="activity box"> |
| 36 |
<% end %>
|
| 37 |
|
| 38 |
<% if events.empty? %>
|
| 39 |
|
| 40 |
<% if @project.nil? %>
|
| 41 |
<div class="tip"><%= l(:label_activity_my_recent_none) %></div> |
| 42 |
<% end %>
|
| 43 |
|
| 44 |
<% else %>
|
| 45 |
|
| 46 |
<% if !@project.nil? %>
|
| 47 |
<div class="activity box"> |
| 48 |
<%= content_tag('h3', l(:label_activity_recent)) %>
|
| 49 |
<% end %>
|
| 50 |
|
| 51 |
<dl>
|
| 52 |
<% events.sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
|
| 53 |
<%- if e.class != Publication -%>
|
| 54 |
<dt class="<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> |
| 55 |
<%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %>
|
| 56 |
<span class="time"><%= format_time(e.event_datetime) %></span> |
| 57 |
<%= content_tag('span', link_to_project(e.project), :class => 'project') if @project.nil? || @project != e.project %>
|
| 58 |
<% if e.respond_to?(:event_author) %>
|
| 59 |
<span class="author"><%= e.event_author %></span> |
| 60 |
<% end %>
|
| 61 |
</dt>
|
| 62 |
<dd><%= link_to format_activity_title(e.event_title), e.event_url %> |
| 63 |
<span class="description"><%= format_activity_description(e.event_description) %></span> |
| 64 |
</dd>
|
| 65 |
<% else -%>
|
| 66 |
<dt class="<%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>"> |
| 67 |
<span class="time"><%= format_time(e.event_datetime) %></span> |
| 68 |
<%= link_to format_activity_title(e.event_title), e.event_url %>
|
| 69 |
was added to the following |
| 70 |
<% if e.projects.count > 1 %>
|
| 71 |
projects: |
| 72 |
<%- else -%>
|
| 73 |
project: |
| 74 |
<%- end -%>
|
| 75 |
<%= content_tag('span', e.projects.join(', ')) -%> <% if e.respond_to?(:event_author) %> |
| 76 |
<span class="author"><%= e.event_author %></span> |
| 77 |
<% end %>
|
| 78 |
</dt>
|
| 79 |
<dd><%= link_to format_activity_title(e.event_title), e.event_url %> |
| 80 |
<span class="description"><%= format_activity_description(e.event_description) %></span> |
| 81 |
</dd>
|
| 82 |
<% end -%>
|
| 83 |
<% end -%>
|
| 84 |
</dl>
|
| 85 |
|
| 86 |
</div>
|
| 87 |
|
| 88 |
<% end %>
|
| 89 |
|
| 90 |
<% if events.empty? and @project.nil? %></div><% end %> |
| 91 |
|
| 92 |
</div>
|