summaryrefslogtreecommitdiff
path: root/app/helpers/projects_helper.rb
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-07-12 15:46:28 +0100
committerPhil Hughes <me@iamphill.com>2016-07-12 15:46:28 +0100
commitda42b1bb5345ce8b890b1d27bc3a62d339323c84 (patch)
tree46f9f2ee8b961ca64d1ed4417391731a47ac0b75 /app/helpers/projects_helper.rb
parent850bb6db2facf570a7e0933bbf555f764aeac601 (diff)
downloadgitlab-ce-da42b1bb5345ce8b890b1d27bc3a62d339323c84.tar.gz
Added author username tooltip in issuable header
Closes #13771
Diffstat (limited to 'app/helpers/projects_helper.rb')
-rw-r--r--app/helpers/projects_helper.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb
index 3bbbb26cff2..e64aa56d5e4 100644
--- a/app/helpers/projects_helper.rb
+++ b/app/helpers/projects_helper.rb
@@ -19,7 +19,7 @@ module ProjectsHelper
end
def link_to_member(project, author, opts = {}, &block)
- default_opts = { avatar: true, name: true, size: 16, author_class: 'author', title: ":name" }
+ default_opts = { avatar: true, name: true, size: 16, author_class: 'author', title: ":name", tooltip: false }
opts = default_opts.merge(opts)
return "(deleted)" unless author
@@ -33,7 +33,9 @@ module ProjectsHelper
if opts[:by_username]
author_html << content_tag(:span, sanitize("@#{author.username}"), class: opts[:author_class]) if opts[:name]
else
- author_html << content_tag(:span, sanitize(author.name), class: opts[:author_class]) if opts[:name]
+ tooltip_data = { placement: 'top' }
+ author_html << content_tag(:span, sanitize(author.name), class: [opts[:author_class], ('has-tooltip' if opts[:tooltip])],
+ title: (author.to_reference if opts[:tooltip]), data: (tooltip_data if opts[:tooltip])) if opts[:name]
end
author_html << capture(&block) if block