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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
[#59925] Provide some comments
Tobias Dillmann19b50972564e
diff --git a/lib/open_project/object_linking.rb b/lib/open_project/object_linking.rbindex 88be7de82d7..09583706038 100644--- a/lib/open_project/object_linking.rb+++ b/lib/open_project/object_linking.rb@@ -42,6 +42,7 @@ module OpenProjectend# Displays a link to user's account page if active or registered+ # Will attach a user hover card to the link.def link_to_user(user, options = {})return h(user.to_s) unless user.is_a?(User)return h(user.name) if user.locked? && !User.current.admin?@@ -127,6 +128,7 @@ module OpenProjectend.html_safeend+ # Like #link_to_user, but will render a Primer link instead of a regular link.def primer_link_to_user(user, options = {})options[:href] ||= user_path(user)options[:target] ||= "_blank"@@ -141,7 +143,9 @@ module OpenProjectprivate- # TODO: doc comment+ # Accepts a user and an options hash. Will apply a hover card config for the user to the options hash.+ # Will not do anything if `hover_card` is set to false within the options.+ # You can use this method if you want to render a link and apply a user hover card to it.def add_hover_card_options(user, options, only_path: true, clazz_key: :classes)if options.delete(:hover_card) { true }options[clazz_key] = [options[clazz_key], "op-hover-card--preview-trigger"].compact.join(" ")