diff options
author | Phil Hughes <me@iamphill.com> | 2017-07-06 17:27:12 +0100 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-07-06 17:27:12 +0100 |
commit | e5183d907e9db2bdf87dae83708b35a970a829ba (patch) | |
tree | edc05f30dd515cbe7ef3966a2b7aab7e835c4286 /app/presenters | |
parent | c85df8105e3b8982ecf6a16f8ae9f3af2f130030 (diff) | |
parent | e1a64f0c6d769c38918c50fdbd9b72b0f6fcfa4a (diff) | |
download | gitlab-ce-e5183d907e9db2bdf87dae83708b35a970a829ba.tar.gz |
Merge branch 'master' into new-nav-fix-contextual-breadcrumbs
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/merge_request_presenter.rb | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/app/presenters/merge_request_presenter.rb b/app/presenters/merge_request_presenter.rb index 8bf35953d29..6ba1d3165e9 100644 --- a/app/presenters/merge_request_presenter.rb +++ b/app/presenters/merge_request_presenter.rb @@ -20,30 +20,25 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated def cancel_merge_when_pipeline_succeeds_path if can_cancel_merge_when_pipeline_succeeds?(current_user) - cancel_merge_when_pipeline_succeeds_namespace_project_merge_request_path( - project.namespace, - project, - merge_request) + cancel_merge_when_pipeline_succeeds_project_merge_request_path(project, merge_request) end end def create_issue_to_resolve_discussions_path if can?(current_user, :create_issue, project) && project.issues_enabled? - new_namespace_project_issue_path(project.namespace, - project, - merge_request_to_resolve_discussions_of: iid) + new_project_issue_path(project, merge_request_to_resolve_discussions_of: iid) end end def remove_wip_path if can?(current_user, :update_merge_request, merge_request.project) - remove_wip_namespace_project_merge_request_path(project.namespace, project, merge_request) + remove_wip_project_merge_request_path(project, merge_request) end end def merge_path if can_be_merged_by?(current_user) - merge_namespace_project_merge_request_path(project.namespace, project, merge_request) + merge_project_merge_request_path(project, merge_request) end end @@ -55,7 +50,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated notice_now: edit_in_new_fork_notice_now } - namespace_project_forks_path(merge_request.project.namespace, merge_request.project, + project_forks_path(merge_request.project, namespace_key: current_user.namespace.id, continue: continue_params) end @@ -69,7 +64,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated notice_now: edit_in_new_fork_notice_now } - namespace_project_forks_path(project.namespace, project, + project_forks_path(project, namespace_key: current_user.namespace.id, continue: continue_params) end @@ -77,19 +72,19 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated def conflict_resolution_path if conflicts.can_be_resolved_in_ui? && conflicts.can_be_resolved_by?(current_user) - conflicts_namespace_project_merge_request_path(project.namespace, project, merge_request) + conflicts_project_merge_request_path(project, merge_request) end end def target_branch_commits_path if target_branch_exists? - namespace_project_commits_path(project.namespace, project, target_branch) + project_commits_path(project, target_branch) end end def source_branch_path if source_branch_exists? - namespace_project_branch_path(source_project.namespace, source_project, source_branch) + project_branch_path(source_project, source_branch) end end @@ -99,7 +94,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated if source_branch_exists? namespace = link_to(namespace, project_path(source_project)) - branch = link_to(branch, namespace_project_commits_path(source_project.namespace, source_project, source_branch)) + branch = link_to(branch, project_commits_path(source_project, source_branch)) end if for_fork? @@ -136,7 +131,7 @@ class MergeRequestPresenter < Gitlab::View::Presenter::Delegated merge_request: merge_request, closes_issues: closing_issues ).assignable_issues - path = assign_related_issues_namespace_project_merge_request_path(project.namespace, project, merge_request) + path = assign_related_issues_project_merge_request_path(project, merge_request) if issues.present? pluralize_this_issue = issues.count > 1 ? "these issues" : "this issue" link_to "Assign yourself to #{pluralize_this_issue}", path, method: :post |