.mr-state-widget
  - if @merge_request.source_project.ci_service && @commits.any?
    .mr-widget-heading
      = render "projects/merge_requests/show/mr_ci"
  .mr-widget-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 were 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.

  - if @closes_issues.present? && @merge_request.open?
    .mr-widget-footer
      %span
        %i.fa.fa-check
        Accepting this merge request will close #{@closes_issues.size == 1 ? 'issue' : 'issues'}
        = succeed '.' do
          != gfm(issues_sentence(@closes_issues))