_new_submit.html.haml 2.26 KB
Newer Older
1
%h3.page-title
2
  New Merge Request
3
%p.slead
4
  - source_title, target_title = format_mr_branch_names(@merge_request)
5
  From
6
  %strong.label-branch #{source_title}
7
  %span into
8
  %strong.label-branch #{target_title}
9 10

  %span.pull-right
11
    = link_to 'Change branches', mr_change_branches_path(@merge_request)
12
%hr
13
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal common-note-form js-requires-input' } do |f|
14 15 16 17 18
  = render 'shared/issuable/form', f: f, issuable: @merge_request
  = f.hidden_field :source_project_id
  = f.hidden_field :source_branch
  = f.hidden_field :target_project_id
  = f.hidden_field :target_branch
19

20
.mr-compare.merge-request
21
  %ul.merge-request-tabs.nav-links.no-top.no-bottom
22
    %li.commits-tab
23
      = link_to url_for(params), data: {target: 'div#commits', action: 'commits', toggle: 'tab'} do
24 25
        Commits
        %span.badge= @commits.size
26
    - if @pipeline
Douwe Maan's avatar
Douwe Maan committed
27 28 29 30
      %li.builds-tab.active
        = link_to url_for(params), data: {target: 'div#builds', action: 'builds', toggle: 'tab'} do
          Builds
          %span.badge= @statuses.size
31 32 33
    %li.diffs-tab.active
      = link_to url_for(params), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
        Changes
34
        %span.badge= @diffs.real_size
35

36 37
  .tab-content
    #commits.commits.tab-pane
38
      = render "projects/merge_requests/show/commits"
39
    #diffs.diffs.tab-pane.active
40
      - if @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
41 42 43 44
        .alert.alert-danger
          %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits.
          %p To preserve performance the line changes are not shown.
      - else
45
        = render "projects/diffs/diffs", diff_files: @diffs.diff_files, project: @diffs.project, diff_refs: @merge_request.diff_refs, show_whitespace_toggle: false
46
    - if @pipeline
Douwe Maan's avatar
Douwe Maan committed
47 48
      #builds.builds.tab-pane
        = render "projects/merge_requests/show/builds"
49 50 51 52 53 54

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

56 57 58
:javascript
  var merge_request
  merge_request = new MergeRequest({
59
    action: 'new',
60 61
    diffs_loaded: true,
    commits_loaded: true
62
  });