Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

list.tmpl 16KB

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