Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Update the look of activity items

Mir Bhatia512e1bcbd2d3
diff --git a/app/models/activities/work_package_activity_provider.rb b/app/models/activities/work_package_activity_provider.rb
index ecad705b34c..43e0bb90a92 100644
--- a/app/models/activities/work_package_activity_provider.rb
+++ b/app/models/activities/work_package_activity_provider.rb
@@ -47,7 +47,6 @@ class Activities::WorkPackageActivityProvider < Activities::BaseActivityProvider
def self.work_package_title(id, subject, type_name, status_name, is_standard)
title = "#{is_standard ? '' : type_name.to_s} ##{id}: #{subject}"
- title << " (#{status_name})" if status_name.present?
end
protected
diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb
index 21c60bf99af..8e4af679e92 100644
--- a/app/views/activities/index.html.erb
+++ b/app/views/activities/index.html.erb
@@ -37,33 +37,30 @@ See COPYRIGHT and LICENSE files for more details.
<% @events_by_day.keys.sort.reverse.each do |day| %>
<h3 class="op-project-activity-days--header"><%= format_activity_day(day) %></h3>
<ul class="op-project-activity-list">
- <% @events_by_day[day].sort { |x, y| y.event_datetime <=> x.event_datetime }.each_with_index do |e, index| -%>
+ <% @events_by_day[day].sort { |x, y| y.event_datetime <=> x.event_datetime }.each do |e| -%>
<% journal = @journals_by_id[e.event_id] %>
<li class="op-project-activity-list--item">
<div class="op-project-activity-list--item-title">
<%= link_to format_activity_title(e.event_title), e.event_path%>
- <%# <% if (@project.nil? || @project != e.project) && e.project %>
- (Project: <%= content_tag('span', link_to(e.project.name, e.project), class: 'project') %>)
- <%# <% end %>
+ (Project: <%= content_tag('span', link_to(e.project.name, e.project), class: 'project') %>)
</div>
<div class="op-project-activity-list--item-subtitle">
- <%# => Update colour to grey/silver? %>
- updated by <%= avatar(e.event_author, size: 'mini') if e.respond_to?(:event_author) %> <span class="spot-caption spot-caption_bold"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span> on <%= format_time(e.event_datetime.to_time, true) %>
+ <%= e.journal.initial? ? "created by" : "updated by" %> <%= avatar(e.event_author, size: 'mini') if e.respond_to?(:event_author) %> <span class="spot-caption spot-caption_bold"><%= link_to_user(e.event_author) if e.respond_to?(:event_author) %></span> on <%= format_time(e.event_datetime.to_time, true) %>
</div>
-
<% if e.event_description.present? -%>
<div class="op-project-activity-list--item-description">
<%= truncate_formatted_text(e.event_description) %>
</div>
<% end -%>
-
- <% if journal.details.any? -%>
- <ul class="op-project-activity-list--item-details">
- <% journal.details.each do |detail| -%>
- <li class="op-project-activity-list--item-detail"><%= journal.render_detail(detail) %></li>
- <% end -%>
- </ul>
+ <% unless e.journal.initial? %>
+ <% if journal.details.any? -%>
+ <ul class="op-project-activity-list--item-details">
+ <% journal.details.each do |detail| -%>
+ <li class="op-project-activity-list--item-detail"><%= journal.render_detail(detail) %></li>
+ <% end -%>
+ </ul>
+ <% end -%>
<% end -%>
</li>
diff --git a/modules/avatars/app/helpers/avatar_helper.rb b/modules/avatars/app/helpers/avatar_helper.rb
index ccde2b2cf35..0b079c817ba 100644
--- a/modules/avatars/app/helpers/avatar_helper.rb
+++ b/modules/avatars/app/helpers/avatar_helper.rb
@@ -45,8 +45,8 @@ module AvatarHelper
# Returns the avatar image tag for the given +user+ if avatars are enabled
# +user+ can be a User or a string that will be scanned for an email address (eg. 'joe <[email protected]>')
- def avatar(principal, options = {})
- build_principal_avatar_tag principal, options
+ def avatar(principal, size: 'default', hide_name: true, **options)
+ build_principal_avatar_tag principal, size:, hide_name:, **options
rescue StandardError => e
Rails.logger.error "Failed to create avatar for #{principal}: #{e}"
''.html_safe
@@ -89,8 +89,8 @@ module AvatarHelper
gravatar_image_url(mail, opts)
end
- def build_principal_avatar_tag(user, options = {})
- tag_options = merge_default_avatar_options(user, options)
+ def build_principal_avatar_tag(user, **options)
+ tag_options = merge_default_avatar_options(user, **options)
principal_type = API::V3::Principals::PrincipalType.for(user)
principal = {