Merge branch 'show-cross-project-ref' into 'master'

Show cross project ref

Fixes #1661

See merge request !1292
This commit is contained in:
Dmitriy Zaporozhets 2014-12-03 11:02:34 +00:00
commit ac04665a8c
4 changed files with 25 additions and 0 deletions

View file

@ -113,6 +113,11 @@
padding: 10px 15px;
}
.cross-project-ref {
float: left;
padding: 10px 15px;
}
.creator {
float: right;
padding: 10px 15px;

View file

@ -254,4 +254,16 @@ module GitlabMarkdownHelper
truncated
end
end
def cross_project_reference(project, entity)
path = project.path_with_namespace
if entity.kind_of?(Issue)
[path, entity.iid].join('#')
elsif entity.kind_of?(MergeRequest)
[path, entity.iid].join('!')
else
raise 'Not supported type'
end
end
end

View file

@ -38,6 +38,10 @@
- else
Open
.cross-project-ref
%i.fa.fa-link.has_tooltip{:"data-original-title" => 'Cross-project reference'}
= cross_project_reference(@project, @issue)
.creator
Created by #{link_to_member(@project, @issue.author)} #{issue_timestamp(@issue)}

View file

@ -8,6 +8,10 @@
- else
Open
.cross-project-ref
%i.fa.fa-link.has_tooltip{:"data-original-title" => 'Cross-project reference'}
= cross_project_reference(@project, @merge_request)
.creator
Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)}