.issue-box
  %h4.title
    = gfm escape_once(@merge_request.title)

  .context
    %cite.cgray
      Created by #{link_to_member(@project, @merge_request.author)}.
      - if @merge_request.assignee
        Currently assigned to #{link_to_member(@project, @merge_request.assignee)}.
    - if @merge_request.milestone
      .pull-right
        - milestone = @merge_request.milestone
        %cite.cgray Attached to milestone
        %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone)


  - if @merge_request.description.present?
    .description
      .wiki
        = preserve do
          = markdown @merge_request.description

  - if @merge_request.closed?
    .description.alert-danger
      %span
        %i.icon-remove
        Closed by #{link_to_member(@project, @merge_request.closed_event.author)}
        #{time_ago_with_tooltip(@merge_request.closed_event.created_at)}.
  - if @merge_request.merged?
    .description.alert-success
      %span
        %i.icon-ok
        Merged by #{link_to_member(@project, @merge_request.merge_event.author)}
        #{time_ago_with_tooltip(@merge_request.merge_event.created_at)}.
  - if !@closes_issues.empty? && @merge_request.opened?
    .description.alert-info
      %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)
