1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-11 17:51:01 +00:00

Improve themes handling

- Store user theme in session
- Logged out users will keep their theme
- Add theme background color to web manifest and meta tag
This commit is contained in:
Frédéric Guillot 2018-07-18 22:30:05 -07:00
parent c1ab27172c
commit a291d8a38b
15 changed files with 76 additions and 31 deletions

View file

@ -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)