_new_submit.html.haml 2.34 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 gfm-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.center-top-menu.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
    %li.diffs-tab.active
27
      = link_to url_for(params), data: {target: 'div#diffs', action: 'diffs', toggle: 'tab'} do
28 29
        Changes
        %span.badge= @diffs.size
Douwe Maan's avatar
Douwe Maan committed
30 31 32 33 34
    - if @ci_commit
      %li.builds-tab.active
        = link_to url_for(params), data: {target: 'div#builds', action: 'builds', toggle: 'tab'} do
          Builds
          %span.badge= @statuses.size
35

36 37
  .tab-content
    #commits.commits.tab-pane
38
      = render "projects/merge_requests/show/commits"
39
    #diffs.diffs.tab-pane.active
40 41 42 43 44 45 46 47 48 49
      - if @diffs.present?
        = render "projects/diffs/diffs", diffs: @diffs, project: @project
      - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
        .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
        .alert.alert-danger
          %h4 This comparison includes a huge diff.
          %p To preserve performance the line changes are not shown.
Douwe Maan's avatar
Douwe Maan committed
50 51 52
    - if @ci_commit
      #builds.builds.tab-pane
        = render "projects/merge_requests/show/builds"
53 54 55 56 57 58

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

60 61 62
:javascript
  var merge_request
  merge_request = new MergeRequest({
63
    action: 'new',
64 65
    diffs_loaded: true,
    commits_loaded: true
66
  });