_new_submit.html.haml 2.09 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

  %span.pull-right
10
    = link_to 'Change branches', mr_change_branches_path(@merge_request)
11
%hr
12
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal gfm-form js-requires-input' } do |f|
13
  .merge-request-form-info
14
    = render 'shared/issuable/form', f: f, issuable: @merge_request
15 16 17 18
    = 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
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 33
  .tab-content
    #commits.commits.tab-pane
      = render "projects/commits/commits", project: @project
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
  });
59