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

[#59925] show hover card for user links

Tobias Dillmann3f1dfed4b21b
diff --git a/lib/open_project/object_linking.rb b/lib/open_project/object_linking.rb
index d30875dca95..037349d338f 100644
--- a/lib/open_project/object_linking.rb
+++ b/lib/open_project/object_linking.rb
@@ -49,6 +49,13 @@ module OpenProject
only_path: options.delete(:only_path) { true })
options[:title] ||= I18n.t(:label_user_named, name:)
+ if options.delete(:hover_card) { true }
+ options[:data] ||= {}
+ options[:data][:hover_card_url] = hover_card_user_path(user)
+
+ options[:class] = [options[:class], "op-hover-card--preview-trigger"].compact.join(" ")
+ end
+
link_to(name, href, options)
else
h(user.to_s)