Commit 32384cf7 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Move EE merge request settings into separate fieldset

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 8c830688
......@@ -4,13 +4,20 @@ class @ProjectNew
$('.project-edit-container').hide()
$('.save-project-loader').show()
@toggleSettings()
@initEvents()
initEvents: ->
disableButtonIfEmptyField '#project_name', '.project-submit'
$("#project_merge_requests_enabled").change ->
checked = $(this).prop("checked")
$("#project_merge_requests_template").prop "disabled", not checked
$("#project_merge_requests_rebase_enabled").prop "disabled", not checked
$("#project_merge_requests_enabled").change =>
@toggleSettings()
toggleSettings: ->
checked = $("#project_merge_requests_enabled").prop("checked")
if checked
$('.merge-request-feature').show()
else
$('.merge-request-feature').hide()
%fieldset.merge-request-feature
%legend
Merge requests:
.form-group
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :merge_requests_rebase_enabled do
= f.check_box :merge_requests_rebase_enabled
%span.descr Allows rebasing of merge requests before merging.
.form-group.rebase-default
.col-sm-offset-2.col-sm-10
.checkbox
= f.label :merge_requests_rebase_default do
= f.check_box :merge_requests_rebase_default
%span.descr Rebase enabled by default
.form-group
= f.label :merge_requests_template, class: 'control-label' do
Description template
.col-sm-10
= f.text_area :merge_requests_template, placeholder: "This MR should have: *", class: "form-control", rows: 3
.form-group
= f.label :approvals_before_merge, class: 'control-label' do
Approvals required
.col-sm-10
= f.number_field :approvals_before_merge, class: "form-control"
.help-block
How many users should approve merge request before it can be accepted. 0 - approval is disabled
......@@ -54,35 +54,6 @@
= f.check_box :merge_requests_enabled
%span.descr Submit changes to be merged upstream.
.form-group
= f.label :merge_requests_rebase_enabled, "Merge Requests Rebase", class: 'control-label'
.col-sm-10
.checkbox
= f.check_box :merge_requests_rebase_enabled
%span.descr Allows rebasing of merge requests before merging.
.rebase-default
.col-sm-10.col-sm-offset-3
.checkbox
= f.check_box :merge_requests_rebase_default
%span.descr Enabled by default
.form-group
= f.label :merge_requests_template, class: 'control-label' do
Merge request template
%span.light (optional)
.col-sm-10
= f.text_area :merge_requests_template, placeholder: "This MR should have: *", disabled: !@project.merge_requests_enabled, class: "form-control", rows: 3
.form-group
= f.label :approvals_before_merge, class: 'control-label' do
Merge request approvals
.col-sm-10
= f.number_field :approvals_before_merge, disabled: !@project.merge_requests_enabled, class: "form-control"
.help-block
How many users should approve merge request before it can be accepted. 0 - approval is disabled
.form-group
= f.label :wiki_enabled, "Wiki", class: 'control-label'
.col-sm-10
......@@ -97,6 +68,8 @@
= f.check_box :snippets_enabled
%span.descr Share code pastes with others out of git repository
= render 'merge_request_settings', f: f
%fieldset.features
%legend
Project avatar:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment