BigW Consortium Gitlab

_new_submit.html.haml 2.04 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
  .merge-request-form-info
15
    = render 'shared/issuable/form', f: f, issuable: @merge_request
16 17 18 19
    = f.hidden_field :source_project_id
    = f.hidden_field :source_branch
    = f.hidden_field :target_project_id
    = f.hidden_field :target_branch
20

21
.mr-compare.merge-request
22
  %ul.merge-request-tabs
23
    %li.commits-tab
24
      = link_to url_for(params), data: {target: '#commits', action: 'commits', toggle: 'tab'} do
25 26
        Commits
        %span.badge= @commits.size
27
    %li.diffs-tab.active
28
      = link_to url_for(params), data: {target: '#diffs', action: 'diffs', toggle: 'tab'} do
29 30
        Changes
        %span.badge= @diffs.size
31

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

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

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