diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 235fd96b73d8f..5b2e6fc02a091 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -138,6 +138,20 @@ func NewFuncMap() template.FuncMap { } return user.Theme }, + "ThemeIcon": func(theme string) string { + if theme == "gitea-dark" { + return "octicon-moon" + } else if theme == "gitea-light" { + return "octicon-sun" + } else if theme == "gitea-auto" { + return "gitea-eclipse" + } else { + return "octicon-paintbrush" + } + }, + "Themes": func() []string { + return setting.UI.Themes + }, "NotificationSettings": func() map[string]any { return map[string]any{ "MinTimeout": int(setting.UI.Notification.MinTimeout / time.Millisecond), diff --git a/public/assets/img/svg/gitea-eclipse.svg b/public/assets/img/svg/gitea-eclipse.svg new file mode 100644 index 0000000000000..7312c330ffed4 --- /dev/null +++ b/public/assets/img/svg/gitea-eclipse.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/routers/web/web.go b/routers/web/web.go index d2179a000893b..0d0eb7ad6e66d 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -629,7 +629,7 @@ func registerRoutes(m *web.Route) { }) addWebhookEditRoutes() }, webhooksEnabled) - }, reqSignIn, ctxDataSet("PageIsUserSettings", true, "AllThemes", setting.UI.Themes, "EnablePackages", setting.Packages.Enabled)) + }, reqSignIn, ctxDataSet("PageIsUserSettings", true, "EnablePackages", setting.Packages.Enabled)) m.Group("/user", func() { m.Get("/activate", auth.Activate) diff --git a/templates/base/footer_content.tmpl b/templates/base/footer_content.tmpl index f0a7865602f3d..e3757ece7cf09 100644 --- a/templates/base/footer_content.tmpl +++ b/templates/base/footer_content.tmpl @@ -15,6 +15,17 @@ {{end}}