BigW Consortium Gitlab

_top.html.haml 1.91 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
- page_title milestone.title, "Milestones"

- group = local_assigns[:group]

.detail-page-header
  .status-box{ class: "status-box-#{milestone.closed? ? 'closed' : 'open'}" }
    - if milestone.closed?
      Closed
    - elsif milestone.expired?
      Expired
    - else
      Open
  %span.identifier
    Milestone #{milestone.title}
  - if milestone.expires_at
    %span.creator
      ·
      = milestone.expires_at
  - if group
    .pull-right
      - if can?(current_user, :admin_milestones, group)
        - if milestone.active?
          = link_to 'Close Milestone', group_milestone_path(group, milestone.safe_title, title: milestone.title, milestone: {state_event: :close }), method: :put, class: "btn btn-grouped btn-close"
        - else
          = link_to 'Reopen Milestone', group_milestone_path(group, milestone.safe_title, title: milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-grouped btn-reopen"

27
.detail-page-description.milestone-detail
28 29 30
  %h2.title
    = markdown escape_once(milestone.title), pipeline: :single_line

31
- if milestone.complete?(current_user) && milestone.active?
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
  .alert.alert-success.prepend-top-default
    - close_msg = group ? 'You may close the milestone now.' : 'Navigate to the project to close the milestone.'
    %span All issues for this milestone are closed. #{close_msg}

.table-holder
  %table.table
    %thead
      %tr
        %th Project
        %th Open issues
        %th State
        %th Due date
    - milestone.milestones.each do |ms|
      %tr
        %td
          - project_name = group ? ms.project.name : ms.project.name_with_namespace
          = link_to project_name, namespace_project_milestone_path(ms.project.namespace, ms.project, ms)
        %td
50
          = ms.issues_visible_to_user(current_user).opened.count
51 52 53 54 55 56 57 58
        %td
          - if ms.closed?
            Closed
          - else
            Open
        %td
          = ms.expires_at