diff options
author | Marius Balteanu <marius.balteanu@zitec.com> | 2022-03-19 10:00:30 +0000 |
---|---|---|
committer | Marius Balteanu <marius.balteanu@zitec.com> | 2022-03-19 10:00:30 +0000 |
commit | 23874fa913c62f7da23f2d1fab6e5e1a445ae290 (patch) | |
tree | c446adf4e17ce15645637f746b0655e9334aa1ad /app | |
parent | f286a6044be49b88b067f89072618aecc7164caa (diff) | |
download | redmine-23874fa913c62f7da23f2d1fab6e5e1a445ae290.tar.gz redmine-23874fa913c62f7da23f2d1fab6e5e1a445ae290.zip |
Render mentioned users with leading @ and highlight (#36699, #13919).
git-svn-id: http://svn.redmine.org/redmine/trunk@21468 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/application_helper.rb | 3 |
1 files changed, 2 insertions, 1 deletions
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}")) |