summaryrefslogtreecommitdiff
path: root/app/views/projects/milestones/_milestone.html.haml
blob: 67d95ab0364d349cec2441263ae7f81a8ad7800a (plain)
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
%li{class: "milestone milestone-#{milestone.closed? ? 'closed' : 'open'}", id: dom_id(milestone) }
  .row
    .col-sm-6
      %strong
        = link_to_gfm truncate(milestone.title, length: 100), namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone)

    .col-sm-6
      .pull-right.light #{milestone.percent_complete}% complete
  .row
    .col-sm-6
      = link_to namespace_project_issues_path(milestone.project.namespace, milestone.project, milestone_title: milestone.title) do
        = pluralize milestone.issues.count, 'Issue'
      ·
      = link_to namespace_project_merge_requests_path(milestone.project.namespace, milestone.project, milestone_title: milestone.title) do
        = pluralize milestone.merge_requests.count, 'Merge Request'
    .col-sm-6
      = milestone_progress_bar(milestone)

  .row
    .col-sm-6
      = render 'shared/milestone_expired', milestone: milestone
    .col-sm-6
      - if can?(current_user, :admin_milestone, milestone.project) and milestone.active?
        = link_to edit_namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone), class: "btn btn-xs" do
          = icon('pencil-square-o')
          Edit
        \
        = link_to 'Close Milestone', namespace_project_milestone_path(@project.namespace, @project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-xs btn-close"
        = link_to namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone), data: { confirm: 'Are you sure?' }, method: :delete, class: "btn btn-xs btn-remove" do
          = icon('trash-o')
          Delete