BigW Consortium Gitlab

_state_widget.html.haml 1.53 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
.panel.mr-state-widget.panel-default
  - if @merge_request.source_project.gitlab_ci? && @commits.any?
    .panel-heading
      = render "projects/merge_requests/show/mr_ci"
  .panel-body
    - if @merge_request.open?
      - if @merge_request.source_branch_exists? && @merge_request.target_branch_exists?
        = render "projects/merge_requests/show/mr_accept"
      - else
        = render "projects/merge_requests/show/no_accept"

    - if @merge_request.closed?
      %h4
        Closed by #{link_to_member(@project, @merge_request.closed_event.author, avatar: false)}
        #{time_ago_with_tooltip(@merge_request.closed_event.created_at)}
      %p Changes was not merged into target branch

    - if @merge_request.merged?
      %h4
        Merged by #{link_to_member(@project, @merge_request.merge_event.author, avatar: false)}
        #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}
      = render "projects/merge_requests/show/remove_source_branch"

    - unless @commits.any?
      %h4 Nothing to merge
      %p
        Nothing to merge from
        %span.label-branch #{@merge_request.source_branch}
        to
        %span.label-branch #{@merge_request.target_branch}
        %br
        Try to use different branches or push new code.
Dmitriy Zaporozhets committed
33 34 35 36 37 38 39 40 41

  - if !@closes_issues.empty? && @merge_request.open?
    .panel-footer
      %span
        %i.icon-ok
        Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'}
        = succeed '.' do
          != gfm(@closes_issues.map { |i| "##{i.iid}" }.to_sentence)