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

![user-tooltip](/uploads/501b7d1b2a5e6adcadefbc56b08422ec/user-tooltip.png)

![group-tooltip](/uploads/0152a452f9a1ed9fc86101b242f7e4c2/group-tooltip.png)


See merge request !5261
This commit is contained in:
Douwe Maan 2016-07-15 23:02:52 +00:00
commit 8ab8d3e3f0
2 changed files with 6 additions and 5 deletions

View File

@ -23,6 +23,7 @@ v 8.10.0 (unreleased)
- Add Sidekiq queue duration to transaction metrics.
- Add a new column `artifacts_size` to table `ci_builds` !4964
- Let Workhorse serve format-patch diffs
- Display tooltip for mentioned users and groups !5261 (winniehell)
- Added day name to contribution calendar tooltips
- Make images fit to the size of the viewport !4810
- Fix check for New Branch button on Issue page !4630 (winniehell)

View File

@ -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