diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-07-14 13:30:23 +0000 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-07-14 13:30:23 +0000 |
commit | bc7fd405dc7b0a36808c093332016e54f047699e (patch) | |
tree | 40f0dcb0f95bfb159512deb2484328c6b8195459 /app | |
parent | e2afc1f76fce4c29901cff3a9d71577d26d80ae9 (diff) | |
parent | c826b7c3e52caee88de3e2320bb9f3b095b29f64 (diff) | |
download | gitlab-ce-bc7fd405dc7b0a36808c093332016e54f047699e.tar.gz |
Merge branch 'issuable-author-tooltip' into 'master'
Added author username tooltip in issuable header
## What does this MR do?
Adds the authors username as a tooltip to the header of issuables
## What are the relevant issue numbers?
Closes #13771
## Screenshots (if relevant)
![Screen_Shot_2016-07-12_at_16.00.34](/uploads/9485150f1c9d4006384f18d08a07430f/Screen_Shot_2016-07-12_at_16.00.34.png)
See merge request !5209
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/issuables_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/projects_helper.rb | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/app/helpers/issuables_helper.rb b/app/helpers/issuables_helper.rb index 294b7e92b8d..47d174361db 100644 --- a/app/helpers/issuables_helper.rb +++ b/app/helpers/issuables_helper.rb @@ -61,7 +61,7 @@ module IssuablesHelper output = content_tag :strong, "#{text} #{issuable.to_reference}", class: "identifier" output << " opened #{time_ago_with_tooltip(issuable.created_at)} by ".html_safe output << content_tag(:strong) do - author_output = link_to_member(project, issuable.author, size: 24, mobile_classes: "hidden-xs") + author_output = link_to_member(project, issuable.author, size: 24, mobile_classes: "hidden-xs", tooltip: true) author_output << link_to_member(project, issuable.author, size: 24, by_username: true, avatar: false, mobile_classes: "hidden-sm hidden-md hidden-lg") end end diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 3bbbb26cff2..df5090327af 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,8 @@ 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 |