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.

list.tmpl 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. {{template "base/alert" .}}
  2. <form class="ui form ignore-dirty">
  3. <div class="ui fluid action input">
  4. {{template "shared/searchinput" dict "locale" .locale "Value" .Query "AutoFocus" true}}
  5. <select class="ui dropdown" name="type">
  6. <option value="">{{.locale.Tr "packages.filter.type"}}</option>
  7. <option value="all">{{.locale.Tr "packages.filter.type.all"}}</option>
  8. {{range $type := .AvailableTypes}}
  9. <option{{if eq $.PackageType $type}} selected="selected"{{end}} value="{{$type}}">{{$type.Name}}</option>
  10. {{end}}
  11. </select>
  12. <button class="ui primary button">{{.locale.Tr "explore.search"}}</button>
  13. </div>
  14. </form>
  15. <div class="{{if .PackageDescriptors}}flex-list{{end}} gt-pt-4">
  16. {{range .PackageDescriptors}}
  17. <div class="flex-item">
  18. <div class="flex-item-main">
  19. <div class="flex-item-title">
  20. <a href="{{.FullWebLink}}">{{.Package.Name}}</a>
  21. <span class="ui label">{{svg .Package.Type.SVGName 16}} {{.Package.Type.Name}}</span>
  22. </div>
  23. <div class="flex-item-body">
  24. {{$timeStr := TimeSinceUnix .Version.CreatedUnix $.locale}}
  25. {{$hasRepositoryAccess := false}}
  26. {{if .Repository}}
  27. {{$hasRepositoryAccess = index $.RepositoryAccessMap .Repository.ID}}
  28. {{end}}
  29. {{if $hasRepositoryAccess}}
  30. {{$.locale.Tr "packages.published_by_in" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) .Repository.Link (.Repository.FullName | Escape) | Safe}}
  31. {{else}}
  32. {{$.locale.Tr "packages.published_by" $timeStr .Creator.HomeLink (.Creator.GetDisplayName | Escape) | Safe}}
  33. {{end}}
  34. </div>
  35. </div>
  36. </div>
  37. {{else}}
  38. {{if not .HasPackages}}
  39. <div class="empty center">
  40. {{svg "octicon-package" 48}}
  41. <h2>{{.locale.Tr "packages.empty"}}</h2>
  42. {{if and .Repository .CanWritePackages}}
  43. {{$packagesUrl := URLJoin .Owner.HomeLink "-" "packages"}}
  44. <p>{{.locale.Tr "packages.empty.repo" $packagesUrl | Safe}}</p>
  45. {{end}}
  46. <p>{{.locale.Tr "packages.empty.documentation" "https://docs.gitea.com/usage/packages/overview/" | Safe}}</p>
  47. </div>
  48. {{else}}
  49. <p>{{.locale.Tr "packages.filter.no_result"}}</p>
  50. {{end}}
  51. {{end}}
  52. {{template "base/paginate" .}}
  53. </div>