Commit 6c949b2b authored by Phil Hughes's avatar Phil Hughes Committed by Jacob Schatz

Moved meta information into an issuable helper method

parent 60bb7007
......@@ -55,6 +55,17 @@ module IssuablesHelper
h(milestone_title.presence || default_label)
end
def issuable_meta(issuable, project, text)
output = content_tag :strong, "#{text} #{issuable.to_reference}", class: "identifier"
output << " opened "
output << time_ago_with_tooltip(issuable.created_at)
output << " by "
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, by_username: true, avatar: false, mobile_classes: "hidden-sm hidden-md hidden-lg")
end
end
private
def sidebar_gutter_collapsed?
......
......@@ -18,14 +18,7 @@
.issuable-meta
= confidential_icon(@issue)
%strong.identifier
Issue #{@issue.to_reference}
opened
= time_ago_with_tooltip(@issue.created_at)
by
%strong
= link_to_member(@project, @issue.author, size: 24, mobile_classes: "hidden-xs")
= link_to_member(@project, @issue.author, size: 24, by_username: true, avatar: false, mobile_classes: "hidden-sm hidden-md hidden-lg")
= issuable_meta(@issue, @project, "Issue")
.issuable-actions
.clearfix.issue-btn-group.dropdown
......
......@@ -9,14 +9,7 @@
= icon('angle-double-left')
.issuable-meta
%strong.identifier
Merge Request #{@merge_request.to_reference}
opened
= time_ago_with_tooltip(@merge_request.created_at)
by
%strong
= link_to_member(@project, @merge_request.author, size: 24, mobile_classes: "hidden-xs")
= link_to_member(@project, @merge_request.author, size: 24, mobile_classes: "hidden-sm hidden-md hidden-lg", by_username: true, avatar: false)
= issuable_meta(@merge_request, @project, "Merge Request")
- if can?(current_user, :update_merge_request, @merge_request)
.issuable-actions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment