_new_submit.html.haml 3.41 KB
Newer Older
1 2 3 4
%h3.page-title
  New merge request
%p.slead
  From
5 6 7
  %strong.label-branch #{@merge_request.source_project_namespace}:#{@merge_request.source_branch}
  %span into
  %strong.label-branch #{@merge_request.target_project_namespace}:#{@merge_request.target_branch}
8 9 10 11

  %span.pull-right
    = link_to 'Change branches', new_project_merge_request_path(@project)

12
= form_for [@project, @merge_request], html: { class: "merge-request-form gfm-form" } do |f|
13
  .panel.panel-default
14

15 16 17 18
    .panel-body
      .form-group
        .light
          = f.label :title do
19
            Title *
20 21 22 23
        = f.text_field :title, class: "form-control input-lg js-gfm-input", maxlength: 255, rows: 5, required: true
      .form-group
        .light
          = f.label :description, "Description"
Ciro Santilli's avatar
Ciro Santilli committed
24 25
        = render 'projects/zen', f: f, attr: :description,
                                 classes: 'description form-control'
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
        .clearfix.hint
          .pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
          .pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
        .error-alert
      .form-group
        .issue-assignee
          = f.label :assignee_id do
            %i.icon-user
            Assign to
          %div
            = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @merge_request.assignee_id, project_id: @merge_request.target_project_id)
             
            = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
      .form-group
        .issue-milestone
          = f.label :milestone_id do
            %i.icon-time
            Milestone
          %div= f.select(:milestone_id, milestone_options(@merge_request), { include_blank: "Select milestone" }, {class: 'select2'})
45 46 47 48 49 50 51
      .form-group
        = f.label :label_ids do
          %i.icon-tag
          Labels
        %div
          = f.collection_select :label_ids, @merge_request.target_project.labels.all, :id, :name, { selected: @merge_request.label_ids }, multiple: true, class: 'select2'

52 53 54 55 56 57 58 59 60 61 62
    .panel-footer
      - if contribution_guide_url(@target_project)
        %p
          Please review the
          %strong #{link_to "guidelines for contribution", contribution_guide_url(@target_project)}
          to this repository.
      = f.hidden_field :source_project_id
      = f.hidden_field :target_project_id
      = f.hidden_field :target_branch
      = f.hidden_field :source_branch
      = f.submit 'Submit merge request', class: "btn btn-create"
63

64
.mr-compare
65
  = render "projects/commits/commit_list"
66 67 68

  %h4 Changes
  - if @diffs.present?
69
    = render "projects/diffs/diffs", diffs: @diffs, project: @project
70 71 72 73 74 75 76 77
  - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
    .bs-callout.bs-callout-danger
      %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits.
      %p To preserve performance the line changes are not shown.
  - else
    .bs-callout.bs-callout-danger
      %h4 This comparison includes huge diff.
      %p To preserve performance the line changes are not shown.
78 79 80 81 82 83 84


:javascript
  $('.assign-to-me-link').on('click', function(e){
    $('#merge_request_assignee_id').val("#{current_user.id}").trigger("change");
    e.preventDefault();
  });
85

86
  window.project_image_path_upload = "#{upload_image_project_path @project}";