diff options
author | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-02-29 15:43:57 -0500 |
---|---|---|
committer | Jacob Schatz <jacobschatz@Jacobs-MBP.fios-router.home> | 2016-03-04 09:06:57 -0500 |
commit | d913febf0fd120efefdda6668ea73e02f3f6db50 (patch) | |
tree | 705ca11cff1977b9de804570536072fda3cc3dbe | |
parent | 2feb9eb1f0563e7a97bc4f54448200983a842733 (diff) | |
download | gitlab-ce-d913febf0fd120efefdda6668ea73e02f3f6db50.tar.gz |
Hide correct author info in header of issuable.
-rw-r--r-- | app/helpers/projects_helper.rb | 8 | ||||
-rw-r--r-- | app/views/projects/merge_requests/show/_mr_title.html.haml | 6 |
2 files changed, 10 insertions, 4 deletions
diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index d6fb629b0c2..c8061fcdc59 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -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] # 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 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 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 diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index fc4ade16299..de305fd1d0a 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -9,8 +9,10 @@ Merge Request #{@merge_request.to_reference} %span.creator · - by #{link_to_member(@project, @merge_request.author, size: 24)} - = '@' + @merge_request.author.username + by + =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) |