# HG changeset patch # User luisf # Date 1353693231 0 # Node ID a9311b2d850f1cd89fa542ca84441df0966f6a75 # Parent 74407a04925ca5eec1aaf8d24ba16bc9030cbf96 Overrides activities controller _recent.html.erb view (so that it displays a publication in the my page). diff -r 74407a04925c -r a9311b2d850f vendor/plugins/redmine_bibliography/app/views/activities/_recent.html.erb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vendor/plugins/redmine_bibliography/app/views/activities/_recent.html.erb Fri Nov 23 17:53:51 2012 +0000 @@ -0,0 +1,92 @@ +<% events = @events_by_day %> +<% max = 5 %> +<% if (events.nil?) + activity = Redmine::Activity::Fetcher.new(User.current, :project => @project) + + if @project + # Don't show news (duplicated with News box) or wiki edits (too + # tedious) in project front page + activity.scope = [ "changesets", "files", "issues", "documents" ] + end + + events = activity.events(Date.today - 28, Date.today + 1) + + if defined? user + events = events.select { |e| + + if e.class != Publication + user.member_of? e.project + else + e.projects.map {|p| user.member_of? p } + end + } + + end + + events = events.first(max) + + end +%> + +
+ +<% if @project.nil? %> + <%= content_tag('h3', l(:label_activity_my_recent)) %> +
+<% end %> + +<% if events.empty? %> + + <% if @project.nil? %> +

<%= l(:label_activity_my_recent_none) %>

+ <% end %> + +<% else %> + + <% if !@project.nil? %> +
+ <%= content_tag('h3', l(:label_activity_recent)) %> + <% end %> + +
+ <% events.sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%> + <%- if e.class != Publication -%> +
+ <%= avatar(e.event_author, :size => "24") if e.respond_to?(:event_author) %> + <%= format_time(e.event_datetime) %> + <%= content_tag('span', link_to_project(e.project), :class => 'project') if @project.nil? || @project != e.project %> + <% if e.respond_to?(:event_author) %> + <%= e.event_author %> + <% end %> +
+
<%= link_to format_activity_title(e.event_title), e.event_url %> + <%= format_activity_description(e.event_description) %> +
+ <% else -%> +
+ <%= format_time(e.event_datetime) %> + <%= link_to format_activity_title(e.event_title), e.event_url %> + was added to the following + <% if e.projects.count > 1 %> + projects: + <%- else -%> + project: + <%- end -%> + <%= content_tag('span', e.projects.join(', ')) -%> <% if e.respond_to?(:event_author) %> + <%= e.event_author %> + <% end %> +
+
<%= link_to format_activity_title(e.event_title), e.event_url %> + <%= format_activity_description(e.event_description) %> +
+ <% end -%> + <% end -%> +
+ +
+ +<% end %> + +<% if events.empty? and @project.nil? %>
<% end %> + +