debian-mirror-gitlab/app/views/projects/merge_requests/_new_compare.html.haml

89 lines
4.8 KiB
Text
Raw Normal View History

2015-12-23 02:04:40 +05:30
%h3.page-title
New Merge Request
2014-09-02 18:07:02 +05:30
2015-09-11 14:41:01 +05:30
= 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-09-02 18:07:02 +05:30
.hide.alert.alert-danger.mr-compare-errors
.merge-request-branches.row
.col-md-6
2016-06-02 11:05:42 +05:30
.panel.panel-default.panel-new-merge-request
2014-09-02 18:07:02 +05:30
.panel-heading
2016-06-02 11:05:42 +05:30
Source branch
.panel-body.clearfix
.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" }
.dropdown-menu.dropdown-menu-selectable.dropdown-source-project
= dropdown_title("Select source project")
= dropdown_filter("Search projects")
= dropdown_content do
= render 'projects/merge_requests/dropdowns/project',
projects: [@merge_request.source_project],
selected: f.object.source_project_id
.merge-request-select.dropdown
= f.hidden_field :source_branch
= dropdown_toggle "Select source branch", { toggle: "dropdown", field_name: "#{f.object_name}[source_branch]" }, { toggle_class: "js-compare-dropdown js-source-branch" }
.dropdown-menu.dropdown-menu-selectable.dropdown-source-branch
= dropdown_title("Select source branch")
= dropdown_filter("Search branches")
= dropdown_content do
= render 'projects/merge_requests/dropdowns/branch',
branches: @merge_request.source_branches,
selected: f.object.source_branch
2014-09-02 18:07:02 +05:30
.panel-footer
2016-06-02 11:05:42 +05:30
= icon('spinner spin', class: 'js-source-loading')
%ul.list-unstyled.mr_source_commit
2014-09-02 18:07:02 +05:30
.col-md-6
2016-06-02 11:05:42 +05:30
.panel.panel-default.panel-new-merge-request
2014-09-02 18:07:02 +05:30
.panel-heading
2016-06-02 11:05:42 +05:30
Target branch
.panel-body.clearfix
2014-09-02 18:07:02 +05:30
- projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project]
2016-06-02 11:05:42 +05:30
.merge-request-select.dropdown
= f.hidden_field :target_project_id
= 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" }
.dropdown-menu.dropdown-menu-selectable.dropdown-target-project
= dropdown_title("Select target project")
= dropdown_filter("Search projects")
= dropdown_content do
= render 'projects/merge_requests/dropdowns/project',
projects: projects,
selected: f.object.target_project_id
.merge-request-select.dropdown
= f.hidden_field :target_branch
= dropdown_toggle f.object.target_branch, { toggle: "dropdown", field_name: "#{f.object_name}[target_branch]" }, { toggle_class: "js-compare-dropdown js-target-branch" }
.dropdown-menu.dropdown-menu-selectable.dropdown-target-branch.js-target-branch-dropdown
= dropdown_title("Select target branch")
= dropdown_filter("Search branches")
= dropdown_content do
= render 'projects/merge_requests/dropdowns/branch',
branches: @merge_request.target_branches,
selected: f.object.target_branch
2014-09-02 18:07:02 +05:30
.panel-footer
2016-06-02 11:05:42 +05:30
= icon('spinner spin', class: "js-target-loading")
%ul.list-unstyled.mr_target_commit
2014-09-02 18:07:02 +05:30
- if @merge_request.errors.any?
2016-06-02 11:05:42 +05:30
= form_errors(@merge_request)
2014-09-02 18:07:02 +05:30
- elsif @merge_request.source_branch.present? && @merge_request.target_branch.present?
2016-06-02 11:05:42 +05:30
.light-well.append-bottom-default
.center
%h4
There isn't anything to merge.
%p.slead
- if @merge_request.source_branch == @merge_request.target_branch
You'll need to use different branch names to get a valid comparison.
- else
%span.label-branch #{@merge_request.source_branch}
and
%span.label-branch #{@merge_request.target_branch}
are the same.
= f.submit 'Compare branches and continue', class: "btn btn-new mr-compare-btn"
2014-09-02 18:07:02 +05:30
2015-11-26 14:37:03 +05:30
:javascript
2016-06-02 11:05:42 +05:30
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-26 14:37:03 +05:30
});