From 23874fa913c62f7da23f2d1fab6e5e1a445ae290 Mon Sep 17 00:00:00 2001 From: Marius Balteanu Date: Sat, 19 Mar 2022 10:00:30 +0000 Subject: Render mentioned users with leading @ and highlight (#36699, #13919). git-svn-id: http://svn.redmine.org/redmine/trunk@21468 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/application_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app') diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 1d2b09423..1dfa26cb2 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -60,6 +60,7 @@ module ApplicationHelper case principal when User name = h(principal.name(options[:format])) + name = "@" + name if options[:mention] css_classes = '' if principal.active? || (User.current.admin? && principal.logged?) url = user_url(principal, :only_path => only_path) @@ -1265,7 +1266,7 @@ module ApplicationHelper elsif sep == "@" name = remove_double_quotes(identifier) u = User.visible.find_by("LOWER(login) = :s AND type = 'User'", :s => name.downcase) - link = link_to_user(u, :only_path => only_path, :class => 'user-mention') if u + link = link_to_user(u, :only_path => only_path, :class => 'user-mention', :mention => true) if u end end (leading + (link || "#{project_prefix}#{prefix}#{repo_prefix}#{sep}#{identifier}#{comment_suffix}")) -- cgit v1.2.3