diff options
| author | Douwe Maan <douwe@gitlab.com> | 2016-07-15 23:02:52 +0000 |
|---|---|---|
| committer | Douwe Maan <douwe@gitlab.com> | 2016-07-15 23:02:52 +0000 |
| commit | 8ab8d3e3f03083e70c814c40b91816c7d4947abf (patch) | |
| tree | e3557de9791817cdfa7c4cdb038597a094fd2db8 /lib/banzai | |
| parent | fbd75c35fd3fd43f6680b925959ac9498e9528a5 (diff) | |
| parent | 01ff8ae5df7e00db16aa64f056098626b8ae795b (diff) | |
| download | gitlab-ce-8ab8d3e3f03083e70c814c40b91816c7d4947abf.tar.gz | |
Merge branch 'mentioned-user-tooltip' into 'master'
Display tooltip for mentioned users and groups
## What does this MR do?
Display tooltip for mentioned users and groups in Markdown.
## Are there points in the code the reviewer needs to double check?
I don't know.
## Why was this MR needed?
No tooltips were displayed.
## What are the relevant issue numbers?
fixes #17060
## Screenshots


See merge request !5261
Diffstat (limited to 'lib/banzai')
| -rw-r--r-- | lib/banzai/filter/user_reference_filter.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/banzai/filter/user_reference_filter.rb b/lib/banzai/filter/user_reference_filter.rb index 5b0a6d8541b..e1ca7f4d24b 100644 --- a/lib/banzai/filter/user_reference_filter.rb +++ b/lib/banzai/filter/user_reference_filter.rb @@ -112,7 +112,7 @@ module Banzai data = data_attribute(project: project.id, author: author.try(:id)) text = link_text || User.reference_prefix + 'all' - link_tag(url, data, text) + link_tag(url, data, text, 'All Project and Group Members') end def link_to_namespace(namespace, link_text: nil) @@ -128,7 +128,7 @@ module Banzai data = data_attribute(group: namespace.id) text = link_text || Group.reference_prefix + group - link_tag(url, data, text) + link_tag(url, data, text, namespace.name) end def link_to_user(user, namespace, link_text: nil) @@ -136,11 +136,11 @@ module Banzai data = data_attribute(user: namespace.owner_id) text = link_text || User.reference_prefix + user - link_tag(url, data, text) + link_tag(url, data, text, namespace.owner_name) end - def link_tag(url, data, text) - %(<a href="#{url}" #{data} class="#{link_class}">#{escape_once(text)}</a>) + def link_tag(url, data, text, title) + %(<a href="#{url}" #{data} class="#{link_class}" title="#{escape_once(title)}">#{escape_once(text)}</a>) end end end |
