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 17KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. {{template "base/head" .}}
  2. <div role="main" aria-label="{{.Title}}" class="page-content repository">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="ui three column grid issue-list-headers">
  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{{if .NewIssueChooseTemplate}}/choose{{end}}">{{.locale.Tr "repo.issues.new"}}</a>
  16. {{else}}
  17. <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.Repository.Link}}/compare/{{.Repository.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{.locale.Tr "repo.pulls.new"}}</a>
  18. {{end}}
  19. </div>
  20. {{else}}
  21. {{if not .PageIsIssueList}}
  22. <div class="column right aligned">
  23. <a class="ui green button {{if not .PullRequestCtx.Allowed}}disabled{{end}}" href="{{if .PullRequestCtx.Allowed}}{{.PullRequestCtx.BaseRepo.Link}}/compare/{{.PullRequestCtx.BaseRepo.DefaultBranch | PathEscapeSegments}}...{{if ne .Repository.Owner.Name .PullRequestCtx.BaseRepo.Owner.Name}}{{PathEscape .Repository.Owner.Name}}:{{end}}{{.Repository.DefaultBranch | PathEscapeSegments}}{{end}}">{{$.locale.Tr "action.compare_commits_general"}}</a>
  24. </div>
  25. {{end}}
  26. {{end}}
  27. </div>
  28. <div class="ui divider"></div>
  29. <div id="issue-filters" class="ui stackable grid">
  30. <div class="six wide column">
  31. {{if $.CanWriteIssuesOrPulls}}
  32. <div class="ui checkbox issue-checkbox-all vm">
  33. <input type="checkbox" title="{{.locale.Tr "repo.issues.action_check_all"}}">
  34. </div>
  35. {{end}}
  36. {{template "repo/issue/openclose" .}}
  37. </div>
  38. <div class="ten wide right aligned column">
  39. <div class="ui secondary filter stackable menu labels">
  40. <!-- Label -->
  41. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item label-filter" style="margin-left: auto">
  42. <span class="text">
  43. {{.locale.Tr "repo.issues.filter_label"}}
  44. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  45. </span>
  46. <div class="menu">
  47. <div class="ui icon search input">
  48. <i class="icon df ac jc">{{svg "octicon-search" 16}}</i>
  49. <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_label"}}">
  50. </div>
  51. <span class="info">{{.locale.Tr "repo.issues.filter_label_exclude" | Safe}}</span>
  52. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_label_no_select"}}</a>
  53. {{range .Labels}}
  54. <a class="item label-filter-item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.QueryString}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}" data-label-id="{{.ID}}">{{if .IsExcluded}}{{svg "octicon-circle-slash"}}{{else if .IsSelected}}{{svg "octicon-check"}}{{end}}<span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}</a>
  55. {{end}}
  56. </div>
  57. </div>
  58. <!-- Milestone -->
  59. <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
  60. <span class="text">
  61. {{.locale.Tr "repo.issues.filter_milestone"}}
  62. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  63. </span>
  64. <div class="menu">
  65. <div class="ui icon search input">
  66. <i class="icon df ac jc">{{svg "octicon-search" 16}}</i>
  67. <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_milestone"}}">
  68. </div>
  69. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_milestone_no_select"}}</a>
  70. {{range .Milestones}}
  71. <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.Name}}</a>
  72. {{end}}
  73. </div>
  74. </div>
  75. <!-- Project -->
  76. <div class="ui {{if not .Projects}}disabled{{end}} dropdown jump item">
  77. <span class="text">
  78. {{.locale.Tr "repo.issues.filter_project"}}
  79. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  80. </span>
  81. <div class="menu">
  82. <div class="ui icon search input">
  83. <i class="icon df ac jc">{{svg "octicon-search" 16}}</i>
  84. <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_project"}}">
  85. </div>
  86. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_project_no_select"}}</a>
  87. {{range .Projects}}
  88. <a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.Title}}</a>
  89. {{end}}
  90. </div>
  91. </div>
  92. <!-- Author -->
  93. <div class="ui {{if not .Posters}}disabled{{end}} dropdown jump item">
  94. <span class="text">
  95. {{.locale.Tr "repo.issues.filter_poster"}}
  96. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  97. </span>
  98. <div class="menu">
  99. <div class="ui icon search input">
  100. <i class="icon df ac jc">{{svg "octicon-search" 16}}</i>
  101. <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_poster"}}">
  102. </div>
  103. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}">{{.locale.Tr "repo.issues.filter_poster_no_select"}}</a>
  104. {{range .Posters}}
  105. <a class="{{if eq $.PosterID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{.ID}}">
  106. {{avatar .}} {{.GetDisplayName}}
  107. </a>
  108. {{end}}
  109. </div>
  110. </div>
  111. <!-- Assignee -->
  112. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  113. <span class="text">
  114. {{.locale.Tr "repo.issues.filter_assignee"}}
  115. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  116. </span>
  117. <div class="menu">
  118. <div class="ui icon search input">
  119. <i class="icon df ac jc">{{svg "octicon-search" 16}}</i>
  120. <input type="text" placeholder="{{.locale.Tr "repo.issues.filter_assignee"}}">
  121. </div>
  122. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_assginee_no_select"}}</a>
  123. {{range .Assignees}}
  124. <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}">
  125. {{avatar .}} {{.GetDisplayName}}
  126. </a>
  127. {{end}}
  128. </div>
  129. </div>
  130. {{if .IsSigned}}
  131. <!-- Type -->
  132. <div class="ui dropdown type jump item">
  133. <span class="text">
  134. {{.locale.Tr "repo.issues.filter_type"}}
  135. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  136. </span>
  137. <div class="menu">
  138. <a class="{{if eq .ViewType "all"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.all_issues"}}</a>
  139. <a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
  140. <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}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.created_by_you"}}</a>
  141. <a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.mentioning_you"}}</a>
  142. {{if .PageIsPullList}}
  143. <a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_type.review_requested"}}</a>
  144. {{end}}
  145. </div>
  146. </div>
  147. {{end}}
  148. <!-- Sort -->
  149. <div class="ui dropdown type jump item">
  150. <span class="text">
  151. {{.locale.Tr "repo.issues.filter_sort"}}
  152. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  153. </span>
  154. <div class="menu">
  155. <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}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.latest"}}</a>
  156. <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.oldest"}}</a>
  157. <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  158. <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  159. <a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
  160. <a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
  161. <a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
  162. <a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}">{{.locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. <div id="issue-actions" class="ui stackable grid hide">
  169. <div class="six wide column">
  170. {{template "repo/issue/openclose" .}}
  171. </div>
  172. {{/* Ten wide does not cope well and makes the columns stack.
  173. This seems to be related to jQuery's hide/show: in fact, switching
  174. issue-actions and issue-filters and having this ten wide will show
  175. this one correctly, but not the other one. */}}
  176. <div class="nine wide right aligned right floated column">
  177. <div class="ui secondary filter stackable menu">
  178. {{if not .Repository.IsArchived}}
  179. <!-- Action Button -->
  180. {{if .IsShowClosed}}
  181. <div class="ui green active basic button issue-action" data-action="open" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.locale.Tr "repo.issues.action_open"}}</div>
  182. {{else}}
  183. <div class="ui red active basic button issue-action" data-action="close" data-url="{{$.RepoLink}}/issues/status" style="margin-left: auto">{{.locale.Tr "repo.issues.action_close"}}</div>
  184. {{end}}
  185. <!-- Labels -->
  186. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
  187. <span class="text">
  188. {{.locale.Tr "repo.issues.action_label"}}
  189. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  190. </span>
  191. <div class="menu">
  192. {{range .Labels}}
  193. <div class="item issue-action" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/labels">
  194. {{if contain $.SelLabelIDs .ID}}{{svg "octicon-check"}}{{end}}<span class="label color" style="background-color: {{.Color}}"></span> {{.Name | RenderEmoji}}
  195. </div>
  196. {{end}}
  197. </div>
  198. </div>
  199. <!-- Milestone -->
  200. <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
  201. <span class="text">
  202. {{.locale.Tr "repo.issues.action_milestone"}}
  203. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  204. </span>
  205. <div class="menu">
  206. <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone">
  207. {{.locale.Tr "repo.issues.action_milestone_no_select"}}
  208. </div>
  209. {{range .Milestones}}
  210. <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/milestone">
  211. {{.Name}}
  212. </div>
  213. {{end}}
  214. </div>
  215. </div>
  216. <!-- Projects -->
  217. <div class="ui {{if not .Projects}}disabled{{end}} dropdown jump item">
  218. <span class="text">
  219. {{.locale.Tr "repo.project_board"}}
  220. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  221. </span>
  222. <div class="menu">
  223. <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/projects">
  224. {{.locale.Tr "repo.issues.new.no_projects"}}
  225. </div>
  226. {{range .Projects}}
  227. <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/projects">
  228. {{.Title}}
  229. </div>
  230. {{end}}
  231. </div>
  232. </div>
  233. <!-- Assignees -->
  234. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  235. <span class="text">
  236. {{.locale.Tr "repo.issues.action_assignee"}}
  237. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  238. </span>
  239. <div class="menu">
  240. <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee">
  241. {{.locale.Tr "repo.issues.action_assignee_no_select"}}
  242. </div>
  243. {{range .Assignees}}
  244. <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.RepoLink}}/issues/assignee">
  245. {{avatar .}} {{.GetDisplayName}}
  246. </div>
  247. {{end}}
  248. </div>
  249. </div>
  250. {{end}}
  251. </div>
  252. </div>
  253. </div>
  254. {{template "shared/issuelist" mergeinto . "listType" "repo"}}
  255. </div>
  256. </div>
  257. {{template "base/footer" .}}