gitea源码

list.tmpl 4.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
  2. <div class="flex-text-block tw-justify-between tw-mb-4">
  3. <div class="small-menu-items ui compact tiny menu list-header-toggle">
  4. <a class="item{{if not .IsShowClosed}} active{{end}}" href="?state=open&q={{$.Keyword}}">
  5. {{svg "octicon-project-symlink" 16 "tw-mr-2"}}
  6. {{ctx.Locale.PrettyNumber .OpenCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
  7. </a>
  8. <a class="item{{if .IsShowClosed}} active{{end}}" href="?state=closed&q={{$.Keyword}}">
  9. {{svg "octicon-check" 16 "tw-mr-2"}}
  10. {{ctx.Locale.PrettyNumber .ClosedCount}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
  11. </a>
  12. </div>
  13. <a class="ui small primary button" href="{{$.Link}}/new">{{ctx.Locale.Tr "repo.projects.new"}}</a>
  14. </div>
  15. {{end}}
  16. {{template "base/alert" .}}
  17. <div class="list-header">
  18. <!-- Search -->
  19. <form class="list-header-search ui form ignore-dirty">
  20. <input type="hidden" name="state" value="{{$.State}}">
  21. {{template "shared/search/combo" dict "Value" .Keyword "Placeholder" (ctx.Locale.Tr "search.project_kind")}}
  22. </form>
  23. <div class="list-header-filters">
  24. <!-- Sort -->
  25. <div class="item ui small dropdown jump">
  26. <span class="text">
  27. {{ctx.Locale.Tr "repo.issues.filter_sort"}}
  28. </span>
  29. {{svg "octicon-triangle-down" 14 "dropdown icon"}}
  30. <div class="menu">
  31. <a class="{{if eq .SortType "oldest"}}active {{end}}item" href="?q={{$.Keyword}}&sort=oldest&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.oldest"}}</a>
  32. <a class="{{if eq .SortType "alphabetically"}}active {{end}}item" href="?q={{$.Keyword}}&sort=alphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.alphabetically"}}</a>
  33. <a class="{{if eq .SortType "reversealphabetically"}}active {{end}}item" href="?q={{$.Keyword}}&sort=reversealphabetically&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.label.filter_sort.reverse_alphabetically"}}</a>
  34. <a class="{{if eq .SortType "recentupdate"}}active {{end}}item" href="?q={{$.Keyword}}&sort=recentupdate&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.recentupdate"}}</a>
  35. <a class="{{if eq .SortType "leastupdate"}}active {{end}}item" href="?q={{$.Keyword}}&sort=leastupdate&state={{$.State}}">{{ctx.Locale.Tr "repo.issues.filter_sort.leastupdate"}}</a>
  36. </div>
  37. </div>
  38. </div>
  39. </div>
  40. <div class="milestone-list">
  41. {{range .Projects}}
  42. <li class="milestone-card">
  43. <h3 class="flex-text-block tw-m-0 tw-gap-3">
  44. {{svg .IconName 16}}
  45. <a class="muted tw-break-anywhere" href="{{.Link ctx}}">{{.Title}}</a>
  46. </h3>
  47. <div class="milestone-toolbar">
  48. <div class="group">
  49. <div class="flex-text-block">
  50. {{svg "octicon-issue-opened" 14}}
  51. {{ctx.Locale.PrettyNumber .NumOpenIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.open_title"}}
  52. </div>
  53. <div class="flex-text-block">
  54. {{svg "octicon-check" 14}}
  55. {{ctx.Locale.PrettyNumber .NumClosedIssues}}&nbsp;{{ctx.Locale.Tr "repo.issues.closed_title"}}
  56. </div>
  57. </div>
  58. {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
  59. <div class="group">
  60. <a class="flex-text-inline" href="{{.Link ctx}}/edit">{{svg "octicon-pencil" 14}}{{ctx.Locale.Tr "repo.issues.label_edit"}}</a>
  61. {{if .IsClosed}}
  62. <a class="link-action flex-text-inline" href data-url="{{.Link ctx}}/open">{{svg "octicon-check" 14}}{{ctx.Locale.Tr "repo.projects.open"}}</a>
  63. {{else}}
  64. <a class="link-action flex-text-inline" href data-url="{{.Link ctx}}/close">{{svg "octicon-skip" 14}}{{ctx.Locale.Tr "repo.projects.close"}}</a>
  65. {{end}}
  66. <a class="link-action flex-text-inline text red" href data-modal-confirm="#repo-project-delete-modal" data-url="{{.Link ctx}}/delete">{{svg "octicon-trash" 14}}{{ctx.Locale.Tr "repo.issues.label_delete"}}</a>
  67. </div>
  68. {{end}}
  69. </div>
  70. {{if .Description}}
  71. <div class="render-content markup">{{.RenderedContent}}</div>
  72. {{end}}
  73. </li>
  74. {{end}}
  75. {{template "base/paginate" .}}
  76. </div>
  77. {{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
  78. <div class="ui small modal" id="repo-project-delete-modal">
  79. <div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.projects.deletion"}}</div>
  80. <div class="content"><p>{{ctx.Locale.Tr "repo.projects.deletion_desc"}}</p></div>
  81. {{template "base/modal_actions_confirm" .}}
  82. </div>
  83. {{end}}