diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a1d989e25..df976fc74 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1275,7 +1275,11 @@ 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', :mention => true) if u + css_classes = ['user-mention'] + if u && obj && !obj.visible?(u) + css_classes += ['no-view-mentioned-user'] + end + link = link_to_user(u, :only_path => only_path, :class => css_classes.join(' '), :mention => true) if u end end (leading + (link || "#{project_prefix}#{prefix}#{repo_prefix}#{sep}#{identifier}#{comment_suffix}")) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index f8e11b050..405b49011 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -159,6 +159,9 @@ a.user.user-mention { padding: 0.1em 0.1em; border-radius: 0.1em; } +a.user.user-mention.no-view-mentioned-user { + background-color: #F3EDD1; +} #sidebar a.selected {line-height:1.7em; padding:1px 3px 2px 2px; margin-left:-2px; background-color:#9DB9D5; color:#fff; border-radius:2px;} #sidebar a.selected:hover {text-decoration:none;}