BigW Consortium Gitlab

_new_submit.html.haml 4.98 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
Vinnie Okada committed
10
    = link_to 'Change branches', new_namespace_project_merge_request_path(@project.namespace, @project)
11

Vinnie Okada committed
12
= form_for [@project.namespace.becomes(Namespace), @project, @merge_request], html: { class: "merge-request-form form-horizontal gfm-form" } do |f|
13 14 15 16 17 18 19 20 21
  .merge-request-form-info
    .form-group
      = f.label :title, class: 'control-label' do
        %strong Title *
      .col-sm-10
        = f.text_field :title, maxlength: 255, autofocus: true, class: 'form-control pad js-gfm-input', required: true
    .form-group.issuable-description
      = f.label :description, 'Description', class: 'control-label'
      .col-sm-10
22
        = render layout: 'projects/md_preview', locals: { preview_class: "wiki" } do
23 24 25 26 27 28 29
          = render 'projects/zen', f: f, attr: :description, classes: 'description form-control'

          .col-sm-12-hint
            .pull-left
              Parsed with
              #{link_to 'Gitlab Flavored Markdown', help_page_path('markdown', 'markdown'), target: '_blank'}.
            .pull-right
30
              Attach files by dragging & dropping
31 32 33
              or #{link_to 'selecting them', '#', class: 'markdown-selector'}.

          .clearfix
34
          .error-alert
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
    %hr
    .form-group
      .issue-assignee
        = f.label :assignee_id, class: 'control-label' do
          %i.fa.fa-user
          Assign to
      .col-sm-10
        = project_users_select_tag('merge_request[assignee_id]', placeholder: 'Select a user', class: 'custom-form-control', selected: @merge_request.assignee_id, project_id: @merge_request.target_project_id)
         
        = link_to 'Assign to me', '#', class: 'btn assign-to-me-link'
    .form-group
      .issue-milestone
        = f.label :milestone_id, class: 'control-label' do
          %i.fa.fa-clock-o
          Milestone
        .col-sm-10
          - if milestone_options(@merge_request).present?
            = f.select(:milestone_id, milestone_options(@merge_request), {include_blank: 'Select milestone'}, {class: 'select2'})
          - else
            %span.light No open milestones available.
           
          - if can? current_user, :admin_milestone, @merge_request.target_project
Vinnie Okada committed
57
            = link_to 'Create new milestone', new_namespace_project_milestone_path(@merge_request.target_project.namespace, @merge_request.target_project), target: :blank
58 59 60 61 62 63 64 65 66 67 68
    .form-group
      = f.label :label_ids, class: 'control-label' do
        %i.fa.fa-tag
        Labels
      .col-sm-10
        - if @merge_request.target_project.labels.any?
          = f.collection_select :label_ids, @merge_request.target_project.labels.all, :id, :name, {selected: @merge_request.label_ids}, multiple: true, class: 'select2'
        - else
          %span.light No labels yet.
         
        - if can? current_user, :admin_label, @merge_request.target_project
Vinnie Okada committed
69
          = link_to 'Create new label', new_namespace_project_label_path(@merge_request.target_project.namespace, @merge_request.target_project), target: :blank
70

71
    .form-actions
72 73 74
      - if contribution_guide_url(@target_project)
        %p
          Please review the
75
          %strong #{link_to 'guidelines for contribution', contribution_guide_url(@target_project)}
76 77
          to this repository.
      = f.hidden_field :source_project_id
78
      = f.hidden_field :source_branch
79 80
      = f.hidden_field :target_project_id
      = f.hidden_field :target_branch
81
      = f.submit 'Submit merge request', class: 'btn btn-create'
82

83 84 85 86 87 88 89 90 91 92 93 94
.mr-compare.merge-request
  %ul.nav.nav-tabs.merge-request-tabs
    %li.commits-tab{data: {action: 'commits'}}
      = link_to url_for(params) do
        %i.fa.fa-history
        Commits
        %span.badge= @commits.size
    %li.diffs-tab{data: {action: 'diffs'}}
      = link_to url_for(params) do
        %i.fa.fa-list-alt
        Changes
        %span.badge= @diffs.size
95

96
  .commits.tab-content
97
    = render "projects/commits/commits", project: @project
98 99 100 101
  .diffs.tab-content
    - if @diffs.present?
      = render "projects/diffs/diffs", diffs: @diffs, project: @project
    - elsif @commits.size > MergeRequestDiff::COMMITS_SAFE_SIZE
102
      .alert.alert-danger
103 104 105
        %h4 This comparison includes more than #{MergeRequestDiff::COMMITS_SAFE_SIZE} commits.
        %p To preserve performance the line changes are not shown.
    - else
106
      .alert.alert-danger
107 108
        %h4 This comparison includes a huge diff.
        %p To preserve performance the line changes are not shown.
109 110 111 112 113 114

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

116
  window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
117 118 119 120 121 122

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