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.

220 lines
12 KiB

9 years ago
9 years ago
9 years ago
  1. {{template "base/head" .}}
  2. <div class="repository">
  3. {{template "repo/header" .}}
  4. <div class="ui container">
  5. <div class="navbar">
  6. {{template "repo/issue/navbar" .}}
  7. {{template "repo/issue/search" .}}
  8. <div class="ui right">
  9. {{if .PageIsIssueList}}
  10. <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
  11. {{else}}
  12. <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>
  13. {{end}}
  14. </div>
  15. </div>
  16. <div class="ui divider"></div>
  17. <div class="issue-filters">
  18. <div class="ui tiny basic status buttons">
  19. <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}}">
  20. <i class="octicon octicon-issue-opened"></i>
  21. {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  22. </a>
  23. <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}}">
  24. <i class="octicon octicon-issue-closed"></i>
  25. {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  26. </a>
  27. </div>
  28. <div class="ui right floated secondary filter menu">
  29. <!-- Label -->
  30. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
  31. <span class="text">
  32. {{.i18n.Tr "repo.issues.filter_label"}}
  33. <i class="dropdown icon"></i>
  34. </span>
  35. <div class="menu">
  36. <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>
  37. {{range .Labels}}
  38. <a class="item" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}"><span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | Sanitize}}</a>
  39. {{end}}
  40. </div>
  41. </div>
  42. <!-- Milestone -->
  43. <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
  44. <span class="text">
  45. {{.i18n.Tr "repo.issues.filter_milestone"}}
  46. <i class="dropdown icon"></i>
  47. </span>
  48. <div class="menu">
  49. <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>
  50. {{range .Milestones}}
  51. <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 | Sanitize}}</a>
  52. {{end}}
  53. </div>
  54. </div>
  55. <!-- Assignee -->
  56. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  57. <span class="text">
  58. {{.i18n.Tr "repo.issues.filter_assignee"}}
  59. <i class="dropdown icon"></i>
  60. </span>
  61. <div class="menu">
  62. <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>
  63. {{range .Assignees}}
  64. <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>
  65. {{end}}
  66. </div>
  67. </div>
  68. <!-- Type -->
  69. <div class="ui dropdown type jump item">
  70. <span class="text">
  71. {{.i18n.Tr "repo.issues.filter_type"}}
  72. <i class="dropdown icon"></i>
  73. </span>
  74. <div class="menu">
  75. <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>
  76. <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?q={{$.Keyword}}&type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
  77. <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>
  78. <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>
  79. </div>
  80. </div>
  81. <!-- Sort -->
  82. <div class="ui dropdown type jump item">
  83. <span class="text">
  84. {{.i18n.Tr "repo.issues.filter_sort"}}
  85. <i class="dropdown icon"></i>
  86. </span>
  87. <div class="menu">
  88. <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>
  89. <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>
  90. <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>
  91. <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>
  92. <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>
  93. <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>
  94. </div>
  95. </div>
  96. </div>
  97. </div>
  98. <div class="issue-actions">
  99. <div class="ui basic status buttons">
  100. <div class="ui green active basic button issue-action" data-action="open" data-url="{{$.Link}}/status">{{.i18n.Tr "repo.issues.action_open"}}</div>
  101. <div class="ui red active basic button issue-action" data-action="close" data-url="{{$.Link}}/status">{{.i18n.Tr "repo.issues.action_close"}}</div>
  102. </div>
  103. <div class="ui secondary filter menu floated right">
  104. <!-- Labels -->
  105. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
  106. <span class="text">
  107. {{.i18n.Tr "repo.issues.action_label"}}
  108. <i class="dropdown icon"></i>
  109. </span>
  110. <div class="menu">
  111. {{range .Labels}}
  112. <div class="item issue-action" data-action="toggle" data-element-id="{{.ID}}" data-url="{{$.Link}}/labels">
  113. <span class="octicon {{if eq $.SelectLabels .ID}}octicon-check{{end}}"></span><span class="label color" style="background-color: {{.Color}}"></span> {{.Name | Sanitize}}
  114. </div>
  115. {{end}}
  116. </div>
  117. </div>
  118. <!-- Milestone -->
  119. <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
  120. <span class="text">
  121. {{.i18n.Tr "repo.issues.action_milestone"}}
  122. <i class="dropdown icon"></i>
  123. </span>
  124. <div class="menu">
  125. <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/milestone">
  126. {{.i18n.Tr "repo.issues.action_milestone_no_select"}}
  127. </div>
  128. {{range .Milestones}}
  129. <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.Link}}/milestone">
  130. {{.Name | Sanitize}}
  131. </div>
  132. {{end}}
  133. </div>
  134. </div>
  135. <!-- Assignee -->
  136. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  137. <span class="text">
  138. {{.i18n.Tr "repo.issues.action_assignee"}}
  139. <i class="dropdown icon"></i>
  140. </span>
  141. <div class="menu">
  142. <div class="item issue-action" data-element-id="0" data-url="{{$.Link}}/assignee">
  143. {{.i18n.Tr "repo.issues.action_assignee_no_select"}}
  144. </div>
  145. {{range .Assignees}}
  146. <div class="item issue-action" data-element-id="{{.ID}}" data-url="{{$.Link}}/assignee">
  147. <img src="{{.RelAvatarLink}}"> {{.Name}}
  148. </div>
  149. {{end}}
  150. </div>
  151. </div>
  152. </div>
  153. </div>
  154. <div class="issue list">
  155. {{range .Issues}}
  156. {{ $timeStr:= TimeSince .Created $.Lang }}
  157. <li class="item">
  158. <div class="ui checkbox issue-checkbox">
  159. <input type="checkbox" data-issue-id={{.ID}}></input>
  160. </div>
  161. <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div>
  162. <a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Title}}</a>
  163. {{range .Labels}}
  164. <a class="ui label" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}">{{.Name | Sanitize}}</a>
  165. {{end}}
  166. {{if .NumComments}}
  167. <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
  168. {{end}}
  169. <p class="desc">
  170. {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
  171. {{if .Milestone}}
  172. <a class="milestone" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
  173. <span class="octicon octicon-milestone"></span> {{.Milestone.Name | Sanitize}}
  174. </a>
  175. {{end}}
  176. {{if .Assignee}}
  177. <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center">
  178. <img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}">
  179. </a>
  180. {{end}}
  181. </p>
  182. </li>
  183. {{end}}
  184. {{with .Page}}
  185. {{if gt .TotalPages 1}}
  186. <div class="center page buttons">
  187. <div class="ui borderless pagination menu">
  188. <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}}>
  189. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  190. </a>
  191. {{range .Pages}}
  192. {{if eq .Num -1}}
  193. <a class="disabled item">...</a>
  194. {{else}}
  195. <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>
  196. {{end}}
  197. {{end}}
  198. <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}}>
  199. {{$.i18n.Tr "repo.issues.next"}}&nbsp;<i class="icon right arrow"></i>
  200. </a>
  201. </div>
  202. </div>
  203. {{end}}
  204. {{end}}
  205. </div>
  206. </div>
  207. </div>
  208. {{template "base/footer" .}}