Render cross reference in issue title

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-10-20 12:56:01 +03:00
parent bf39347970
commit ba51a1dd32
3 changed files with 20 additions and 0 deletions

View file

@ -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;

View file

@ -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

View file

@ -38,6 +38,9 @@
- else - else
Open Open
.cross-project-ref
= 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)}