summaryrefslogtreecommitdiff
path: root/app/views/shared/_new_commit_form.html.haml
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2018-02-28 09:06:18 +0100
committerBob Van Landuyt <bob@vanlanduyt.co>2018-03-07 16:55:34 +0100
commite74879280f0cbf48fa0dcf8031e711cc51c9183f (patch)
tree291ec858063ba12d569b5a2810215d67b62195ac /app/views/shared/_new_commit_form.html.haml
parentc9557ad711c6cdf4465fb8c3c9b0dbaffcafa0e8 (diff)
downloadgitlab-ce-e74879280f0cbf48fa0dcf8031e711cc51c9183f.tar.gz
Allow maintainers to edit directly in a fork
Diffstat (limited to 'app/views/shared/_new_commit_form.html.haml')
-rw-r--r--app/views/shared/_new_commit_form.html.haml9
1 files changed, 7 insertions, 2 deletions
diff --git a/app/views/shared/_new_commit_form.html.haml b/app/views/shared/_new_commit_form.html.haml
index 0a4a24ae807..9221fd1e025 100644
--- a/app/views/shared/_new_commit_form.html.haml
+++ b/app/views/shared/_new_commit_form.html.haml
@@ -1,3 +1,6 @@
+- project = @project.present(current_user: current_user)
+- branch_name = selected_branch
+
= render 'shared/commit_message_container', placeholder: placeholder
- if @project.empty_repo?
@@ -7,12 +10,14 @@
.form-group.branch
= label_tag 'branch_name', _('Target Branch'), class: 'control-label'
.col-sm-10
- = text_field_tag 'branch_name', @branch_name || tree_edit_branch, required: true, class: "form-control js-branch-name ref-name"
+ = text_field_tag 'branch_name', branch_name, required: true, class: "form-control js-branch-name ref-name"
.js-create-merge-request-container
= render 'shared/new_merge_request_checkbox'
+ - elsif project.can_current_user_push_to_branch?(branch_name)
+ = hidden_field_tag 'branch_name', branch_name
- else
- = hidden_field_tag 'branch_name', @branch_name || tree_edit_branch
+ = hidden_field_tag 'branch_name', branch_name
= hidden_field_tag 'create_merge_request', 1
= hidden_field_tag 'original_branch', @ref, class: 'js-original-branch'