gitea源码

openclose.tmpl 1.4KB

123456789101112131415161718192021222324
  1. {{/* this tmpl is quite dirty, it should not mix unrelated things together .... need to split it in the future*/}}
  2. {{$allStatesLink := ""}}{{$openLink := ""}}{{$closedLink := ""}}
  3. {{if .PageIsMilestones}}
  4. {{$allStatesLink = QueryBuild "?" "q" $.Keyword "sort" $.SortType "state" "all"}}
  5. {{else}}
  6. {{$allStatesLink = QueryBuild "?" "q" $.Keyword "type" $.ViewType "sort" $.SortType "state" "all" "labels" $.SelectLabels "milestone" $.MilestoneID "project" $.ProjectID "assignee" $.AssigneeID "poster" $.PosterUsername "archived_labels" (Iif $.ShowArchivedLabels "true")}}
  7. {{end}}
  8. {{$openLink = QueryBuild $allStatesLink "state" "open"}}
  9. {{$closedLink = QueryBuild $allStatesLink "state" "closed"}}
  10. <div class="small-menu-items ui compact tiny menu">
  11. <a class="{{if eq .State "open"}}active {{end}}item flex-text-inline" href="{{if eq .State "open"}}{{$allStatesLink}}{{else}}{{$openLink}}{{end}}">
  12. {{if .PageIsMilestones}}
  13. {{svg "octicon-milestone"}}
  14. {{else}}
  15. {{Iif .PageIsPullList (svg "octicon-git-pull-request") (svg "octicon-issue-opened")}}
  16. {{end}}
  17. {{ctx.Locale.PrettyNumber .OpenCount}} {{ctx.Locale.Tr "repo.issues.open_title"}}
  18. </a>
  19. <a class="{{if eq .State "closed"}}active {{end}}item flex-text-inline" href="{{if eq .State "closed"}}{{$allStatesLink}}{{else}}{{$closedLink}}{{end}}">
  20. {{svg "octicon-issue-closed"}}
  21. {{ctx.Locale.PrettyNumber .ClosedCount}} {{ctx.Locale.Tr "repo.issues.closed_title"}}
  22. </a>
  23. </div>