From 8d2c24f7f9b9bce3a806e4748623bd3b2742025b Mon Sep 17 00:00:00 2001 From: Lanre Adelowo Date: Wed, 9 Jan 2019 18:22:57 +0100 Subject: Allow for user specific themes (#5668) * add migration and basic UI for changing a user's theme * update user themem * use right text on button * load theme based on users' selection * load theme based on users' selection in pwa too * update sample config * delete older theme loading * implement AfterLoad to set users' theme properly * set up default theme when creating a user. This uses the installation wide theme * use flash messages for error * set default theme when creating a user from the cli * fix @lunny review --- templates/pwa/serviceworker_js.tmpl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'templates/pwa/serviceworker_js.tmpl') diff --git a/templates/pwa/serviceworker_js.tmpl b/templates/pwa/serviceworker_js.tmpl index 5e5860ebb0..f109d06300 100644 --- a/templates/pwa/serviceworker_js.tmpl +++ b/templates/pwa/serviceworker_js.tmpl @@ -32,10 +32,14 @@ var urlsToCache = [ '{{AppSubUrl}}/vendor/plugins/jquery.minicolors/jquery.minicolors.css', '{{AppSubUrl}}/vendor/plugins/jquery.datetimepicker/jquery.datetimepicker.css', '{{AppSubUrl}}/vendor/plugins/dropzone/dropzone.css', -{{if ne DefaultTheme "gitea"}} - '{{AppSubUrl}}/css/theme-{{DefaultTheme}}.css', +{{if .IsSigned }} + {{ if ne .SignedUser.Theme "gitea" }} + '{{AppSubUrl}}/css/theme-{{.SignedUser.Theme}}.css' + {{end}} +{{else if ne DefaultTheme "gitea"}} + '{{AppSubUrl}}/css/theme-{{DefaultTheme}}.css' {{end}} - + // img '{{AppSubUrl}}/img/gitea-sm.png', '{{AppSubUrl}}/img/gitea-lg.png', -- cgit v1.2.3