show.html.haml 3.46 KB
Newer Older
1
= render "projects/issues/head"
2
%h3.page-title
Romain's avatar
Romain committed
3
  Milestone ##{@milestone.iid}
4 5 6 7
  %small
    = @milestone.expires_at
  .pull-right
    - if can?(current_user, :admin_milestone, @project)
8
      = link_to edit_project_milestone_path(@project, @milestone), class: "btn btn-grouped" do
9 10
        %i.icon-edit
        Edit
11
      - if @milestone.active?
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
12
        = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-remove btn-grouped"
13
      - else
14
        = link_to 'Reopen Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :activate }), method: :put, class: "btn btn-grouped"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
15

16 17 18
- if @milestone.issues.any? && @milestone.can_be_closed?
  .alert.alert-success
    %span All issues for this milestone are closed. You may close milestone now.
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
19

20 21 22
.back-link
  = link_to project_milestones_path(@project) do
    ← To milestones list
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
23

24

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
25
.issue-box{ class: issue_box_class(@milestone) }
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
26
  .state
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
27 28 29 30 31 32 33
    %span.state-label
      - if @milestone.closed?
        Closed
      - elsif @milestone.expired?
        Expired
      - else
        Open
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
34

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
35 36
  %h4.title
    = gfm escape_once(@milestone.title)
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
37

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
38
  .context
39
    %p
40
      Progress:
41 42 43
      #{@milestone.closed_items_count} closed
      –
      #{@milestone.open_items_count} open
44
      %span.pull-right= @milestone.expires_at
45
    .progress.progress-info
46
      .progress-bar{style: "width: #{@milestone.percent_complete}%;"}
47

48
  - if @milestone.description.present?
49 50 51 52
    .description
      .wiki
        = preserve do
          = markdown @milestone.description
53

54
%ul.nav.nav-tabs
55 56 57 58 59 60 61 62 63 64 65 66
  %li.active
    = link_to '#tab-issues', 'data-toggle' => 'tab' do
      Issues
      %span.badge= @issues.count
  %li
    = link_to '#tab-merge-requests', 'data-toggle' => 'tab' do
      Merge Requests
      %span.badge= @merge_requests.count
  %li
    = link_to '#tab-participants', 'data-toggle' => 'tab' do
      Participants
      %span.badge= @users.count
67

68
  .pull-right
69
    = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small btn-grouped", title: "New Issue" do
70 71
      %i.icon-plus
      New Issue
72
    = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn btn-small edit-milestone-link btn-grouped"
73

74 75 76
.tab-content
  .tab-pane.active#tab-issues
    .row
77
      .col-md-4
78
        = render('issues', title: 'Unstarted Issues (open and unassigned)', issues: @issues.opened.unassigned)
79
      .col-md-4
80
        = render('issues', title: 'Ongoing Issues (open and assigned)', issues: @issues.opened.assigned)
81
      .col-md-4
82
        = render('issues', title: 'Completed Issues (closed)', issues: @issues.closed)
83

84 85
  .tab-pane#tab-merge-requests
    .row
86
      .col-md-6
87
        .ui-box
88
          .title Open
89 90 91
          %ul.well-list
            - @merge_requests.opened.each do |merge_request|
              = render 'merge_request', merge_request: merge_request
92
      .col-md-6
93
        .ui-box
94
          .title Closed
95 96 97
          %ul.well-list
            - @merge_requests.closed.each do |merge_request|
              = render 'merge_request', merge_request: merge_request
98

99 100 101 102 103
  .tab-pane#tab-participants
    %ul.bordered-list
      - @users.each do |user|
        %li
          = link_to user, title: user.name, class: "dark" do
104
            = image_tag avatar_icon(user.email, 32), class: "avatar s32"
105 106 107
            %strong= truncate(user.name, lenght: 40)
            %br
            %small.cgray= user.username