More fixes

This commit is contained in:
James Mills
2021-01-30 15:26:24 +10:00
parent 401f635b3b
commit 8495ba0319
8 changed files with 15 additions and 304 deletions

View File

@@ -3,7 +3,6 @@ package internal
import (
"html/template"
"net/http"
"strings"
log "github.com/sirupsen/logrus"
"github.com/vcraescu/go-paginator"
@@ -116,16 +115,5 @@ func NewContext(conf *Config, db Store, req *http.Request) *Context {
ctx.IsAdmin = true
}
// Set the theme based on user preferences
theme := strings.ToLower(ctx.User.Theme)
switch theme {
case "", "auto":
ctx.Theme = ""
case "light", "dark":
ctx.Theme = theme
default:
log.WithField("name", theme).Warn("invalid theme found")
}
return ctx
}