feat(ui themes): better place for theme list ctx, testing (#7163)
`AllThemes` is only used by `user/settings/appearance.tmpl`, not by all settings pages. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7163 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: 0ko <0ko@noreply.codeberg.org> Co-committed-by: 0ko <0ko@noreply.codeberg.org>
This commit is contained in:
parent
30982b9e7b
commit
9cef129f6b
3 changed files with 50 additions and 1 deletions
|
@ -329,6 +329,7 @@ func Repos(ctx *context.Context) {
|
|||
func Appearance(ctx *context.Context) {
|
||||
ctx.Data["Title"] = ctx.Tr("settings.appearance")
|
||||
ctx.Data["PageIsSettingsAppearance"] = true
|
||||
ctx.Data["AllThemes"] = setting.UI.Themes
|
||||
|
||||
var hiddenCommentTypes *big.Int
|
||||
val, err := user_model.GetUserSetting(ctx, ctx.Doer.ID, user_model.SettingsKeyHiddenCommentTypes)
|
||||
|
|
|
@ -640,7 +640,7 @@ func registerRoutes(m *web.Route) {
|
|||
m.Post("/unblock", user_setting.UnblockUser)
|
||||
})
|
||||
m.Get("/storage_overview", user_setting.StorageOverview)
|
||||
}, reqSignIn, ctxDataSet("PageIsUserSettings", true, "AllThemes", setting.UI.Themes, "EnablePackages", setting.Packages.Enabled, "EnableQuota", setting.Quota.Enabled))
|
||||
}, reqSignIn, ctxDataSet("PageIsUserSettings", true, "EnablePackages", setting.Packages.Enabled, "EnableQuota", setting.Quota.Enabled))
|
||||
|
||||
m.Group("/user", func() {
|
||||
m.Get("/activate", auth.Activate)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue