_new_submit.html.haml 2.03 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: '#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: '#diffs', action: 'diffs', toggle: 'tab'} do
28 29
        Changes
        %span.badge= @diffs.size
30

31 32
  .tab-content
    #commits.commits.tab-pane
33
      = render "projects/merge_requests/show/commits"
34
    #diffs.diffs.tab-pane.active
35 36 37 38 39 40 41 42 43 44
      - 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.
45 46 47 48 49 50

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

52 53 54
:javascript
  var merge_request
  merge_request = new MergeRequest({
55
    action: 'new',
56 57
    diffs_loaded: true,
    commits_loaded: true
58
  });