diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 0fe2d1d98014178096f9b52670b4276536d4ce6b..58994e012f94da5ffccacb716a4b194f4a5aa6c4 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -14,33 +14,6 @@ - @merge_request.errors.full_messages.each do |msg| %div= msg - .merge-request-branches - .form-group - = label_tag nil, class: 'control-label' do - From - .col-sm-10 - .clearfix - .pull-left - = f.select(:source_project_id, [[@merge_request.source_project_path,@merge_request.source_project.id]] , {}, { class: 'source_project select2 span3', disabled: @merge_request.persisted? }) - .pull-left - - = f.select(:source_branch, @merge_request.source_branches, { include_blank: "Select branch" }, {class: 'source_branch select2 span2'}) - .mr_source_commit - %br - .form-group - = label_tag nil, class: 'control-label' do - To - .col-sm-10 - .clearfix - .pull-left - - projects = @project.forked_from_project.nil? ? [@project] : [@project, @project.forked_from_project] - = f.select(:target_project_id, options_from_collection_for_select(projects, 'id', 'path_with_namespace', f.object.target_project_id), {}, { class: 'target_project select2 span3', disabled: @merge_request.persisted? }) - .pull-left - - = f.select(:target_branch, @merge_request.target_branches, { include_blank: "Select branch" }, {class: 'target_branch select2 span2'}) - .mr_target_commit - - %hr .merge-request-form-info .form-group = f.label :title, class: 'control-label' do @@ -51,6 +24,23 @@ .col-sm-10 = f.text_area :description, class: "form-control js-gfm-input", rows: 14 %p.hint Description is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + %hr + .form-group + .issue-assignee + = f.label :assignee_id, class: 'control-label' do + %i.icon-user + Assign to + .col-sm-10 + = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @merge_request.assignee_id) + + = link_to 'Assign to me', '#', class: 'btn btn-small assign-to-me-link' + .form-group + .issue-milestone + = f.label :milestone_id, class: 'control-label' do + %i.icon-time + Milestone + .col-sm-10= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'}) + .form-actions - if @merge_request.new_record? @@ -66,20 +56,3 @@ :javascript disableButtonIfEmptyField("#merge_request_title", ".btn-save"); - - var source_branch = $("#merge_request_source_branch") - , target_branch = $("#merge_request_target_branch") - , target_project = $("#merge_request_target_project_id"); - - $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: source_branch.val() }); - $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: target_branch.val() }); - - target_project.on("change", function() { - $.get("#{update_branches_project_merge_requests_path(@source_project)}", {target_project_id: $(this).val() }); - }); - source_branch.on("change", function() { - $.get("#{branch_from_project_merge_requests_path(@source_project)}", {ref: $(this).val() }); - }); - target_branch.on("change", function() { - $.get("#{branch_to_project_merge_requests_path(@source_project)}", {target_project_id: target_project.val(),ref: $(this).val() }); - }); diff --git a/app/views/projects/merge_requests/branch_from.js.haml b/app/views/projects/merge_requests/branch_from.js.haml index 693c2057a0f8d1514f74775bd80605b2ca3d07c0..8372afa61b53b4cb5eb1de3615f725ec2b48cf93 100644 --- a/app/views/projects/merge_requests/branch_from.js.haml +++ b/app/views/projects/merge_requests/branch_from.js.haml @@ -1,7 +1,2 @@ :plain $(".mr_source_commit").html("#{commit_to_html(@commit, @source_project, false)}"); - var mrTitle = $('#merge_request_title'); - - if(mrTitle.val().length == 0) { - mrTitle.val("#{params[:ref].titleize.humanize}"); - } diff --git a/app/views/projects/merge_requests/show/_mr_title.html.haml b/app/views/projects/merge_requests/show/_mr_title.html.haml index 8f78e93df4f12d19e50948fdcaf99ef2c72e2cdb..2c905413bc3846b113ec2e222f50a37e7d2f0f80 100644 --- a/app/views/projects/merge_requests/show/_mr_title.html.haml +++ b/app/views/projects/merge_requests/show/_mr_title.html.haml @@ -39,4 +39,4 @@ - else %span= @merge_request.source_branch → - %spanh= @merge_request.target_branch + %span= @merge_request.target_branch