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.

151 lines
9.3 KiB

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