Project

General

Profile

Patch #27240 » 0001-Render-activities-block-on-UsersController-show-grou.patch

Mischa The Evil, 2017-10-20 16:17

View differences:

app/controllers/users_controller.rb
29 29
  helper :custom_fields
30 30
  include CustomFieldsHelper
31 31
  helper :principal_memberships
32
  helper :activities
33
  include ActivitiesHelper
32 34

  
33 35
  require_sudo_mode :create, :update, :destroy
34 36

  
app/views/users/show.html.erb
56 56
<% @events_by_day.keys.sort.reverse.each do |day| %>
57 57
<h4><%= format_activity_day(day) %></h4>
58 58
<dl>
59
<% @events_by_day[day].sort {|x,y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
60
  <dt class="<%= e.event_type %>">
59
<% sort_activity_events(@events_by_day[day]).each do |e, in_group| -%>
60
  <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 %>">
61 61
  <span class="time"><%= format_time(e.event_datetime, false) %></span>
62 62
  <%= content_tag('span', e.project, :class => 'project') %>
63 63
  <%= link_to format_activity_title(e.event_title), e.event_url %></dt>
64
  <dd><span class="description"><%= format_activity_description(e.event_description) %></span></dd>
64
  <dd class="<%= "grouped" if in_group %>"><span class="description"><%= format_activity_description(e.event_description) %></span>
65 65
<% end -%>
66 66
</dl>
67 67
<% end -%>
(3-3/3)