summaryrefslogtreecommitdiffstats
path: root/modules/templates/helper.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/templates/helper.go')
-rw-r--r--modules/templates/helper.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go
index bb1411cbfd..235fd96b73 100644
--- a/modules/templates/helper.go
+++ b/modules/templates/helper.go
@@ -12,6 +12,7 @@ import (
"strings"
"time"
+ user_model "code.gitea.io/gitea/models/user"
"code.gitea.io/gitea/modules/base"
"code.gitea.io/gitea/modules/emoji"
"code.gitea.io/gitea/modules/markup"
@@ -131,8 +132,11 @@ func NewFuncMap() template.FuncMap {
"DisableImportLocal": func() bool {
return !setting.ImportLocalPaths
},
- "DefaultTheme": func() string {
- return setting.UI.DefaultTheme
+ "ThemeName": func(user *user_model.User) string {
+ if user == nil || user.Theme == "" {
+ return setting.UI.DefaultTheme
+ }
+ return user.Theme
},
"NotificationSettings": func() map[string]any {
return map[string]any{