summaryrefslogtreecommitdiff
path: root/app/views/groups/milestones/show.html.haml
blob: 8f2decb851f786441a134b2fe317c5fcb94ca7ca (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
- page_title @group_milestone.title, "Milestones"
%h4.page-title
  .issue-box{ class: "issue-box-#{@group_milestone.closed? ? 'closed' : 'open'}" }
    - if @group_milestone.closed?
      Closed
    - else
      Open
  Milestone #{@group_milestone.title}
  .pull-right
    - if can?(current_user, :admin_group, @group)
      - if @group_milestone.active?
        = link_to 'Close Milestone', group_milestone_path(@group, @group_milestone.safe_title, title: @group_milestone.title, milestone: {state_event: :close }), method: :put, class: "btn btn-sm btn-close"
      - else
        = link_to 'Reopen Milestone', group_milestone_path(@group, @group_milestone.safe_title, title: @group_milestone.title, milestone: {state_event: :activate }), method: :put, class: "btn btn-sm btn-grouped btn-reopen"

%hr
- if (@group_milestone.total_items_count == @group_milestone.closed_items_count) && @group_milestone.active?
  .alert.alert-success
    %span All issues for this milestone are closed. You may close the milestone now.

.description
%table.table
  %thead
    %tr
      %th Project
      %th Open issues
      %th State
      %th Due date
  - @group_milestone.milestones.each do |milestone|
    %tr
      %td
        = link_to "#{milestone.project.name}", namespace_project_milestone_path(milestone.project.namespace, milestone.project, milestone)
      %td
        = milestone.issues.opened.count
      %td
        - if milestone.closed?
          Closed
        - else
          Open
      %td
        = milestone.expires_at

.context
  %p.lead
    Progress:
    #{@group_milestone.closed_items_count} closed
    –
    #{@group_milestone.open_items_count} open
  = milestone_progress_bar(@group_milestone)

%ul.nav.nav-tabs
  %li.active
    = link_to '#tab-issues', 'data-toggle' => 'tab' do
      Issues
      %span.badge= @group_milestone.issue_count
  %li
    = link_to '#tab-merge-requests', 'data-toggle' => 'tab' do
      Merge Requests
      %span.badge= @group_milestone.merge_requests_count
  %li
    = link_to '#tab-participants', 'data-toggle' => 'tab' do
      Participants
      %span.badge= @group_milestone.participants.count

  .pull-right
    = link_to 'Browse Issues', issues_group_path(@group, milestone_title: @group_milestone.title), class: "btn  edit-milestone-link btn-grouped"

.tab-content
  .tab-pane.active#tab-issues
    .row
      .col-md-6
        = render 'issues', title: "Open", issues: @group_milestone.opened_issues
      .col-md-6
        = render 'issues', title: "Closed", issues: @group_milestone.closed_issues

  .tab-pane#tab-merge-requests
    .row
      .col-md-6
        = render 'merge_requests', title: "Open", merge_requests: @group_milestone.opened_merge_requests
      .col-md-6
        = render 'merge_requests', title: "Closed", merge_requests: @group_milestone.closed_merge_requests

  .tab-pane#tab-participants
    %ul.bordered-list
      - @group_milestone.participants.each do |user|
        %li
          = link_to user, title: user.name, class: "darken" do
            = image_tag avatar_icon(user.email, 32), class: "avatar s32"
            %strong= truncate(user.name, lenght: 40)
            %br
            %small.cgray= user.username