%h3.page-title
  New merge request
%p.slead
  From
  %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}

  %span.pull-right
    = link_to 'Change branches', mr_change_branches_path(@merge_request)
%hr
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: 'merge-request-form form-horizontal gfm-form' } do |f|
  .merge-request-form-info
    = render 'projects/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

.mr-compare.merge-request
  %ul.nav.nav-tabs.merge-request-tabs
    %li.commits-tab{data: {action: 'commits', toggle: 'tab'}}
      = link_to url_for(params) do
        %i.fa.fa-history
        Commits
        %span.badge= @commits.size
    %li.diffs-tab{data: {action: 'diffs', toggle: 'tab'}}
      = link_to url_for(params) do
        %i.fa.fa-list-alt
        Changes
        %span.badge= @diffs.size

  .commits.tab-content
    = render "projects/commits/commits", project: @project
  .diffs.tab-content
    - 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.

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

  window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";

:javascript
  var merge_request
  merge_request = new MergeRequest({
    action: 'commits'
  });

