summaryrefslogtreecommitdiff
path: root/app/helpers/gitlab_routing_helper.rb
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-10-14 03:33:49 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-10-14 03:33:49 +0800
commit29a6f0d28ba4ca6c44b63d0ece2eff4416fb73e0 (patch)
treed296b4deeec0c51c4b1bf07fee45508125d5782f /app/helpers/gitlab_routing_helper.rb
parent36aea928a407376787a961bbc03ca3946a55902b (diff)
downloadgitlab-ce-29a6f0d28ba4ca6c44b63d0ece2eff4416fb73e0.tar.gz
Introduce more GitLab routing helpers, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6019#note_16852207
Diffstat (limited to 'app/helpers/gitlab_routing_helper.rb')
-rw-r--r--app/helpers/gitlab_routing_helper.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb
index 670a7ca36f4..f9c3d3f270f 100644
--- a/app/helpers/gitlab_routing_helper.rb
+++ b/app/helpers/gitlab_routing_helper.rb
@@ -94,6 +94,38 @@ module GitlabRoutingHelper
namespace_project_merge_request_url(entity.project.namespace, entity.project, entity, *args)
end
+ def pipeline_url(pipeline, *args)
+ namespace_project_pipeline_url(
+ pipeline.project.namespace,
+ pipeline.project,
+ pipeline.id,
+ *args)
+ end
+
+ def pipeline_build_url(pipeline, build, *args)
+ namespace_project_build_url(
+ pipeline.project.namespace,
+ pipeline.project,
+ build.id,
+ *args)
+ end
+
+ def commits_url(entity, *args)
+ namespace_project_commits_url(
+ entity.project.namespace,
+ entity.project,
+ entity.ref,
+ *args)
+ end
+
+ def commit_url(entity, *args)
+ namespace_project_commit_url(
+ entity.project.namespace,
+ entity.project,
+ entity.sha,
+ *args)
+ end
+
def project_snippet_url(entity, *args)
namespace_project_snippet_url(entity.project.namespace, entity.project, entity, *args)
end