You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
5.9 KiB

  1. {{template "base/head" .}}
  2. <div class="repository milestones">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="navbar">
  6. {{template "repo/issue/navbar" .}}
  7. {{if .IsRepositoryWriter}}
  8. <div class="ui right">
  9. <a class="ui green button" href="{{$.Link}}/new">{{.i18n.Tr "repo.milestones.new"}}</a>
  10. </div>
  11. {{end}}
  12. </div>
  13. <div class="ui divider"></div>
  14. {{template "base/alert" .}}
  15. <div class="ui tiny basic buttons">
  16. <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.RepoLink}}/milestones?state=open">
  17. <i class="octicon octicon-milestone"></i>
  18. {{.i18n.Tr "repo.milestones.open_tab" .OpenCount}}
  19. </a>
  20. <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.RepoLink}}/milestones?state=closed">
  21. <i class="octicon octicon-milestone"></i>
  22. {{.i18n.Tr "repo.milestones.close_tab" .ClosedCount}}
  23. </a>
  24. </div>
  25. <div class="ui right floated secondary filter menu">
  26. <!-- Sort -->
  27. <div class="ui dropdown type jump item">
  28. <span class="text">
  29. {{.i18n.Tr "repo.issues.filter_sort"}}
  30. <i class="dropdown icon"></i>
  31. </span>
  32. <div class="menu">
  33. <a class="{{if or (eq .SortType "closestduedate") (not .SortType)}}active{{end}} item" href="{{$.Link}}?sort=closestduedate&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.closest_due_date"}}</a>
  34. <a class="{{if eq .SortType "furthestduedate"}}active{{end}} item" href="{{$.Link}}?sort=furthestduedate&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.furthest_due_date"}}</a>
  35. <a class="{{if eq .SortType "leastcomplete"}}active{{end}} item" href="{{$.Link}}?sort=leastcomplete&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.least_complete"}}</a>
  36. <a class="{{if eq .SortType "mostcomplete"}}active{{end}} item" href="{{$.Link}}?sort=mostcomplete&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.most_complete"}}</a>
  37. <a class="{{if eq .SortType "mostissues"}}active{{end}} item" href="{{$.Link}}?sort=mostissues&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.most_issues"}}</a>
  38. <a class="{{if eq .SortType "leastissues"}}active{{end}} item" href="{{$.Link}}?sort=leastissues&state={{$.State}}">{{.i18n.Tr "repo.milestones.filter_sort.least_issues"}}</a>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="milestone list">
  43. {{range .Milestones}}
  44. <li class="item">
  45. <i class="octicon octicon-milestone"></i> <a href="{{$.RepoLink}}/issues?state={{$.State}}&milestone={{.ID}}">{{.Name}}</a>
  46. <div class="ui right green progress" data-percent="{{.Completeness}}">
  47. <div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}>
  48. <div class="progress"></div>
  49. </div>
  50. </div>
  51. <div class="meta">
  52. {{ $closedDate:= TimeSinceUnix .ClosedDateUnix $.Lang }}
  53. {{if .IsClosed}}
  54. <span class="octicon octicon-clock"></span> {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}}
  55. {{else}}
  56. <span class="octicon octicon-calendar"></span>
  57. {{if .DeadlineString}}
  58. <span {{if .IsOverDue}}class="overdue"{{end}}>{{.DeadlineString}}</span>
  59. {{else}}
  60. {{$.i18n.Tr "repo.milestones.no_due_date"}}
  61. {{end}}
  62. {{end}}
  63. <span class="issue-stats">
  64. <i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_tab" .NumOpenIssues}}
  65. <i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.close_tab" .NumClosedIssues}}
  66. </span>
  67. </div>
  68. {{if $.IsRepositoryWriter}}
  69. <div class="ui right operate">
  70. <a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
  71. {{if .IsClosed}}
  72. <a href="{{$.Link}}/{{.ID}}/open" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-check"></i> {{$.i18n.Tr "repo.milestones.open"}}</a>
  73. {{else}}
  74. <a href="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-x"></i> {{$.i18n.Tr "repo.milestones.close"}}</a>
  75. {{end}}
  76. <a class="delete-button" href="#" data-url="{{$.RepoLink}}/milestones/delete" data-id="{{.ID}}"><i class="octicon octicon-trashcan"></i> {{$.i18n.Tr "repo.issues.label_delete"}}</a>
  77. </div>
  78. {{end}}
  79. {{if .Content}}
  80. <div class="content">
  81. {{.RenderedContent|Str2html}}
  82. </div>
  83. {{end}}
  84. </li>
  85. {{end}}
  86. {{with .Page}}
  87. {{if gt .TotalPages 1}}
  88. <div class="center page buttons">
  89. <div class="ui borderless pagination menu">
  90. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?state={{$.State}}&page={{.Previous}}"{{end}}>
  91. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  92. </a>
  93. {{range .Pages}}
  94. {{if eq .Num -1}}
  95. <a class="disabled item">...</a>
  96. {{else}}
  97. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?state={{$.State}}&page={{.Num}}"{{end}}>{{.Num}}</a>
  98. {{end}}
  99. {{end}}
  100. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?state={{$.State}}&page={{.Next}}"{{end}}>
  101. {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
  102. </a>
  103. </div>
  104. </div>
  105. {{end}}
  106. {{end}}
  107. </div>
  108. </div>
  109. </div>
  110. {{if .IsRepositoryWriter}}
  111. <div class="ui small basic delete modal">
  112. <div class="ui icon header">
  113. <i class="trash icon"></i>
  114. {{.i18n.Tr "repo.milestones.deletion"}}
  115. </div>
  116. <div class="content">
  117. <p>{{.i18n.Tr "repo.milestones.deletion_desc"}}</p>
  118. </div>
  119. <div class="actions">
  120. <div class="ui red basic inverted cancel button">
  121. <i class="remove icon"></i>
  122. {{.i18n.Tr "modal.no"}}
  123. </div>
  124. <div class="ui green basic inverted ok button">
  125. <i class="checkmark icon"></i>
  126. {{.i18n.Tr "modal.yes"}}
  127. </div>
  128. </div>
  129. </div>
  130. {{end}}
  131. {{template "base/footer" .}}