summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-06-18 21:55:44 -0700
committerStan Hu <stanhu@gmail.com>2015-06-20 05:46:20 -0700
commitf7efd265754c023253a51cc7a1fd6e43fae652a1 (patch)
tree906c91cf4f2a8c69a64670fb483f71217e99317b
parentd5cbdcc7452e259f641dec0303a0a8bf61a62d18 (diff)
downloadgitlab-ce-f7efd265754c023253a51cc7a1fd6e43fae652a1.tar.gz
Disable changing of target branch in new merge request page when a branch has already been specified
Closes #1830
-rw-r--r--CHANGELOG1
-rw-r--r--app/views/projects/_issuable_form.html.haml13
2 files changed, 8 insertions, 6 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 9d558b15ab9..dd1300dbc2d 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,7 @@
Please view this file on the master branch, on stable branches it's out of date.
v 7.12.0 (unreleased)
+ - Disable changing of target branch in new merge request page when a branch has already been specified (Stan Hu)
- Update oauth button logos for Twitter and Google to recommended assets
- Update browser gem to version 0.8.0 for IE11 support (Stan Hu)
- Fix timeout when rendering file with thousands of lines.
diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml
index 491e2107da4..6e54cadda1e 100644
--- a/app/views/projects/_issuable_form.html.haml
+++ b/app/views/projects/_issuable_form.html.haml
@@ -15,10 +15,10 @@
- if issuable.is_a?(MergeRequest)
%p.help-block
- if issuable.work_in_progress?
- Remove the <code>WIP</code> prefix from the title to allow this
+ Remove the <code>WIP</code> prefix from the title to allow this
<strong>Work In Progress</strong> merge request to be accepted when it's ready.
- else
- Start the title with <code>[WIP]</code> or <code>WIP:</code> to prevent a
+ Start the title with <code>[WIP]</code> or <code>WIP:</code> to prevent a
<strong>Work In Progress</strong> merge request from being accepted before it's ready.
.form-group.issuable-description
= f.label :description, 'Description', class: 'control-label'
@@ -81,21 +81,22 @@
- if issuable.is_a?(MergeRequest)
%hr
- - unless @merge_request.persisted?
+ - if @merge_request.new_record?
.form-group
= f.label :source_branch, class: 'control-label' do
%i.fa.fa-code-fork
Source Branch
.col-sm-10
= f.select(:source_branch, [@merge_request.source_branch], { }, { class: 'source_branch select2 span2', disabled: true })
- %p.help-block
- = link_to 'Change source branch', mr_change_branches_path(@merge_request)
.form-group
= f.label :target_branch, class: 'control-label' do
%i.fa.fa-code-fork
Target Branch
.col-sm-10
- = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, { class: 'target_branch select2 span2' })
+ = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, { class: 'target_branch select2 span2', disabled: @merge_request.new_record? })
+ - if @merge_request.new_record?
+ %p.help-block
+ = link_to 'Change branches', mr_change_branches_path(@merge_request)
.form-actions
- if !issuable.project.empty_repo? && (guide_url = contribution_guide_url(issuable.project)) && !issuable.persisted?