summaryrefslogtreecommitdiff
path: root/app/views/projects/milestones/show.html.haml
blob: 1f5f18801adf31f960adb1249692baec9e166280 (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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
- @no_container = true
- add_to_breadcrumbs "Milestones", project_milestones_path(@project)
- breadcrumb_title @milestone.title
- page_title       @milestone.title, "Milestones"
- page_description @milestone.description
= render "shared/mr_head"

%div{ class: container_class }
  .detail-page-header.milestone-page-header
    .status-box{ class: status_box_class(@milestone) }
      - if @milestone.closed?
        Closed
      - elsif @milestone.expired?
        Past due
      - elsif @milestone.upcoming?
        Upcoming
      - else
        Open
    .header-text-content
      %span.identifier
        %strong
          Milestone
      - if @milestone.due_date || @milestone.start_date
        = milestone_date_range(@milestone)
    .milestone-buttons
      - if can?(current_user, :admin_milestone, @project)
        - if @milestone.active?
          = link_to 'Close milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-close btn-nr btn-grouped"
        - else
          = link_to 'Reopen milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :activate }), method: :put, class: "btn btn-reopen btn-nr btn-grouped"

        = link_to edit_project_milestone_path(@project, @milestone), class: "btn btn-grouped btn-nr" do
          Edit

        = link_to project_milestone_path(@project, @milestone), data: { confirm: 'Are you sure?' }, method: :delete, class: "btn btn-grouped btn-danger" do
          Delete

      %a.btn.btn-default.btn-grouped.pull-right.visible-xs-block.js-sidebar-toggle{ href: "#" }
        = icon('angle-double-left')

  .detail-page-description.milestone-detail
    %h2.title
      = markdown_field(@milestone, :title)
    %div
      - if @milestone.description.present?
        .description
          .wiki
            = markdown_field(@milestone, :description)

  - if can?(current_user, :read_issue, @project) && @milestone.total_items_count(current_user).zero?
    .alert.alert-success.prepend-top-default
      %span Assign some issues to this milestone.
  - elsif @milestone.complete?(current_user) && @milestone.active?
    .alert.alert-success.prepend-top-default
      %span All issues for this milestone are closed. You may close this milestone now.

  = render 'shared/milestones/tabs', milestone: @milestone
  = render 'shared/milestones/sidebar', milestone: @milestone, project: @project, affix_offset: 153