gitea源码

issues.tmpl 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. {{template "base/head" .}}
  2. <div role="main" aria-label="{{.Title}}" class="page-content dashboard issues">
  3. {{template "user/dashboard/navbar" .}}
  4. <div class="ui container">
  5. {{template "base/alert" .}}
  6. <div class="flex-container">
  7. {{$queryLink := QueryBuild "?" "type" $.ViewType "sort" $.SortType "state" $.State "q" $.Keyword "labels" .SelectLabels "search_mode" $.SelectedSearchMode}}
  8. <div class="flex-container-nav">
  9. <div class="ui secondary vertical filter menu tw-bg-transparent">
  10. <a class="{{if eq .ViewType "your_repositories"}}active{{end}} item" href="{{QueryBuild $queryLink "type" "your_repositories"}}">
  11. {{ctx.Locale.Tr "home.issues.in_your_repos"}}
  12. <strong>{{CountFmt .IssueStats.YourRepositoriesCount}}</strong>
  13. </a>
  14. <a class="{{if eq .ViewType "assigned"}}active{{end}} item" href="{{QueryBuild $queryLink "type" "assigned"}}">
  15. {{ctx.Locale.Tr "repo.issues.filter_type.assigned_to_you"}}
  16. <strong>{{CountFmt .IssueStats.AssignCount}}</strong>
  17. </a>
  18. <a class="{{if eq .ViewType "created_by"}}active{{end}} item" href="{{QueryBuild $queryLink "type" "created_by"}}">
  19. {{ctx.Locale.Tr "repo.issues.filter_type.created_by_you"}}
  20. <strong>{{CountFmt .IssueStats.CreateCount}}</strong>
  21. </a>
  22. {{if .PageIsPulls}}
  23. <a class="{{if eq .ViewType "review_requested"}}active{{end}} item" href="{{QueryBuild $queryLink "type" "review_requested"}}">
  24. {{ctx.Locale.Tr "repo.issues.filter_type.review_requested"}}
  25. <strong>{{CountFmt .IssueStats.ReviewRequestedCount}}</strong>
  26. </a>
  27. <a class="{{if eq .ViewType "reviewed_by"}}active{{end}} item" href="{{QueryBuild $queryLink "type" "reviewed_by"}}">
  28. {{ctx.Locale.Tr "repo.issues.filter_type.reviewed_by_you"}}
  29. <strong>{{CountFmt .IssueStats.ReviewedCount}}</strong>
  30. </a>
  31. {{end}}
  32. <a class="{{if eq .ViewType "mentioned"}}active{{end}} item" href="{{QueryBuild $queryLink "type" "mentioned"}}">
  33. {{ctx.Locale.Tr "repo.issues.filter_type.mentioning_you"}}
  34. <strong>{{CountFmt .IssueStats.MentionCount}}</strong>
  35. </a>
  36. </div>
  37. </div>
  38. {{$queryLinkWithFilter := QueryBuild $queryLink "poster" $.FilterPosterUsername "assignee" $.FilterAssigneeUsername}}
  39. <div class="flex-container-main content">
  40. <div class="list-header">
  41. <div class="small-menu-items ui compact tiny menu list-header-toggle flex-items-block">
  42. <a class="item{{if not .IsShowClosed}} active{{end}}" href="{{QueryBuild $queryLink "state" "open"}}">
  43. {{svg "octicon-issue-opened"}}
  44. {{ctx.Locale.PrettyNumber .IssueStats.OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
  45. </a>
  46. <a class="item{{if .IsShowClosed}} active{{end}}" href="{{QueryBuild $queryLink "state" "closed"}}">
  47. {{svg "octicon-issue-closed"}}
  48. {{ctx.Locale.PrettyNumber .IssueStats.ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
  49. </a>
  50. </div>
  51. <form class="list-header-search ui form ignore-dirty">
  52. <input type="hidden" name="type" value="{{$.ViewType}}">
  53. <input type="hidden" name="sort" value="{{$.SortType}}">
  54. <input type="hidden" name="state" value="{{$.State}}">
  55. {{template "shared/search/combo" (dict
  56. "Value" $.Keyword
  57. "Placeholder" (ctx.Locale.Tr (Iif .PageIsPulls "search.pull_kind" "search.issue_kind"))
  58. "Tooltip" (ctx.Locale.Tr "explore.go_to")
  59. "SearchModes" .SearchModes
  60. "SelectedSearchMode" .SelectedSearchMode
  61. )}}
  62. </form>
  63. <div class="list-header-filters">
  64. {{if $.Labels}}
  65. {{template "repo/issue/filter_item_label" dict "Labels" .Labels "QueryLink" $queryLinkWithFilter "SupportArchivedLabel" true}}
  66. {{end}}
  67. {{/* at the moment there is no easy way to get poster candidates on this page, so only show a username input, search for what the end user enters */}}
  68. {{if ne $.ViewType "created_by"}}
  69. {{template "repo/issue/filter_item_user_fetch" dict
  70. "QueryParamKey" "poster"
  71. "QueryLink" $queryLinkWithFilter
  72. "SelectedUsername" $.FilterPosterUsername
  73. "TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_poster")
  74. }}
  75. {{end}}
  76. {{/* at the moment there is no easy way to get assignee candidates on this page, so only show a username input, search for what the end user enters */}}
  77. {{if ne $.ViewType "assigned"}}
  78. {{template "repo/issue/filter_item_user_fetch" dict
  79. "QueryParamKey" "assignee"
  80. "QueryLink" $queryLinkWithFilter
  81. "SelectedUsername" $.FilterAssigneeUsername
  82. "TextFilterTitle" (ctx.Locale.Tr "repo.issues.filter_assignee")
  83. }}
  84. {{end}}
  85. <!-- Sort -->
  86. <div class="item ui small dropdown jump">
  87. <span class="text tw-whitespace-nowrap">
  88. {{ctx.Locale.Tr "repo.issues.filter_sort"}}
  89. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  90. </span>
  91. <div class="menu">
  92. <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="{{QueryBuild $queryLinkWithFilter "sort" "recentupdate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  93. <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="{{QueryBuild $queryLinkWithFilter "sort" "leastupdate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  94. <a class="{{if eq .SortType "latest"}}active {{end}}item" href="{{QueryBuild $queryLinkWithFilter "sort" "latest"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.latest"}}</a>
  95. <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="{{QueryBuild $queryLinkWithFilter "sort" "oldest"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
  96. <a class="{{if eq .SortType "mostcomment"}}active {{end}}item" href="{{QueryBuild $queryLinkWithFilter "sort" "mostcomment"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.mostcomment"}}</a>
  97. <a class="{{if eq .SortType "leastcomment"}}active {{end}}item" href="{{QueryBuild $queryLinkWithFilter "sort" "leastcomment"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastcomment"}}</a>
  98. <a class="{{if eq .SortType "nearduedate"}}active {{end}}item" href="{{QueryBuild $queryLinkWithFilter "sort" "nearduedate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.nearduedate"}}</a>
  99. <a class="{{if eq .SortType "farduedate"}}active {{end}}item" href="{{QueryBuild $queryLinkWithFilter "sort" "farduedate"}}">{{ctx.Locale.Tr "repo.issues.filter_sort.farduedate"}}</a>
  100. </div>
  101. </div>
  102. </div>
  103. </div>
  104. {{template "shared/issuelist" dict "." . "listType" "dashboard"}}
  105. </div>
  106. </div>
  107. </div>
  108. </div>
  109. {{template "base/footer" .}}