2015-12-02 08:27:29 -05:00
|
|
|
%h3.page-title
|
|
|
|
New Merge Request
|
2014-05-08 08:38:17 -04:00
|
|
|
|
2015-06-26 21:53:17 -04:00
|
|
|
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], url: new_namespace_project_merge_request_path(@project.namespace, @project), method: :get, html: { class: "merge-request-form form-inline js-requires-input" } do |f|
|
2014-05-08 12:00:03 -04:00
|
|
|
.hide.alert.alert-danger.mr-compare-errors
|
2014-05-08 08:38:17 -04:00
|
|
|
.merge-request-branches.row
|
|
|
|
.col-md-6
|
2016-03-15 10:43:40 -04:00
|
|
|
.panel.panel-default.panel-new-merge-request
|
2014-05-08 08:38:17 -04:00
|
|
|
.panel-heading
|
2016-03-15 10:43:40 -04:00
|
|
|
Source branch
|
|
|
|
.panel-body.clearfix
|
2016-03-29 06:11:16 -04:00
|
|
|
.merge-request-select.dropdown
|
|
|
|
= f.hidden_field :source_project_id
|
|
|
|
= dropdown_toggle @merge_request.source_project_path, { toggle: "dropdown", field_name: "#{f.object_name}[source_project_id]", disabled: @merge_request.persisted? }, { toggle_class: "js-compare-dropdown js-source-project" }
|
2016-04-06 07:52:07 -04:00
|
|
|
.dropdown-menu.dropdown-menu-selectable.dropdown-source-project
|
2016-03-29 06:11:16 -04:00
|
|
|
= dropdown_title("Select source project")
|
|
|
|
= dropdown_filter("Search projects")
|
|
|
|
= dropdown_content do
|
2016-04-13 11:10:03 -04:00
|
|
|
= render 'projects/merge_requests/dropdowns/project',
|
2016-04-15 11:36:07 -04:00
|
|
|
projects: [@merge_request.source_project],
|
|
|
|
selected: f.object.source_project_id
|
2016-03-29 06:11:16 -04:00
|
|
|
.merge-request-select.dropdown
|
|
|
|
= f.hidden_field :source_branch
|
2016-06-07 07:21:30 -04:00
|
|
|
= dropdown_toggle f.object.source_branch || "Select source branch", { toggle: "dropdown", field_name: "#{f.object_name}[source_branch]" }, { toggle_class: "js-compare-dropdown js-source-branch" }
|
2016-04-06 07:52:07 -04:00
|
|
|
.dropdown-menu.dropdown-menu-selectable.dropdown-source-branch
|
2016-03-29 06:11:16 -04:00
|
|
|
= dropdown_title("Select source branch")
|
|
|
|
= dropdown_filter("Search branches")
|
|
|
|
= dropdown_content do
|
2016-04-13 11:10:03 -04:00
|
|
|
= render 'projects/merge_requests/dropdowns/branch',
|
2016-04-15 11:36:07 -04:00
|
|
|
branches: @merge_request.source_branches,
|
|
|
|
selected: f.object.source_branch
|
2014-05-08 08:38:17 -04:00
|
|
|
.panel-footer
|
2016-04-11 04:43:59 -04:00
|
|
|
= icon('spinner spin', class: 'js-source-loading')
|
2016-03-15 10:43:40 -04:00
|
|
|
%ul.list-unstyled.mr_source_commit
|
2014-05-08 08:38:17 -04:00
|
|
|
|
|
|
|
.col-md-6
|
2016-03-15 10:43:40 -04:00
|
|
|
.panel.panel-default.panel-new-merge-request
|
2014-05-08 08:38:17 -04:00
|
|
|
.panel-heading
|
2016-03-15 10:43:40 -04:00
|
|
|
Target branch
|
|
|
|
.panel-body.clearfix
|
2014-05-08 08:38:17 -04:00
|
|
|
- projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project]
|
2016-03-29 06:11:16 -04:00
|
|
|
.merge-request-select.dropdown
|
|
|
|
= f.hidden_field :target_project_id
|
2016-03-29 07:43:33 -04:00
|
|
|
= dropdown_toggle f.object.target_project.path_with_namespace, { toggle: "dropdown", field_name: "#{f.object_name}[target_project_id]", disabled: @merge_request.persisted? }, { toggle_class: "js-compare-dropdown js-target-project" }
|
2016-04-06 07:52:07 -04:00
|
|
|
.dropdown-menu.dropdown-menu-selectable.dropdown-target-project
|
2016-03-29 06:11:16 -04:00
|
|
|
= dropdown_title("Select target project")
|
|
|
|
= dropdown_filter("Search projects")
|
|
|
|
= dropdown_content do
|
2016-04-13 11:10:03 -04:00
|
|
|
= render 'projects/merge_requests/dropdowns/project',
|
2016-04-15 11:36:07 -04:00
|
|
|
projects: projects,
|
|
|
|
selected: f.object.target_project_id
|
2016-03-29 06:11:16 -04:00
|
|
|
.merge-request-select.dropdown
|
|
|
|
= f.hidden_field :target_branch
|
2016-03-29 07:43:33 -04:00
|
|
|
= dropdown_toggle f.object.target_branch, { toggle: "dropdown", field_name: "#{f.object_name}[target_branch]" }, { toggle_class: "js-compare-dropdown js-target-branch" }
|
2016-04-06 07:52:07 -04:00
|
|
|
.dropdown-menu.dropdown-menu-selectable.dropdown-target-branch.js-target-branch-dropdown
|
2016-03-29 06:11:16 -04:00
|
|
|
= dropdown_title("Select target branch")
|
|
|
|
= dropdown_filter("Search branches")
|
|
|
|
= dropdown_content do
|
2016-04-13 11:10:03 -04:00
|
|
|
= render 'projects/merge_requests/dropdowns/branch',
|
2016-04-15 11:36:07 -04:00
|
|
|
branches: @merge_request.target_branches,
|
|
|
|
selected: f.object.target_branch
|
2014-05-08 08:38:17 -04:00
|
|
|
.panel-footer
|
2016-03-15 10:43:40 -04:00
|
|
|
= icon('spinner spin', class: "js-target-loading")
|
|
|
|
%ul.list-unstyled.mr_target_commit
|
2014-05-08 08:38:17 -04:00
|
|
|
|
2014-07-15 08:34:06 -04:00
|
|
|
- if @merge_request.errors.any?
|
2016-04-04 21:25:38 -04:00
|
|
|
= form_errors(@merge_request)
|
2016-03-15 10:43:40 -04:00
|
|
|
= f.submit 'Compare branches and continue', class: "btn btn-new mr-compare-btn"
|
2014-05-08 08:38:17 -04:00
|
|
|
|
2015-11-10 06:17:37 -05:00
|
|
|
:javascript
|
2016-03-15 10:43:40 -04:00
|
|
|
new Compare({
|
|
|
|
targetProjectUrl: "#{update_branches_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}",
|
|
|
|
sourceBranchUrl: "#{branch_from_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}",
|
|
|
|
targetBranchUrl: "#{branch_to_namespace_project_merge_requests_path(@source_project.namespace, @source_project)}"
|
2015-11-10 06:17:37 -05:00
|
|
|
});
|