diff options
Diffstat (limited to 'app/helpers/gitlab_routing_helper.rb')
-rw-r--r-- | app/helpers/gitlab_routing_helper.rb | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb index 4474534045b..8a9380f4771 100644 --- a/app/helpers/gitlab_routing_helper.rb +++ b/app/helpers/gitlab_routing_helper.rb @@ -162,8 +162,8 @@ module GitlabRoutingHelper # against the arguments. We can speed this up 10x by generating the strings directly. # /*namespace_id/:project_id/-/jobs/:job_id/artifacts/download(.:format) - def fast_download_project_job_artifacts_path(project, job) - expose_fast_artifacts_path(project, job, :download) + def fast_download_project_job_artifacts_path(project, job, params = {}) + expose_fast_artifacts_path(project, job, :download, params) end # /*namespace_id/:project_id/-/jobs/:job_id/artifacts/keep(.:format) @@ -176,8 +176,13 @@ module GitlabRoutingHelper expose_fast_artifacts_path(project, job, :browse) end - def expose_fast_artifacts_path(project, job, action) + def expose_fast_artifacts_path(project, job, action, params = {}) path = "#{project.full_path}/-/jobs/#{job.id}/artifacts/#{action}" + + unless params.empty? + path += "?#{params.to_query}" + end + Gitlab::Utils.append_path(Gitlab.config.gitlab.relative_url_root, path) end @@ -240,6 +245,14 @@ module GitlabRoutingHelper end end + def gitlab_dashboard_snippets_path(snippet, *args) + if snippet.is_a?(ProjectSnippet) + project_snippets_path(snippet.project, *args) + else + dashboard_snippets_path + end + end + def gitlab_raw_snippet_path(snippet, *args) if snippet.is_a?(ProjectSnippet) raw_project_snippet_path(snippet.project, snippet, *args) @@ -298,6 +311,16 @@ module GitlabRoutingHelper toggle_award_emoji_snippet_url(snippet, *new_args) end + # Wikis + + def wiki_path(wiki, **options) + Gitlab::UrlBuilder.wiki_url(wiki, only_path: true, **options) + end + + def wiki_page_path(wiki, page, **options) + Gitlab::UrlBuilder.wiki_page_url(wiki, page, only_path: true, **options) + end + private def snippet_query_params(snippet, *args) |