]> source.dussan.org Git - redmine.git/commitdiff
Render activities block on UsersController#show grouped and with event_type icon...
authorGo MAEDA <maeda@farend.jp>
Mon, 25 Dec 2017 04:38:07 +0000 (04:38 +0000)
committerGo MAEDA <maeda@farend.jp>
Mon, 25 Dec 2017 04:38:07 +0000 (04:38 +0000)
Patch by Mischa The Evil.

git-svn-id: http://svn.redmine.org/redmine/trunk@17128 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/users_controller.rb
app/views/users/show.html.erb

index 653a37666d16d1f0f9bdd2d451ae8a7b6e68b5bc..04d9a78ada2839dd9dd2731b0c4e655068769a81 100644 (file)
@@ -29,6 +29,8 @@ class UsersController < ApplicationController
   helper :custom_fields
   include CustomFieldsHelper
   helper :principal_memberships
+  helper :activities
+  include ActivitiesHelper
 
   require_sudo_mode :create, :update, :destroy
 
index 6d231b86d80f6aa068185b7daa5649a23f4e98c1..943ee3821319015c78b77942c568b9eb4b150204 100644 (file)
 <% @events_by_day.keys.sort.reverse.each do |day| %>
 <h4><%= format_activity_day(day) %></h4>
 <dl>
-<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
-  <dt class="<%= e.event_type %>">
+<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
+  <dt class="<%= e.event_type %> icon icon-<%= e.event_type %> <%= "grouped" if in_group %> <%= User.current.logged? && e.respond_to?(:event_author) && User.current == e.event_author ? 'me' : nil %>">
   <span class="time"><%= format_time(e.event_datetime, false) %></span>
   <%= content_tag('span', e.project, :class => 'project') %>
   <%= link_to format_activity_title(e.event_title), e.event_url %></dt>
-  <dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd>
+  <dd class="<%= "grouped" if in_group %>"><span class="description"><%= format_activity_description(e.event_description) %></span>
 <% end -%>
 </dl>
 <% end -%>