mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-09-15 18:56:59 +00:00
Merge pull request 'feat(UI): add package counter to repo/user/org overview pages' (#4697) from mahlzahn/forgejo:add_packages_counter into forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4697 Reviewed-by: Gusted <gusted@noreply.codeberg.org>
This commit is contained in:
commit
a05d4c6154
8 changed files with 341 additions and 25 deletions
|
@ -20,6 +20,10 @@
|
|||
{{if and .IsPackageEnabled .CanReadPackages}}
|
||||
<a class="{{if .IsPackagesPage}}active {{end}}item" href="{{$.Org.HomeLink}}/-/packages">
|
||||
{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
|
||||
{{if .PackageCount}}
|
||||
<div class="ui small label">{{.PackageCount}}</div>
|
||||
{{end}}
|
||||
<span hidden test-name="package-count">{{.PackageCount}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{if and .IsRepoIndexerEnabled .CanReadCode}}
|
||||
|
|
|
@ -135,6 +135,9 @@
|
|||
{{if .Permission.CanRead $.UnitTypePackages}}
|
||||
<a href="{{.RepoLink}}/packages" class="{{if .IsPackagesPage}}active {{end}}item">
|
||||
{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
|
||||
{{if .NumPackages}}
|
||||
<span class="ui small label">{{CountFmt .NumPackages}}</span>
|
||||
{{end}}
|
||||
</a>
|
||||
{{end}}
|
||||
|
||||
|
|
|
@ -24,6 +24,10 @@
|
|||
{{if and .IsPackageEnabled (or .ContextUser.IsIndividual .CanReadPackages)}}
|
||||
<a href="{{.ContextUser.HomeLink}}/-/packages" class="{{if .IsPackagesPage}}active {{end}}item">
|
||||
{{svg "octicon-package"}} {{ctx.Locale.Tr "packages.title"}}
|
||||
{{if .PackageCount}}
|
||||
<div class="ui small label">{{.PackageCount}}</div>
|
||||
{{end}}
|
||||
<span hidden test-name="package-count">{{.PackageCount}}</span>
|
||||
</a>
|
||||
{{end}}
|
||||
{{if and .IsRepoIndexerEnabled (or .ContextUser.IsIndividual .CanReadCode)}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue