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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. </div>
  78. <button class="ui blue button" type="submit">{{.i18n.Tr "explore.search"}}</button>
  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. {{range .Issues}}
  104. {{ $timeStr:= TimeSinceUnix .CreatedUnix $.Lang }}
  105. {{if .Repo}}
  106. <li class="item">
  107. <div class="ui label">{{.Repo.FullName}}#{{.Index}}</div>
  108. <a class="title has-emoji" href="{{.HTMLURL}}">{{.Title}}</a>
  109. {{if .IsPull}}
  110. {{if (index $.CommitStatus .PullRequest.ID)}}
  111. {{template "repo/commit_status" (index $.CommitStatus .PullRequest.ID)}}
  112. {{end}}
  113. {{end}}
  114. {{with .Labels}}
  115. {{/* If we have any labels, we should show them
  116. with a 2.5 line height, this way they don't look
  117. awful and they don't stack on top of each other,
  118. especially on mobile views. */}}
  119. <span style="line-height: 2.5">
  120. {{range .}}
  121. <a class="ui label has-emoji" 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}}">{{.Name}}</a>
  122. {{end}}
  123. </span>
  124. {{end}}
  125. {{if .NumComments}}
  126. <span class="comment ui right">{{svg "octicon-comment" 16}} {{.NumComments}}</span>
  127. {{end}}
  128. {{if .TotalTrackedTime}}
  129. <span class="comment ui right">{{svg "octicon-clock" 16}} {{.TotalTrackedTime | Sec2Time}}</span>
  130. {{end}}
  131. <p class="desc">
  132. {{if .OriginalAuthor}}
  133. {{$.i18n.Tr .GetLastEventLabelFake $timeStr .OriginalAuthor | Safe}}
  134. {{else if gt .Poster.ID 0}}
  135. {{$.i18n.Tr .GetLastEventLabel $timeStr .Poster.HomeLink (.Poster.GetDisplayName|Escape) | Safe}}
  136. {{else}}
  137. {{$.i18n.Tr .GetLastEventLabelFake $timeStr (.Poster.GetDisplayName|Escape) | Safe}}
  138. {{end}}
  139. {{if .Milestone}}
  140. <a class="milestone" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}{{$.Link}}?q={{$.Keyword}}&type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
  141. {{svg "octicon-milestone" 16}} {{.Milestone.Name}}
  142. </a>
  143. {{end}}
  144. {{if .Ref}}
  145. <a class="ref" href="{{AppSubUrl}}/{{.Repo.Owner.Name}}/{{.Repo.Name}}/src/branch/{{.Ref}}">
  146. {{svg "octicon-git-branch" 16}} {{.Ref}}
  147. </a>
  148. {{end}}
  149. {{range .Assignees}}
  150. <a class="ui right assignee poping up" href="{{.HomeLink}}" data-content="{{.GetDisplayName}}" data-variation="inverted" data-position="left center">
  151. <img class="ui avatar image" src="{{.RelAvatarLink}}">
  152. </a>
  153. {{end}}
  154. {{$tasks := .GetTasks}}
  155. {{if gt $tasks 0}}
  156. {{$tasksDone := .GetTasksDone}}
  157. <span class="checklist">
  158. {{svg "octicon-checklist" 16}} {{$tasksDone}} / {{$tasks}} <span class="progress-bar"><span class="progress" style="width:calc(100% * {{$tasksDone}} / {{$tasks}});"></span></span>
  159. </span>
  160. {{end}}
  161. {{if ne .DeadlineUnix 0}}
  162. <span class="due-date poping up" data-content="{{$.i18n.Tr "repo.issues.due_date"}}" data-variation="tiny inverted" data-position="right center">
  163. {{svg "octicon-calendar" 16}}<span{{if .IsOverdue}} class="overdue"{{end}}>{{.DeadlineUnix.FormatShort}}</span>
  164. </span>
  165. {{end}}
  166. {{if .IsPull}}
  167. {{if and (not .PullRequest.HasMerged) ((len .PullRequest.ConflictedFiles) gt 0)}}
  168. <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>
  169. {{end}}
  170. {{end}}
  171. </p>
  172. </li>
  173. {{end}}
  174. {{end}}
  175. {{template "base/paginate" .}}
  176. </div>
  177. </div>
  178. </div>
  179. </div>
  180. </div>
  181. {{template "base/footer" .}}