Commit ac04665a authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

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

Show cross project ref

Fixes #1661

See merge request !1292
parents 03d1ee17 ed1c2256
...@@ -113,6 +113,11 @@ ...@@ -113,6 +113,11 @@
padding: 10px 15px; padding: 10px 15px;
} }
.cross-project-ref {
float: left;
padding: 10px 15px;
}
.creator { .creator {
float: right; float: right;
padding: 10px 15px; padding: 10px 15px;
......
...@@ -254,4 +254,16 @@ module GitlabMarkdownHelper ...@@ -254,4 +254,16 @@ module GitlabMarkdownHelper
truncated truncated
end end
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 end
...@@ -38,6 +38,10 @@ ...@@ -38,6 +38,10 @@
- else - else
Open Open
.cross-project-ref
%i.fa.fa-link.has_tooltip{:"data-original-title" => 'Cross-project reference'}
= cross_project_reference(@project, @issue)
.creator .creator
Created by #{link_to_member(@project, @issue.author)} #{issue_timestamp(@issue)} Created by #{link_to_member(@project, @issue.author)} #{issue_timestamp(@issue)}
......
...@@ -8,6 +8,10 @@ ...@@ -8,6 +8,10 @@
- else - else
Open Open
.cross-project-ref
%i.fa.fa-link.has_tooltip{:"data-original-title" => 'Cross-project reference'}
= cross_project_reference(@project, @merge_request)
.creator .creator
Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)} Created by #{link_to_member(@project, @merge_request.author)} #{time_ago_with_tooltip(@merge_request.created_at)}
......
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