milestones.tmpl 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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="milestone list">
  26. {{range .Milestones}}
  27. <li class="item">
  28. <i class="octicon octicon-milestone"></i> <a href="{{$.RepoLink}}/issues?state={{$.State}}&milestone={{.ID}}">{{.Name | Sanitize}}</a>
  29. <div class="ui right green progress" data-percent="{{.Completeness}}">
  30. <div class="bar" {{if not .Completeness}}style="background-color: transparent"{{end}}>
  31. <div class="progress"></div>
  32. </div>
  33. </div>
  34. <div class="meta">
  35. {{ $closedDate:= TimeSince .ClosedDate $.Lang }}
  36. {{if .IsClosed}}
  37. <span class="octicon octicon-clock"></span> {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}}
  38. {{else}}
  39. <span class="octicon octicon-calendar"></span>
  40. {{if .DeadlineString}}
  41. <span {{if .IsOverDue}}class="overdue"{{end}}>{{.DeadlineString}}</span>
  42. {{else}}
  43. {{$.i18n.Tr "repo.milestones.no_due_date"}}
  44. {{end}}
  45. {{end}}
  46. <span class="issue-stats">
  47. <i class="octicon octicon-issue-opened"></i> {{$.i18n.Tr "repo.issues.open_tab" .NumOpenIssues}}
  48. <i class="octicon octicon-issue-closed"></i> {{$.i18n.Tr "repo.issues.close_tab" .NumClosedIssues}}
  49. </span>
  50. </div>
  51. {{if $.IsRepositoryWriter}}
  52. <div class="ui right operate">
  53. <a href="{{$.Link}}/{{.ID}}/edit" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-pencil"></i> {{$.i18n.Tr "repo.issues.label_edit"}}</a>
  54. {{if .IsClosed}}
  55. <a href="{{$.Link}}/{{.ID}}/open" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-check"></i> {{$.i18n.Tr "repo.milestones.open"}}</a>
  56. {{else}}
  57. <a href="{{$.Link}}/{{.ID}}/close" data-id={{.ID}} data-title={{.Name}}><i class="octicon octicon-x"></i> {{$.i18n.Tr "repo.milestones.close"}}</a>
  58. {{end}}
  59. <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>
  60. </div>
  61. {{end}}
  62. {{if .Content}}
  63. <div class="content">
  64. {{.RenderedContent|Str2html}}
  65. </div>
  66. {{end}}
  67. </li>
  68. {{end}}
  69. {{with .Page}}
  70. {{if gt .TotalPages 1}}
  71. <div class="center page buttons">
  72. <div class="ui borderless pagination menu">
  73. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?state={{$.State}}&page={{.Previous}}"{{end}}>
  74. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  75. </a>
  76. {{range .Pages}}
  77. {{if eq .Num -1}}
  78. <a class="disabled item">...</a>
  79. {{else}}
  80. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?state={{$.State}}&page={{.Num}}"{{end}}>{{.Num}}</a>
  81. {{end}}
  82. {{end}}
  83. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?state={{$.State}}&page={{.Next}}"{{end}}>
  84. {{$.i18n.Tr "repo.issues.next"}} <i class="icon right arrow"></i>
  85. </a>
  86. </div>
  87. </div>
  88. {{end}}
  89. {{end}}
  90. </div>
  91. </div>
  92. </div>
  93. {{if .IsRepositoryWriter}}
  94. <div class="ui small basic delete modal">
  95. <div class="ui icon header">
  96. <i class="trash icon"></i>
  97. {{.i18n.Tr "repo.milestones.deletion"}}
  98. </div>
  99. <div class="content">
  100. <p>{{.i18n.Tr "repo.milestones.deletion_desc"}}</p>
  101. </div>
  102. <div class="actions">
  103. <div class="ui red basic inverted cancel button">
  104. <i class="remove icon"></i>
  105. {{.i18n.Tr "modal.no"}}
  106. </div>
  107. <div class="ui green basic inverted ok button">
  108. <i class="checkmark icon"></i>
  109. {{.i18n.Tr "modal.yes"}}
  110. </div>
  111. </div>
  112. </div>
  113. {{end}}
  114. {{template "base/footer" .}}