diff options
Diffstat (limited to 'http/context/context.go')
-rw-r--r-- | http/context/context.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/http/context/context.go b/http/context/context.go index f0fed23..4ca95c5 100644 --- a/http/context/context.go +++ b/http/context/context.go @@ -48,6 +48,15 @@ func (c *Context) UserLanguage() string { return language } +// UserTheme get the theme used by the current logged user. +func (c *Context) UserTheme() string { + theme := c.getContextStringValue(middleware.UserThemeContextKey) + if theme == "" { + theme = "default" + } + return theme +} + // CSRF returns the current CSRF token. func (c *Context) CSRF() string { return c.getContextStringValue(middleware.CSRFContextKey) |