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.

filter_list.tmpl 16KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <!-- Label -->
  2. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item label-filter">
  3. <span class="text">
  4. {{ctx.Locale.Tr "repo.issues.filter_label"}}
  5. </span>
  6. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  7. <div class="menu">
  8. <div class="ui icon search input">
  9. <i class="icon">{{svg "octicon-search" 16}}</i>
  10. <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_label"}}">
  11. </div>
  12. <div class="ui checkbox compact archived-label-filter">
  13. <input name="archived" type="checkbox"
  14. id="archived-filter-checkbox"
  15. {{if .ShowArchivedLabels}}checked{{end}}
  16. >
  17. <label for="archived-filter-checkbox">
  18. {{ctx.Locale.Tr "repo.issues.label_archived_filter"}}
  19. <i class="gt-ml-2" data-tooltip-content={{ctx.Locale.Tr "repo.issues.label_archive_tooltip"}}>
  20. {{svg "octicon-info"}}
  21. </i>
  22. </label>
  23. </div>
  24. <span class="info">{{ctx.Locale.Tr "repo.issues.filter_label_exclude"}}</span>
  25. <div class="divider"></div>
  26. <a class="{{if .AllLabels}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_label_no_select"}}</a>
  27. <a class="{{if .NoLabel}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels=0&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_label_select_no_label"}}</a>
  28. {{$previousExclusiveScope := "_no_scope"}}
  29. {{range .Labels}}
  30. {{$exclusiveScope := .ExclusiveScope}}
  31. {{if and (ne $previousExclusiveScope $exclusiveScope)}}
  32. <div class="divider"></div>
  33. {{end}}
  34. {{$previousExclusiveScope = $exclusiveScope}}
  35. <a class="item label-filter-item tw-flex tw-content-center" {{if .IsArchived}}data-is-archived{{end}} href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.QueryString}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}" data-label-id="{{.ID}}">
  36. {{if .IsExcluded}}
  37. {{svg "octicon-circle-slash"}}
  38. {{else if .IsSelected}}
  39. {{if $exclusiveScope}}
  40. {{svg "octicon-dot-fill"}}
  41. {{else}}
  42. {{svg "octicon-check"}}
  43. {{end}}
  44. {{end}}
  45. {{RenderLabel $.Context ctx.Locale .}}
  46. <p class="tw-ml-auto">{{template "repo/issue/labels/label_archived" .}}</p>
  47. </a>
  48. {{end}}
  49. </div>
  50. </div>
  51. {{if not .Milestone}}
  52. <!-- Milestone -->
  53. <div class="ui {{if not (or .OpenMilestones .ClosedMilestones)}}disabled{{end}} dropdown jump item">
  54. <span class="text">
  55. {{ctx.Locale.Tr "repo.issues.filter_milestone"}}
  56. </span>
  57. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  58. <div class="menu">
  59. <div class="ui icon search input">
  60. <i class="icon">{{svg "octicon-search" 16}}</i>
  61. <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_milestone"}}">
  62. </div>
  63. <div class="divider"></div>
  64. <a class="{{if not $.MilestoneID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=0&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_all"}}</a>
  65. <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID -1}}active selected {{end}}{{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone=-1&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_milestone_none"}}</a>
  66. {{if .OpenMilestones}}
  67. <div class="divider"></div>
  68. <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_open"}}</div>
  69. {{range .OpenMilestones}}
  70. <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">
  71. {{svg "octicon-milestone" 16 "mr-2"}}
  72. {{.Name}}
  73. </a>
  74. {{end}}
  75. {{end}}
  76. {{if .ClosedMilestones}}
  77. <div class="divider"></div>
  78. <div class="header">{{ctx.Locale.Tr "repo.issues.filter_milestone_closed"}}</div>
  79. {{range .ClosedMilestones}}
  80. <a class="{{if $.MilestoneID}}{{if eq $.MilestoneID .ID}}active selected {{end}}{{end}}item" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.ID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">
  81. {{svg "octicon-milestone" 16 "mr-2"}}
  82. {{.Name}}
  83. </a>
  84. {{end}}
  85. {{end}}
  86. </div>
  87. </div>
  88. {{end}}
  89. <!-- Project -->
  90. <div class="ui{{if not (or .OpenProjects .ClosedProjects)}} disabled{{end}} dropdown jump item">
  91. <span class="text">
  92. {{ctx.Locale.Tr "repo.issues.filter_project"}}
  93. </span>
  94. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  95. <div class="menu">
  96. <div class="ui icon search input">
  97. <i class="icon">{{svg "octicon-search" 16}}</i>
  98. <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_project"}}">
  99. </div>
  100. <a class="{{if not .ProjectID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_project_all"}}</a>
  101. <a class="{{if eq .ProjectID -1}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&project=-1&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_project_none"}}</a>
  102. {{if .OpenProjects}}
  103. <div class="divider"></div>
  104. <div class="header">
  105. {{ctx.Locale.Tr "repo.issues.new.open_projects"}}
  106. </div>
  107. {{range .OpenProjects}}
  108. <a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item tw-flex" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">
  109. {{svg .IconName 18 "gt-mr-3 tw-shrink-0"}}<span class="gt-ellipsis">{{.Title}}</span>
  110. </a>
  111. {{end}}
  112. {{end}}
  113. {{if .ClosedProjects}}
  114. <div class="divider"></div>
  115. <div class="header">
  116. {{ctx.Locale.Tr "repo.issues.new.closed_projects"}}
  117. </div>
  118. {{range .ClosedProjects}}
  119. <a class="{{if $.ProjectID}}{{if eq $.ProjectID .ID}}active selected{{end}}{{end}} item" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{.ID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">
  120. {{svg .IconName 18 "gt-mr-3"}}{{.Title}}
  121. </a>
  122. {{end}}
  123. {{end}}
  124. </div>
  125. </div>
  126. <!-- Author -->
  127. <div class="ui dropdown jump item user-remote-search" data-tooltip-content="{{ctx.Locale.Tr "repo.author_search_tooltip"}}"
  128. data-search-url="{{if .Milestone}}{{$.RepoLink}}/issues/posters{{else}}{{$.Link}}/posters{{end}}"
  129. data-selected-user-id="{{$.PosterID}}"
  130. data-action-jump-url="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={user_id}{{if $.ShowArchivedLabels}}&archived=true{{end}}"
  131. >
  132. <span class="text">
  133. {{ctx.Locale.Tr "repo.issues.filter_poster"}}
  134. </span>
  135. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  136. <div class="menu">
  137. <div class="ui icon search input">
  138. <i class="icon">{{svg "octicon-search" 16}}</i>
  139. <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_poster"}}">
  140. </div>
  141. <a class="item" data-value="0">{{ctx.Locale.Tr "repo.issues.filter_poster_no_select"}}</a>
  142. </div>
  143. </div>
  144. <!-- Assignee -->
  145. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  146. <span class="text">
  147. {{ctx.Locale.Tr "repo.issues.filter_assignee"}}
  148. </span>
  149. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  150. <div class="menu">
  151. <div class="ui icon search input">
  152. <i class="icon">{{svg "octicon-search" 16}}</i>
  153. <input type="text" placeholder="{{ctx.Locale.Tr "repo.issues.filter_assignee"}}">
  154. </div>
  155. <a class="{{if not .AssigneeID}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_select"}}</a>
  156. <a class="{{if eq .AssigneeID -1}}active selected {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee=-1&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_assginee_no_assignee"}}</a>
  157. <div class="divider"></div>
  158. {{range .Assignees}}
  159. <a class="{{if eq $.AssigneeID .ID}}active selected{{end}} item tw-flex" href="?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{.ID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">
  160. {{ctx.AvatarUtils.Avatar . 20}}{{template "repo/search_name" .}}
  161. </a>
  162. {{end}}
  163. </div>
  164. </div>
  165. {{if .IsSigned}}
  166. <!-- Type -->
  167. <div class="ui dropdown type jump item">
  168. <span class="text">
  169. {{ctx.Locale.Tr "repo.issues.filter_type"}}
  170. </span>
  171. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  172. <div class="menu">
  173. <a class="{{if eq .ViewType "all"}}active {{end}}item" href="?q={{$.Keyword}}&type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.all_issues"}}</a>
  174. <a class="{{if eq .ViewType "assigned"}}active {{end}}item" href="?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
  175. <a class="{{if eq .ViewType "created_by"}}active {{end}}item" href="?q={{$.Keyword}}&type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}</a>
  176. {{if .PageIsPullList}}
  177. <a class="{{if eq .ViewType "review_requested"}}active {{end}}item" href="?q={{$.Keyword}}&type=review_requested&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}</a>
  178. <a class="{{if eq .ViewType "reviewed_by"}}active {{end}}item" href="?q={{$.Keyword}}&type=reviewed_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}</a>
  179. {{end}}
  180. <a class="{{if eq .ViewType "mentioned"}}active {{end}}item" href="?q={{$.Keyword}}&type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}</a>
  181. </div>
  182. </div>
  183. {{end}}
  184. <!-- Sort -->
  185. <div class="list-header-sort ui small dropdown downward type jump item">
  186. <span class="text">
  187. {{ctx.Locale.Tr "repo.issues.filter_sort"}}
  188. </span>
  189. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  190. <div class="menu">
  191. <a class="{{if or (eq .SortType "latest") (not .SortType)}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
  192. <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
  193. <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  194. <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  195. <a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
  196. <a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
  197. <a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=nearduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
  198. <a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="?q={{$.Keyword}}&type={{$.ViewType}}&sort=farduedate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{$.PosterID}}{{if $.ShowArchivedLabels}}&archived=true{{end}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
  199. </div>
  200. </div>