summaryrefslogtreecommitdiff
path: root/app/views/projects
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-06-29 10:19:54 -0500
committerDouwe Maan <douwe@selenight.nl>2017-06-29 12:59:37 -0500
commit6cdbb1e687bcb787f749b51c472ec8449d0ca0e4 (patch)
treee4d60dc2698a01f309c96f65c6404239a2909bce /app/views/projects
parent3d49246dc8cd28555f7c06608fc75dcd37ee1b08 (diff)
downloadgitlab-ce-6cdbb1e687bcb787f749b51c472ec8449d0ca0e4.tar.gz
Fix 'New merge request' button for users who don't have push access to canonical projectdm-empty-state-new-merge-request
Diffstat (limited to 'app/views/projects')
-rw-r--r--app/views/projects/merge_requests/index.html.haml8
1 files changed, 5 insertions, 3 deletions
diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml
index 86996e488a1..1e30cc09894 100644
--- a/app/views/projects/merge_requests/index.html.haml
+++ b/app/views/projects/merge_requests/index.html.haml
@@ -13,6 +13,9 @@
= render 'projects/last_push'
+- merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
+- new_merge_request_path = namespace_project_new_merge_request_path(merge_project.namespace, merge_project) if merge_project
+
- if @project.merge_requests.exists?
%div{ class: container_class }
.top-area
@@ -20,9 +23,8 @@
.nav-controls
- if @can_bulk_update
= button_tag "Edit Merge Requests", class: "btn js-bulk-update-toggle"
- - merge_project = can?(current_user, :create_merge_request, @project) ? @project : (current_user && current_user.fork_of(@project))
- if merge_project
- = link_to namespace_project_new_merge_request_path(merge_project.namespace, merge_project), class: "btn btn-new", title: "New merge request" do
+ = link_to new_merge_request_path, class: "btn btn-new", title: "New merge request" do
New merge request
= render 'shared/issuable/search_bar', type: :merge_requests
@@ -33,4 +35,4 @@
.merge-requests-holder
= render 'merge_requests'
- else
- = render 'shared/empty_states/merge_requests', button_path: namespace_project_new_merge_request_path(@project.namespace, @project)
+ = render 'shared/empty_states/merge_requests', button_path: new_merge_request_path