summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-10-20 12:56:01 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-12-03 11:15:00 +0200
commitba51a1dd328c453927d390147f5fa4be3e1f6fe7 (patch)
tree774b13c096585e946b4ed64deb1becad6ff504c2
parentbf39347970865bcd97e5370c7a754406498a2d65 (diff)
downloadgitlab-ce-ba51a1dd328c453927d390147f5fa4be3e1f6fe7.tar.gz
Render cross reference in issue title
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
-rw-r--r--app/assets/stylesheets/generic/issue_box.scss5
-rw-r--r--app/helpers/gitlab_markdown_helper.rb12
-rw-r--r--app/views/projects/issues/show.html.haml3
3 files changed, 20 insertions, 0 deletions
diff --git a/app/assets/stylesheets/generic/issue_box.scss b/app/assets/stylesheets/generic/issue_box.scss
index 94149594e24..79fbad4b946 100644
--- a/app/assets/stylesheets/generic/issue_box.scss
+++ b/app/assets/stylesheets/generic/issue_box.scss
@@ -113,6 +113,11 @@
padding: 10px 15px;
}
+ .cross-project-ref {
+ float: left;
+ padding: 10px 15px;
+ }
+
.creator {
float: right;
padding: 10px 15px;
diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb
index 7d3cb749829..800cacdc2c2 100644
--- a/app/helpers/gitlab_markdown_helper.rb
+++ b/app/helpers/gitlab_markdown_helper.rb
@@ -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
diff --git a/app/views/projects/issues/show.html.haml b/app/views/projects/issues/show.html.haml
index aad58e48f6c..685d9f96d51 100644
--- a/app/views/projects/issues/show.html.haml
+++ b/app/views/projects/issues/show.html.haml
@@ -38,6 +38,9 @@
- else
Open
+ .cross-project-ref
+ = cross_project_reference(@project, @issue)
+
.creator
Created by #{link_to_member(@project, @issue.author)} #{issue_timestamp(@issue)}