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.

issues.tmpl 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. {{template "base/head" .}}
  2. <div class="dashboard issues">
  3. {{template "user/dashboard/navbar" .}}
  4. <div class="ui container">
  5. <div class="ui stackable grid">
  6. <div class="four wide column">
  7. <div class="ui secondary vertical filter menu">
  8. <a class="{{if eq .ViewType "your_repositories"}}ui basic blue button{{end}} item" href="{{.Link}}?type=your_repositories&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}">
  9. {{.i18n.Tr "home.issues.in_your_repos"}}
  10. <strong class="ui right">{{.IssueStats.YourRepositoriesCount}}</strong>
  11. </a>
  12. {{if not .ContextUser.IsOrganization}}
  13. <a class="{{if eq .ViewType "assigned"}}ui basic blue button{{end}} item" href="{{.Link}}?type=assigned&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}">
  14. {{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}
  15. <strong class="ui right">{{.IssueStats.AssignCount}}</strong>
  16. </a>
  17. <a class="{{if eq .ViewType "created_by"}}ui basic blue button{{end}} item" href="{{.Link}}?type=created_by&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}">
  18. {{.i18n.Tr "repo.issues.filter_type.created_by_you"}}
  19. <strong class="ui right">{{.IssueStats.CreateCount}}</strong>
  20. </a>
  21. <a class="{{if eq .ViewType "mentioned"}}ui basic blue button{{end}} item" href="{{.Link}}?type=mentioned&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state={{.State}}">
  22. {{.i18n.Tr "repo.issues.filter_type.mentioning_you"}}
  23. <strong class="ui right">{{.IssueStats.MentionCount}}</strong>
  24. </a>
  25. {{end}}
  26. <div class="ui divider"></div>
  27. <a class="{{if not $.RepoIDs}}ui basic blue button{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}">
  28. <span class="text truncate">All</span>
  29. <div class="ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">{{.TotalIssueCount}}</div>
  30. </a>
  31. {{range .Repos}}
  32. {{with $Repo := .}}
  33. <a class="{{range $.RepoIDs}}{{if eq . $Repo.ID}}ui basic blue button{{end}}{{end}} repo name item" href="{{$.Link}}?type={{$.ViewType}}&repos=[
  34. {{with $include := true}}
  35. {{range $.RepoIDs}}
  36. {{if eq . $Repo.ID}}
  37. {{$include = false}}
  38. {{else}}
  39. {{.}}%2C
  40. {{end}}
  41. {{end}}
  42. {{if eq $include true}}
  43. {{$Repo.ID}}%2C
  44. {{end}}
  45. {{end}}
  46. ]&sort={{$.SortType}}&state={{$.State}}&q={{$.Keyword}}" title="{{.FullName}}">
  47. <span class="text truncate">{{$Repo.FullName}}</span>
  48. <div class="ui {{if $.IsShowClosed}}red{{else}}green{{end}} label">{{index $.Counts $Repo.ID}}</div>
  49. </a>
  50. {{end}}
  51. {{end}}
  52. </div>
  53. </div>
  54. <div class="twelve wide column content">
  55. <div class="ui three column stackable grid">
  56. <div class="column">
  57. <div class="ui tiny basic status buttons">
  58. <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=open&q={{$.Keyword}}">
  59. {{svg "octicon-issue-opened" 16}}
  60. {{.i18n.Tr "repo.issues.open_tab" .ShownIssueStats.OpenCount}}
  61. </a>
  62. <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort={{$.SortType}}&state=closed&q={{$.Keyword}}">
  63. {{svg "octicon-issue-closed" 16}}
  64. {{.i18n.Tr "repo.issues.close_tab" .ShownIssueStats.ClosedCount}}
  65. </a>
  66. </div>
  67. </div>
  68. <div class="column center aligned">
  69. <form class="ui form ignore-dirty">
  70. <div class="ui fluid action input">
  71. <input type="hidden" name="type" value="{{$.ViewType}}"/>
  72. <input type="hidden" name="repos" value="[{{range $.RepoIDs}}{{.}}%2C{{end}}]"/>
  73. <input type="hidden" name="sort" value="{{$.SortType}}"/>
  74. <input type="hidden" name="state" value="{{$.State}}"/>
  75. <div class="ui search action input">
  76. <input name="q" value="{{$.Keyword}}" placeholder="{{.i18n.Tr "explore.search"}}..." autofocus>
  77. <button class="ui blue button" type="submit">{{.i18n.Tr "explore.search"}}</button>
  78. </div>
  79. </div>
  80. </form>
  81. </div>
  82. <div class="column right aligned">
  83. <!-- Sort -->
  84. <div class="ui dropdown type jump item">
  85. <span class="text">
  86. {{.i18n.Tr "repo.issues.filter_sort"}}
  87. <i class="dropdown icon"></i>
  88. </span>
  89. <div class="menu">
  90. <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=latest&state={{$.State}}&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
  91. <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=oldest&state={{$.State}}&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
  92. <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=recentupdate&state={{$.State}}&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  93. <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastupdate&state={{$.State}}&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  94. <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=mostcomment&state={{$.State}}&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a>
  95. <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=leastcomment&state={{$.State}}&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a>
  96. <a class="{{if eq .SortType "nearduedate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=nearduedate&state={{$.State}}&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.nearduedate"}}</a>
  97. <a class="{{if eq .SortType "farduedate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]&sort=farduedate&state={{$.State}}&q={{$.Keyword}}">{{.i18n.Tr "repo.issues.filter_sort.farduedate"}}</a>
  98. </div>
  99. </div>
  100. </div>
  101. </div>
  102. <div class="issue list">
  103. {{ $approvalCounts := .ApprovalCounts}}
  104. {{range .Issues}}
  105. {{ $timeStr:= TimeSinceUnix .CreatedUnix $.Lang }}
  106. {{if .Repo}}
  107. <li class="item">
  108. <div class="ui label">{{.Repo.FullName}}#{{.Index}}</div>
  109. <a class="title" href="{{.HTMLURL}}">{{RenderEmoji .Title}}</a>
  110. {{if .IsPull}}
  111. {{if (index $.CommitStatus .PullRequest.ID)}}
  112. {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
  113. {{end}}
  114. {{end}}
  115. {{with .Labels}}
  116. {{/* If we have any labels, we should show them
  117. with a 2.5 line height, this way they don't look
  118. awful and they don't stack on top of each other,
  119. especially on mobile views. */}}
  120. <span style="line-height: 2.5">
  121. {{range .}}
  122. <a class="ui label" href="{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&repos=[{{range $.RepoIDs}}{{.}}%2C{{end}}]" style="color: {{.ForegroundColor}}; background-color: {{.Color}}" title="{{.Description | RenderEmojiPlain}}">{{.Name | RenderEmoji}}</a>
  123. {{end}}
  124. </span>
  125. {{end}}
  126. {{if .NumComments}}
  127. <span class="comment ui right">{{svg "octicon-comment" 16}} {{.NumComments}}</span>
  128. {{end}}
  129. {{if .TotalTrackedTime}}
  130. <span class="comment ui right">{{svg "octicon-clock" 16}} {{.TotalTrackedTime | Sec2Time}}</span>
  131. {{end}}
  132. <p class="desc">
  133. {{if .OriginalAuthor}}
  134. {{$.i18n.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor | Safe}}
  135. {{else if gt .Poster.ID 0}}
  136. {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName|Escape) | Safe}}
  137. {{else}}
  138. {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName|Escape) | Safe}}
  139. {{end}}
  140. {{if .Milestone}}
  141. <a class="milestone" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
  142. {{svg "octicon-milestone" 16}} {{.Milestone.Name}}
  143. </a>
  144. {{end}}
  145. {{if .Ref}}
  146. <a class="ref" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}{{index $.IssueRefURLs .ID}}">
  147. {{svg "octicon-git-branch" 16}} {{index $.IssueRefEndNames .ID}}
  148. </a>
  149. {{end}}
  150. {{range .Assignees}}
  151. <a class="ui right assignee poping up" href="{{.HomeLink}}" data-content="{{.GetDisplayName}}" data-variation="inverted" data-position="left center">
  152. <img class="ui avatar image" src="{{.RelAvatarLink}}">
  153. </a>
  154. {{end}}
  155. {{$tasks := .GetTasks}}
  156. {{if gt $tasks 0}}
  157. {{$tasksDone := .GetTasksDone}}
  158. <span class="checklist">
  159. {{svg "octicon-checklist" 16}} {{$tasksDone}} / {{$tasks}} <span class="progress-bar"><span class="progress" style="width:calc(100% * {{$tasksDone}} / {{$tasks}});"></span></span>
  160. </span>
  161. {{end}}
  162. {{if ne .DeadlineUnix 0}}
  163. <span class="due-date poping up" data-content="{{$.i18n.Tr "repo.issues.due_date"}}" data-variation="tiny inverted" data-position="right center">
  164. {{svg "octicon-calendar" 16}}<span{{if .IsOverdue}} class="overdue"{{end}}>{{.DeadlineUnix.FormatShort}}</span>
  165. </span>
  166. {{end}}
  167. {{if .IsPull}}
  168. {{$approveOfficial := call $approvalCounts .ID "approve"}}
  169. {{$rejectOfficial := call $approvalCounts .ID "reject"}}
  170. {{$waitingOfficial := call $approvalCounts .ID "waiting"}}
  171. {{if gt $approveOfficial 0}}
  172. <span class="approvals">{{svg "octicon-check" 16}}
  173. {{$.i18n.Tr (TrN $.i18n.Lang $approveOfficial "repo.pulls.approve_count_1" "repo.pulls.approve_count_n") $approveOfficial}}
  174. </span>
  175. {{end}}
  176. {{if gt $rejectOfficial 0}}
  177. <span class="rejects">{{svg "octicon-request-changes" 16}}
  178. {{$.i18n.Tr (TrN $.i18n.Lang $rejectOfficial "repo.pulls.reject_count_1" "repo.pulls.reject_count_n") $rejectOfficial}}
  179. </span>
  180. {{end}}
  181. {{if gt $waitingOfficial 0}}
  182. <span class="waiting">{{svg "octicon-eye" 16}}
  183. {{$.i18n.Tr (TrN $.i18n.Lang $waitingOfficial "repo.pulls.waiting_count_1" "repo.pulls.waiting_count_n") $waitingOfficial}}
  184. </span>
  185. {{end}}
  186. {{if and (not .PullRequest.HasMerged) (gt (len .PullRequest.ConflictedFiles) 0)}}
  187. <span class="conflicting">{{svg "octicon-mirror" 16}} {{$.i18n.Tr (TrN $.i18n.Lang (len .PullRequest.ConflictedFiles) "repo.pulls.num_conflicting_files_1" "repo.pulls.num_conflicting_files_n") (len .PullRequest.ConflictedFiles)}}</span>
  188. {{end}}
  189. {{end}}
  190. </p>
  191. </li>
  192. {{end}}
  193. {{end}}
  194. {{template "base/paginate" .}}
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. </div>
  200. {{template "base/footer" .}}