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.

milestone_issues.tmpl 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. {{template "base/head" .}}
  2. <div class="repository">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="ui three column stackable grid">
  6. <div class="column">
  7. <h3>{{.Milestone.Name}}</h3>
  8. </div>
  9. <div class="column center aligned">
  10. </div>
  11. {{if not .Repository.IsArchived}}
  12. <div class="column right aligned">
  13. {{if or .CanWriteIssues .CanWritePulls}}
  14. <a class="ui grey button" href="{{.RepoLink}}/milestones/{{.MilestoneID}}/edit">{{.i18n.Tr "repo.milestones.edit"}}</a>
  15. {{end}}
  16. <a class="ui green button" href="{{.RepoLink}}/issues/new?milestone={{.MilestoneID}}">{{.i18n.Tr "repo.issues.new"}}</a>
  17. </div>
  18. {{end}}
  19. </div>
  20. <div class="ui one column stackable grid">
  21. <div class="column">
  22. {{ $closedDate:= TimeSinceUnix .Milestone.ClosedDateUnix $.Lang }}
  23. {{if .IsClosed}}
  24. {{svg "octicon-clock" 16}} {{$.i18n.Tr "repo.milestones.closed" $closedDate|Str2html}}
  25. {{else}}
  26. {{svg "octicon-calendar" 16}}
  27. {{if .Milestone.DeadlineString}}
  28. <span {{if .IsOverdue}}class="overdue"{{end}}>{{.Milestone.DeadlineString}}</span>
  29. {{else}}
  30. {{$.i18n.Tr "repo.milestones.no_due_date"}}
  31. {{end}}
  32. {{end}}
  33. &nbsp;
  34. <b>{{.i18n.Tr "repo.milestones.completeness" .Milestone.Completeness}}</b>
  35. </div>
  36. </div>
  37. <div class="ui divider"></div>
  38. <div id="issue-filters" class="ui stackable grid">
  39. <div class="six wide column">
  40. <div class="ui tiny basic status buttons">
  41. <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&assignee={{.AssigneeID}}">
  42. {{svg "octicon-issue-opened" 16}}
  43. {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  44. </a>
  45. <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&assignee={{.AssigneeID}}">
  46. {{svg "octicon-issue-closed" 16}}
  47. {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  48. </a>
  49. </div>
  50. </div>
  51. <div class="ten wide right aligned column">
  52. <div class="ui secondary filter stackable menu labels">
  53. <!-- Label -->
  54. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item label-filter" style="margin-left: auto">
  55. <span class="text">
  56. {{.i18n.Tr "repo.issues.filter_label"}}
  57. <i class="dropdown icon"></i>
  58. </span>
  59. <div class="menu">
  60. <span class="info">{{.i18n.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
  61. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
  62. {{range .Labels}}
  63. <a class="item has-emoji label-filter-item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&assignee={{$.AssigneeID}}" data-label-id="{{.ID}}">{{if .IsExcluded}}{{svg "octicon-circle-slash" 16}}{{else if contain $.SelLabelIDs .ID}}{{svg "octicon-check" 16}}{{end}}"><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
  64. {{end}}
  65. </div>
  66. </div>
  67. <!-- Assignee -->
  68. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  69. <span class="text">
  70. {{.i18n.Tr "repo.issues.filter_assignee"}}
  71. <i class="dropdown icon"></i>
  72. </span>
  73. <div class="menu">
  74. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a>
  75. {{range .Assignees}}
  76. <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&assignee={{.ID}}"><img src="{{.RelAvatarLink}}"> {{.GetDisplayName}}</a>
  77. {{end}}
  78. </div>
  79. </div>
  80. {{if .IsSigned}}
  81. <!-- Type -->
  82. <div class="ui dropdown type jump item">
  83. <span class="text">
  84. {{.i18n.Tr "repo.issues.filter_type"}}
  85. <i class="dropdown icon"></i>
  86. </span>
  87. <div class="menu">
  88. <a class="{{if eq .ViewType "all"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.all_issues"}}</a>
  89. <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{.SignedUser.ID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
  90. <a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.created_by_you"}}</a>
  91. <a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.mentioning_you"}}</a>
  92. </div>
  93. </div>
  94. {{end}}
  95. <!-- Sort -->
  96. <div class="ui dropdown type jump item">
  97. <span class="text">
  98. {{.i18n.Tr "repo.issues.filter_sort"}}
  99. <i class="dropdown icon"></i>
  100. </span>
  101. <div class="menu">
  102. <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
  103. <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
  104. <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  105. <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  106. <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a>
  107. <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. <div id="issue-actions" class="ui stackable grid hide">
  114. <div class="six wide column">
  115. <div class="ui tiny basic status buttons">
  116. <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&assignee={{.AssigneeID}}">
  117. {{svg "octicon-issue-opened" 16}}
  118. {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  119. </a>
  120. <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&assignee={{.AssigneeID}}">
  121. {{svg "octicon-issue-closed" 16}}
  122. {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  123. </a>
  124. </div>
  125. </div>
  126. {{/* Ten wide does not cope well and makes the columns stack.
  127. This seems to be related to jQuery's hide/show: in fact, switching
  128. issue-actions and issue-filters and having this ten wide will show
  129. this one correctly, but not the other one. */}}
  130. <div class="nine wide right aligned right floated column">
  131. <div class="ui secondary filter stackable menu">
  132. <!-- Action Button -->
  133. {{if .IsShowClosed}}
  134. <div class="ui green active basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.i18n.Tr "repo.issues.action_open"}}</div>
  135. {{else}}
  136. <div class="ui red active basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.i18n.Tr "repo.issues.action_close"}}</div>
  137. {{end}}
  138. <!-- Labels -->
  139. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
  140. <span class="text">
  141. {{.i18n.Tr "repo.issues.action_label"}}
  142. <i class="dropdown icon"></i>
  143. </span>
  144. <div class="menu">
  145. {{range .Labels}}
  146. <div class="item issue-action has-emoji" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
  147. {{if contain $.SelLabelIDs .ID}}{{svg "octicon-check" 16}}{{end}}"><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}
  148. </div>
  149. {{end}}
  150. </div>
  151. </div>
  152. <!-- Assignees -->
  153. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  154. <span class="text">
  155. {{.i18n.Tr "repo.issues.action_assignee"}}
  156. <i class="dropdown icon"></i>
  157. </span>
  158. <div class="menu">
  159. <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee">
  160. {{.i18n.Tr "repo.issues.action_assignee_no_select"}}
  161. </div>
  162. {{range .Assignees}}
  163. <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
  164. <img src="{{.RelAvatarLink}}"> {{.GetDisplayName}}
  165. </div>
  166. {{end}}
  167. </div>
  168. </div>
  169. </div>
  170. </div>
  171. </div>
  172. <div class="issue list">
  173. {{range .Issues}}
  174. {{ $timeStr:= TimeSinceUnix .CreatedUnix $.Lang }}
  175. <li class="item">
  176. {{if or (and $.CanWriteIssues (not .IsPull)) (and $.CanWritePulls .IsPull)}}
  177. <div class="ui checkbox issue-checkbox">
  178. <input type="checkbox" data-issue-id={{.ID}}></input>
  179. </div>
  180. {{end}}
  181. <div class="ui {{if .IsRead}}gray{{else}}green{{end}} label">#{{.Index}}</div>
  182. <a class="title has-emoji" href="{{$.RepoLink}}/issues/{{.Index}}">{{.Title}}</a>
  183. {{range .Labels}}
  184. <a class="ui label has-emoji" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a>
  185. {{end}}
  186. {{if .NumComments}}
  187. <span class="comment ui right">{{svg "octicon-comment" 16}} {{.NumComments}}</span>
  188. {{end}}
  189. {{if .TotalTrackedTime}}
  190. <span class="comment ui right">{{svg "octicon-clock" 16}} {{.TotalTrackedTime | Sec2Time}}</span>
  191. {{end}}
  192. <p class="desc">
  193. {{if gt .Poster.ID 0}}
  194. {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName|Escape) | Safe}}
  195. {{else}}
  196. {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName|Escape) | Safe}}
  197. {{end}}
  198. {{if .Ref}}
  199. <a class="ref" href="{{$.RepoLink}}/src/branch/{{.Ref}}">
  200. {{svg "octicon-git-branch" 16}} {{.Ref}}
  201. </a>
  202. {{end}}
  203. {{$tasks := .GetTasks}}
  204. {{if gt $tasks 0}}
  205. {{$tasksDone := .GetTasksDone}}
  206. <span class="checklist">
  207. {{svg "octicon-checklist" 16}} {{$tasksDone}} / {{$tasks}} <span class="progress-bar"><span class="progress" style="width:calc(100% * {{$tasksDone}} / {{$tasks}});"></span></span>
  208. </span>
  209. {{end}}
  210. {{if ne .DeadlineUnix 0}}
  211. {{svg "octicon-calendar" 16}}
  212. <span{{if .IsOverdue}} class="overdue"{{end}}>{{.DeadlineUnix.FormatShort}}</span>
  213. {{end}}
  214. {{range .Assignees}}
  215. <a class="ui right assignee poping up" href="{{.HomeLink}}" data-content="{{.Name}}" data-variation="inverted" data-position="left center">
  216. <img class="ui avatar image" src="{{.RelAvatarLink}}">
  217. </a>
  218. {{end}}
  219. </p>
  220. </li>
  221. {{end}}
  222. {{template "base/paginate" .}}
  223. </div>
  224. </div>
  225. </div>
  226. {{template "base/footer" .}}