summaryrefslogtreecommitdiffstats
path: root/templates/pwa/serviceworker_js.tmpl
diff options
context:
space:
mode:
authorLanre Adelowo <adelowomailbox@gmail.com>2019-01-09 18:22:57 +0100
committertechknowlogick <hello@techknowlogick.com>2019-01-09 12:22:57 -0500
commit8d2c24f7f9b9bce3a806e4748623bd3b2742025b (patch)
tree2010e6ffaf542d0828c496c31afa56f816c069d5 /templates/pwa/serviceworker_js.tmpl
parentea518681d95c9ef8ae5ed71d6d8cd7cfb6994a50 (diff)
downloadgitea-8d2c24f7f9b9bce3a806e4748623bd3b2742025b.tar.gz
gitea-8d2c24f7f9b9bce3a806e4748623bd3b2742025b.zip
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
Diffstat (limited to 'templates/pwa/serviceworker_js.tmpl')
-rw-r--r--templates/pwa/serviceworker_js.tmpl10
1 files changed, 7 insertions, 3 deletions
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',