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.

list.tmpl 15KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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. {{template "repo/issue/navbar" .}}
  8. </div>
  9. <div class="column center aligned">
  10. {{template "repo/issue/search" .}}
  11. </div>
  12. {{if not .Repository.IsArchived}}
  13. <div class="column right aligned">
  14. {{if .PageIsIssueList}}
  15. <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
  16. {{else}}
  17. <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.Repository.DefaultBranch}}...{{.PullRequestCtx.HeadInfo}}{{end}}">{{.i18n.Tr "repo.pulls.new"}}</a>
  18. {{end}}
  19. </div>
  20. {{end}}
  21. </div>
  22. <div class="ui divider"></div>
  23. <div id="issue-filters" class="ui stackable grid">
  24. <div class="six wide column">
  25. <div class="ui tiny basic status buttons">
  26. <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
  27. <i class="octicon octicon-issue-opened"></i>
  28. {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  29. </a>
  30. <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
  31. <i class="octicon octicon-issue-closed"></i>
  32. {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  33. </a>
  34. </div>
  35. </div>
  36. <div class="ten wide right aligned column">
  37. <div class="ui secondary filter stackable menu labels">
  38. <!-- Label -->
  39. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item" style="margin-left: auto">
  40. <span class="text">
  41. {{.i18n.Tr "repo.issues.filter_label"}}
  42. <i class="dropdown icon"></i>
  43. </span>
  44. <div class="menu">
  45. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
  46. {{range .Labels}}
  47. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.QueryString}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if .IsSelected}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}</a>
  48. {{end}}
  49. </div>
  50. </div>
  51. <!-- Milestone -->
  52. <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
  53. <span class="text">
  54. {{.i18n.Tr "repo.issues.filter_milestone"}}
  55. <i class="dropdown icon"></i>
  56. </span>
  57. <div class="menu">
  58. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_milestone_no_select"}}</a>
  59. {{range .Milestones}}
  60. <a class="{{if eq $.MilestoneID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&assignee={{$.AssigneeID}}">{{.Name}}</a>
  61. {{end}}
  62. </div>
  63. </div>
  64. <!-- Assignee -->
  65. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  66. <span class="text">
  67. {{.i18n.Tr "repo.issues.filter_assignee"}}
  68. <i class="dropdown icon"></i>
  69. </span>
  70. <div class="menu">
  71. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a>
  72. {{range .Assignees}}
  73. <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.ID}}"><img src="{{.RelAvatarLink}}"> {{.Name}}</a>
  74. {{end}}
  75. </div>
  76. </div>
  77. {{if .IsSigned}}
  78. <!-- Type -->
  79. <div class="ui dropdown type jump item">
  80. <span class="text">
  81. {{.i18n.Tr "repo.issues.filter_type"}}
  82. <i class="dropdown icon"></i>
  83. </span>
  84. <div class="menu">
  85. <a class="{{if eq .ViewType "all"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.all_issues"}}</a>
  86. <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{.SignedUser.ID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
  87. <a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.created_by_you"}}</a>
  88. <a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.mentioning_you"}}</a>
  89. </div>
  90. </div>
  91. {{end}}
  92. <!-- Sort -->
  93. <div class="ui dropdown type jump item">
  94. <span class="text">
  95. {{.i18n.Tr "repo.issues.filter_sort"}}
  96. <i class="dropdown icon"></i>
  97. </span>
  98. <div class="menu">
  99. <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
  100. <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
  101. <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  102. <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  103. <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a>
  104. <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a>
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. </div>
  110. <div id="issue-actions" class="ui stackable grid hide">
  111. <div class="six wide column">
  112. <div class="ui tiny basic status buttons">
  113. <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
  114. <i class="octicon octicon-issue-opened"></i>
  115. {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  116. </a>
  117. <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?q={{$.Keyword}}&type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
  118. <i class="octicon octicon-issue-closed"></i>
  119. {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  120. </a>
  121. </div>
  122. </div>
  123. {{/* Ten wide does not cope well and makes the columns stack.
  124. This seems to be related to jQuery's hide/show: in fact, switching
  125. issue-actions and issue-filters and having this ten wide will show
  126. this one correctly, but not the other one. */}}
  127. <div class="nine wide right aligned right floated column">
  128. <div class="ui secondary filter stackable menu">
  129. <!-- Action Button -->
  130. {{if .IsShowClosed}}
  131. <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>
  132. {{else}}
  133. <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>
  134. {{end}}
  135. <!-- Labels -->
  136. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
  137. <span class="text">
  138. {{.i18n.Tr "repo.issues.action_label"}}
  139. <i class="dropdown icon"></i>
  140. </span>
  141. <div class="menu">
  142. {{range .Labels}}
  143. <div class="item issue-action" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
  144. <span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name}}
  145. </div>
  146. {{end}}
  147. </div>
  148. </div>
  149. <!-- Milestone -->
  150. <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
  151. <span class="text">
  152. {{.i18n.Tr "repo.issues.action_milestone"}}
  153. <i class="dropdown icon"></i>
  154. </span>
  155. <div class="menu">
  156. <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone">
  157. {{.i18n.Tr "repo.issues.action_milestone_no_select"}}
  158. </div>
  159. {{range .Milestones}}
  160. <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
  161. {{.Name}}
  162. </div>
  163. {{end}}
  164. </div>
  165. </div>
  166. <!-- Assignees -->
  167. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  168. <span class="text">
  169. {{.i18n.Tr "repo.issues.action_assignee"}}
  170. <i class="dropdown icon"></i>
  171. </span>
  172. <div class="menu">
  173. <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee">
  174. {{.i18n.Tr "repo.issues.action_assignee_no_select"}}
  175. </div>
  176. {{range .Assignees}}
  177. <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
  178. <img src="{{.RelAvatarLink}}"> {{.Name}}
  179. </div>
  180. {{end}}
  181. </div>
  182. </div>
  183. </div>
  184. </div>
  185. </div>
  186. <div class="issue list">
  187. {{range .Issues}}
  188. <li class="item">
  189. {{if $.CanWriteIssuesOrPulls}}
  190. <div class="ui checkbox issue-checkbox">
  191. <input type="checkbox" data-issue-id={{.ID}}></input>
  192. </div>
  193. {{end}}
  194. <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div>
  195. <a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a>
  196. {{if .Ref}}
  197. <a class="ui label" href="{{$.RepoLink}}/src/branch/{{.Ref}}">{{.Ref}}</a>
  198. {{end}}
  199. {{range .Labels}}
  200. <a class="ui label has-emoji" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description}}">{{.Name}}</a>
  201. {{end}}
  202. {{if .NumComments}}
  203. <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
  204. {{end}}
  205. {{if .TotalTrackedTime}}
  206. <span class="comment ui right"><i class="octicon octicon-clock"></i> {{.TotalTrackedTime | Sec2Time}}</span>
  207. {{end}}
  208. <p class="desc">
  209. {{ $timeStr := TimeSinceUnix .GetLastEventTimestamp $.Lang }}
  210. {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink .Poster.Name | Safe}}
  211. {{$tasks := .GetTasks}}
  212. {{if gt $tasks 0}}
  213. {{$tasksDone := .GetTasksDone}}
  214. <span class="checklist">
  215. <span class="octicon octicon-checklist"></span> {{$tasksDone}} / {{$tasks}} <span class="progress-bar"><span class="progress" style="width:calc(100% * {{$tasksDone}} / {{$tasks}});"></span></span>
  216. </span>
  217. {{end}}
  218. {{if .Milestone}}
  219. <a class="milestone" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
  220. <span class="octicon octicon-milestone"></span> {{.Milestone.Name}}
  221. </a>
  222. {{end}}
  223. {{if ne .DeadlineUnix 0}}
  224. <span class="octicon octicon-calendar"></span>
  225. <span{{if .IsOverdue}} class="overdue"{{end}}>{{.DeadlineUnix.FormatShort}}</span>
  226. {{end}}
  227. {{range .Assignees}}
  228. <a class="ui right assignee poping up" href="{{.HomeLink}}" data-content="{{.Name}}" data-variation="inverted" data-position="left center">
  229. <img class="ui avatar image" src="{{.RelAvatarLink}}">
  230. </a>
  231. {{end}}
  232. </p>
  233. </li>
  234. {{end}}
  235. {{with .Page}}
  236. {{if gt .TotalPages 1}}
  237. <div class="center page buttons">
  238. <div class="ui borderless pagination menu">
  239. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}>
  240. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  241. </a>
  242. {{range .Pages}}
  243. {{if eq .Num -1}}
  244. <a class="disabled item">...</a>
  245. {{else}}
  246. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a>
  247. {{end}}
  248. {{end}}
  249. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}>
  250. {{$.i18n.Tr "repo.issues.next"}}&nbsp;<i class="icon right arrow"></i>
  251. </a>
  252. </div>
  253. </div>
  254. {{end}}
  255. {{end}}
  256. </div>
  257. </div>
  258. </div>
  259. {{template "base/footer" .}}