forked from gitea/gitea
Backport #21540 At the moment, If admin disable Packages, still show the Packages on the admin dashboard. This patch added a check to hide the Packages entry.
This commit is contained in:
parent
291787a5ef
commit
43a8547df6
|
@ -566,6 +566,8 @@ func RegisterRoutes(m *web.Route) {
|
||||||
m.Post("/delete", admin.DeleteNotices)
|
m.Post("/delete", admin.DeleteNotices)
|
||||||
m.Post("/empty", admin.EmptyNotices)
|
m.Post("/empty", admin.EmptyNotices)
|
||||||
})
|
})
|
||||||
|
}, func(ctx *context.Context) {
|
||||||
|
ctx.Data["EnablePackages"] = setting.Packages.Enabled
|
||||||
}, adminReq)
|
}, adminReq)
|
||||||
// ***** END: Admin *****
|
// ***** END: Admin *****
|
||||||
|
|
||||||
|
|
|
@ -12,9 +12,11 @@
|
||||||
<a class="{{if .PageIsAdminRepositories}}active{{end}} item" href="{{AppSubUrl}}/admin/repos">
|
<a class="{{if .PageIsAdminRepositories}}active{{end}} item" href="{{AppSubUrl}}/admin/repos">
|
||||||
{{.i18n.Tr "admin.repositories"}}
|
{{.i18n.Tr "admin.repositories"}}
|
||||||
</a>
|
</a>
|
||||||
|
{{if .EnablePackages}}
|
||||||
<a class="{{if .PageIsAdminPackages}}active{{end}} item" href="{{AppSubUrl}}/admin/packages">
|
<a class="{{if .PageIsAdminPackages}}active{{end}} item" href="{{AppSubUrl}}/admin/packages">
|
||||||
{{.i18n.Tr "packages.title"}}
|
{{.i18n.Tr "packages.title"}}
|
||||||
</a>
|
</a>
|
||||||
|
{{end}}
|
||||||
{{if not DisableWebhooks}}
|
{{if not DisableWebhooks}}
|
||||||
<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks">
|
<a class="{{if or .PageIsAdminDefaultHooks .PageIsAdminSystemHooks}}active{{end}} item" href="{{AppSubUrl}}/admin/hooks">
|
||||||
{{.i18n.Tr "admin.hooks"}}
|
{{.i18n.Tr "admin.hooks"}}
|
||||||
|
|
Loading…
Reference in New Issue