Hide correct author info in header of issuable.
This commit is contained in:
parent
2feb9eb1f0
commit
d913febf0f
2 changed files with 10 additions and 4 deletions
|
@ -38,12 +38,16 @@ module ProjectsHelper
|
||||||
author_html << image_tag(avatar_icon(author, opts[:size]), width: opts[:size], class: "avatar avatar-inline #{"s#{opts[:size]}" if opts[:size]}", alt:'') if opts[:avatar]
|
author_html << image_tag(avatar_icon(author, opts[:size]), width: opts[:size], class: "avatar avatar-inline #{"s#{opts[:size]}" if opts[:size]}", alt:'') if opts[:avatar]
|
||||||
|
|
||||||
# Build name span tag
|
# Build name span tag
|
||||||
author_html << content_tag(:span, sanitize(author.name), class: opts[:author_class]) if opts[:name]
|
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]
|
||||||
|
end
|
||||||
|
|
||||||
author_html = author_html.html_safe
|
author_html = author_html.html_safe
|
||||||
|
|
||||||
if opts[:name]
|
if opts[:name]
|
||||||
link_to(author_html, user_path(author), class: "author_link").html_safe
|
link_to(author_html, user_path(author), class: "author_link #{"#{opts[:mobile_classes]}" if opts[:mobile_classes]}").html_safe
|
||||||
else
|
else
|
||||||
title = opts[:title].sub(":name", sanitize(author.name))
|
title = opts[:title].sub(":name", sanitize(author.name))
|
||||||
link_to(author_html, user_path(author), class: "author_link has_tooltip", data: { 'original-title'.to_sym => title, container: 'body' } ).html_safe
|
link_to(author_html, user_path(author), class: "author_link has_tooltip", data: { 'original-title'.to_sym => title, container: 'body' } ).html_safe
|
||||||
|
|
|
@ -9,8 +9,10 @@
|
||||||
Merge Request #{@merge_request.to_reference}
|
Merge Request #{@merge_request.to_reference}
|
||||||
%span.creator
|
%span.creator
|
||||||
·
|
·
|
||||||
by #{link_to_member(@project, @merge_request.author, size: 24)}
|
by
|
||||||
= '@' + @merge_request.author.username
|
=link_to_member(@project, @merge_request.author, size: 24, mobile_classes: "hidden-xs")
|
||||||
|
=link_to_member(@project, @merge_request.author, size: 24,
|
||||||
|
by_username: true, avatar: false)
|
||||||
·
|
·
|
||||||
= time_ago_with_tooltip(@merge_request.created_at)
|
= time_ago_with_tooltip(@merge_request.created_at)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue