Add the group path to the issue ID if applicable

This commit is contained in:
Berna Castro 2016-12-15 13:09:07 +01:00 committed by Oswaldo Ferreira
parent 4e2b9d703f
commit c85c681505
2 changed files with 13 additions and 5 deletions

View File

@ -591,10 +591,18 @@ class Project < ActiveRecord::Base
end
end
def to_reference(from_project = nil, full: false)
if full || cross_namespace_reference?(from_project)
path_with_namespace
elsif cross_project_reference?(from_project)
def to_reference(from_project = nil, from_group = nil)
if from_group.nil?
if cross_namespace_reference?(from_project)
path_with_namespace
elsif cross_project_reference?(from_project)
path
elsif self == from_project
nil
else
path_with_namespace
end
else
path
end
end

View File

@ -34,7 +34,7 @@
= note_count
.issue-info
#{issue.to_reference} &middot;
#{issue.to_reference(@project, @group)} &middot;
opened #{time_ago_with_tooltip(issue.created_at, placement: 'bottom')}
by #{link_to_member(@project, issue.author, avatar: false)}
- if issue.milestone