list.tmpl 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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. <div class="ui right">
  8. {{if .PageIsIssueList}}
  9. <a class="ui green button" href="{{.RepoLink}}/issues/new">{{.i18n.Tr "repo.issues.new"}}</a>
  10. {{else}}
  11. <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>
  12. {{end}}
  13. </div>
  14. </div>
  15. <div class="ui divider"></div>
  16. <div class="ui tiny basic status buttons">
  17. <a class="ui {{if not .IsShowClosed}}green active{{end}} basic button" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state=open&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
  18. <i class="octicon octicon-issue-opened"></i>
  19. {{.i18n.Tr "repo.issues.open_tab" .IssueStats.OpenCount}}
  20. </a>
  21. <a class="ui {{if .IsShowClosed}}red active{{end}} basic button" href="{{$.Link}}?type={{.ViewType}}&sort={{$.SortType}}&state=closed&labels={{.SelectLabels}}&milestone={{.MilestoneID}}&assignee={{.AssigneeID}}">
  22. <i class="octicon octicon-issue-closed"></i>
  23. {{.i18n.Tr "repo.issues.close_tab" .IssueStats.ClosedCount}}
  24. </a>
  25. </div>
  26. <div class="ui right floated secondary filter menu">
  27. <!-- Label -->
  28. <div class="ui {{if not .Labels}}disabled{{end}} dropdown jump item">
  29. <span class="text">
  30. {{.i18n.Tr "repo.issues.filter_label"}}
  31. <i class="dropdown icon"></i>
  32. </span>
  33. <div class="menu">
  34. <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_label_no_select"}}</a>
  35. {{range .Labels}}
  36. <a class="item" href="{{$.Link}}?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}}</a>
  37. {{end}}
  38. </div>
  39. </div>
  40. <!-- Milestone -->
  41. <div class="ui {{if not .Milestones}}disabled{{end}} dropdown jump item">
  42. <span class="text">
  43. {{.i18n.Tr "repo.issues.filter_milestone"}}
  44. <i class="dropdown icon"></i>
  45. </span>
  46. <div class="menu">
  47. <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_milestone_no_select"}}</a>
  48. {{range .Milestones}}
  49. <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>
  50. {{end}}
  51. </div>
  52. </div>
  53. <!-- Assignee -->
  54. <div class="ui {{if not .Assignees}}disabled{{end}} dropdown jump item">
  55. <span class="text">
  56. {{.i18n.Tr "repo.issues.filter_assignee"}}
  57. <i class="dropdown icon"></i>
  58. </span>
  59. <div class="menu">
  60. <a class="item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}">{{.i18n.Tr "repo.issues.filter_assginee_no_select"}}</a>
  61. {{range .Assignees}}
  62. <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>
  63. {{end}}
  64. </div>
  65. </div>
  66. <!-- Type -->
  67. <div class="ui dropdown type jump item">
  68. <span class="text">
  69. {{.i18n.Tr "repo.issues.filter_type"}}
  70. <i class="dropdown icon"></i>
  71. </span>
  72. <div class="menu">
  73. <a class="{{if eq .ViewType "all"}}active{{end}} item" href="{{$.Link}}?type=all&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.all_issues"}}</a>
  74. <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{$.Link}}?type=assigned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.assigned_to_you"}}</a>
  75. <a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{$.Link}}?type=created_by&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.created_by_you"}}</a>
  76. <a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{$.Link}}?type=mentioned&sort={{$.SortType}}&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_type.mentioning_you"}}</a>
  77. </div>
  78. </div>
  79. <!-- Sort -->
  80. <div class="ui dropdown type jump item">
  81. <span class="text">
  82. {{.i18n.Tr "repo.issues.filter_sort"}}
  83. <i class="dropdown icon"></i>
  84. </span>
  85. <div class="menu">
  86. <a class="{{if or (eq .SortType "latest") (not .SortType)}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=latest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.latest"}}</a>
  87. <a class="{{if eq .SortType "oldest"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=oldest&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.oldest"}}</a>
  88. <a class="{{if eq .SortType "recentupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=recentupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  89. <a class="{{if eq .SortType "leastupdate"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=leastupdate&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  90. <a class="{{if eq .SortType "mostcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=mostcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.mostcomment"}}</a>
  91. <a class="{{if eq .SortType "leastcomment"}}active{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort=leastcomment&state={{$.State}}&labels={{.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}">{{.i18n.Tr "repo.issues.filter_sort.leastcomment"}}</a>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="issue list">
  96. {{range .Issues}}
  97. {{ $timeStr:= TimeSince .Created $.Lang }}
  98. <li class="item">
  99. <div class="ui {{if .IsRead}}black{{else}}green{{end}} label">#{{.Index}}</div>
  100. <a class="title has-emoji" href="{{$.Link}}/{{.Index}}">{{.Name}}</a>
  101. {{range .Labels}}
  102. <a class="ui label" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{.ID}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}" style="color: {{.ForegroundColor}}; background-color: {{.Color}}">{{.Name}}</a>
  103. {{end}}
  104. {{if .NumComments}}
  105. <span class="comment ui right"><i class="octicon octicon-comment"></i> {{.NumComments}}</span>
  106. {{end}}
  107. <p class="desc">
  108. {{$.i18n.Tr "repo.issues.opened_by" $timeStr .Poster.HomeLink .Poster.Name | Safe}}
  109. {{if .Milestone}}
  110. <a class="milestone" href="{{$.Link}}?type={{$.ViewType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{.Milestone.ID}}&assignee={{$.AssigneeID}}">
  111. <span class="octicon octicon-milestone"></span> {{.Milestone.Name}}
  112. </a>
  113. {{end}}
  114. {{if .Assignee}}
  115. <a class="ui right assignee poping up" href="{{.Assignee.HomeLink}}" data-content="{{.Assignee.Name}}" data-variation="inverted" data-position="left center">
  116. <img class="ui avatar image" src="{{.Assignee.RelAvatarLink}}">
  117. </a>
  118. {{end}}
  119. </p>
  120. </li>
  121. {{end}}
  122. {{with .Page}}
  123. {{if gt .TotalPages 1}}
  124. <div class="center page buttons">
  125. <div class="ui borderless pagination menu">
  126. <a class="{{if not .HasPrevious}}disabled{{end}} item" {{if .HasPrevious}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Previous}}"{{end}}>
  127. <i class="left arrow icon"></i> {{$.i18n.Tr "repo.issues.previous"}}
  128. </a>
  129. {{range .Pages}}
  130. {{if eq .Num -1}}
  131. <a class="disabled item">...</a>
  132. {{else}}
  133. <a class="{{if .IsCurrent}}active{{end}} item" {{if not .IsCurrent}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Num}}"{{end}}>{{.Num}}</a>
  134. {{end}}
  135. {{end}}
  136. <a class="{{if not .HasNext}}disabled{{end}} item" {{if .HasNext}}href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&assignee={{$.AssigneeID}}&page={{.Next}}"{{end}}>
  137. {{$.i18n.Tr "repo.issues.next"}}&nbsp;<i class="icon right arrow"></i>
  138. </a>
  139. </div>
  140. </div>
  141. {{end}}
  142. {{end}}
  143. </div>
  144. </div>
  145. </div>
  146. {{template "base/footer" .}}