diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-12-29 00:31:54 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-29 00:31:54 +0100 |
commit | 309e86a9bf305e807ead2854fa757c4d704dcfce (patch) | |
tree | 4239e0a07647f732e7810e443a9dfafa6743824f /routers | |
parent | ca67c5a8a72f3d26bb0808ba7a63cd4875cd5229 (diff) | |
download | gitea-309e86a9bf305e807ead2854fa757c4d704dcfce.tar.gz gitea-309e86a9bf305e807ead2854fa757c4d704dcfce.zip |
Use dynamic package type list (#22263)
Replace the hardcoded list with the dynamic list.
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/admin/packages.go | 1 | ||||
-rw-r--r-- | routers/web/repo/packages.go | 1 | ||||
-rw-r--r-- | routers/web/user/package.go | 1 |
3 files changed, 3 insertions, 0 deletions
diff --git a/routers/web/admin/packages.go b/routers/web/admin/packages.go index 80cec51275..7c6d1ed840 100644 --- a/routers/web/admin/packages.go +++ b/routers/web/admin/packages.go @@ -62,6 +62,7 @@ func Packages(ctx *context.Context) { ctx.Data["PageIsAdminPackages"] = true ctx.Data["Query"] = query ctx.Data["PackageType"] = packageType + ctx.Data["AvailableTypes"] = packages_model.TypeList ctx.Data["SortType"] = sort ctx.Data["PackageDescriptors"] = pds ctx.Data["Total"] = total diff --git a/routers/web/repo/packages.go b/routers/web/repo/packages.go index 83324711da..6ad2f71b5c 100644 --- a/routers/web/repo/packages.go +++ b/routers/web/repo/packages.go @@ -61,6 +61,7 @@ func Packages(ctx *context.Context) { ctx.Data["ContextUser"] = ctx.ContextUser ctx.Data["Query"] = query ctx.Data["PackageType"] = packageType + ctx.Data["AvailableTypes"] = packages.TypeList ctx.Data["HasPackages"] = hasPackages if ctx.Repo != nil { ctx.Data["CanWritePackages"] = ctx.IsUserRepoWriter([]unit.Type{unit.TypePackages}) || ctx.IsUserSiteAdmin() diff --git a/routers/web/user/package.go b/routers/web/user/package.go index 3782f46b42..c0aba7583f 100644 --- a/routers/web/user/package.go +++ b/routers/web/user/package.go @@ -89,6 +89,7 @@ func ListPackages(ctx *context.Context) { ctx.Data["ContextUser"] = ctx.ContextUser ctx.Data["Query"] = query ctx.Data["PackageType"] = packageType + ctx.Data["AvailableTypes"] = packages_model.TypeList ctx.Data["HasPackages"] = hasPackages ctx.Data["PackageDescriptors"] = pds ctx.Data["Total"] = total |