changeset 1221:658b403da20a cannam

Merge
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 12 Mar 2013 13:24:19 +0000
parents 875b5b4c574d (current diff) 3286032e15cf (diff)
children 2c59ee348e2b
files
diffstat 3 files changed, 17 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/app/helpers/activities_helper.rb	Tue Mar 12 13:01:36 2013 +0000
+++ b/app/helpers/activities_helper.rb	Tue Mar 12 13:24:19 2013 +0000
@@ -47,9 +47,10 @@
 
     # Return up to count of the user's projects ordered by that user's
     # recent activity, omitting any projects for which no activity
-    # occurred in the recent past
+    # occurred in the recent past and any projects not visible to
+    # the current user
 
-    activity = Redmine::Activity::Fetcher.new(user, :author => user)
+    activity = Redmine::Activity::Fetcher.new(User.current, :author => user)
     days = Setting.activity_days_default.to_i
     events = activity.events(Date.today - days, Date.today + 1)
     projhash = project_activity_on_events(events)
@@ -64,15 +65,20 @@
       u = User.find_by_id(c)
       active_projects = projects_by_activity(u, 3)
       if !active_projects.empty?
-        s << "<div class='user'>"
-        s << link_to_user(u)
-        s << "<span class='institution'>"
-        s << h(u.ssamr_user_detail.institution_name)
+        s << "<div class='active-person'>"
+        s << avatar(u, :size => '24')
+        s << "<span class='user'>"
+        s << h(u.name)
         s << "</span>"
-        s << "</div>"
-        s << "<div class='active'>"
-        s << l(:label_working_in) << " "
+        if !u.ssamr_user_detail.nil?
+          s << " - <span class='institution'>"
+          s << h(u.ssamr_user_detail.institution_name)
+          s << "</span>"
+        end
+        s << "<br>"
+        s << "<span class='active'>"
         s << (active_projects.map { |p| link_to_project(p) }.join ", ")
+        s << "</span>"
         s << "</div>"
       end
     end
--- a/app/views/my/blocks/_colleagues.html.erb	Tue Mar 12 13:01:36 2013 +0000
+++ b/app/views/my/blocks/_colleagues.html.erb	Tue Mar 12 13:24:19 2013 +0000
@@ -3,7 +3,7 @@
 
 <% if !colleagues.empty? %>
   <h3><%=l(:label_my_colleagues)%></h3>
-  <div class="box">
+  <div class="box" id="active-colleagues">
     <%= render_active_colleagues(colleagues) %>
   </div>
 <% end %>
--- a/public/stylesheets/application.css	Tue Mar 12 13:01:36 2013 +0000
+++ b/public/stylesheets/application.css	Tue Mar 12 13:24:19 2013 +0000
@@ -1033,7 +1033,7 @@
     vertical-align: top;
 }
 
-#activity dt img.gravatar, #members dt img.gravatar {
+#activity dt img.gravatar, #members dt img.gravatar, #active-colleagues img.gravatar {
     float: left;
     margin: 0 1em 1em 0;
 }