diff options
author | Lanre Adelowo <adelowomailbox@gmail.com> | 2019-01-09 18:22:57 +0100 |
---|---|---|
committer | techknowlogick <hello@techknowlogick.com> | 2019-01-09 12:22:57 -0500 |
commit | 8d2c24f7f9b9bce3a806e4748623bd3b2742025b (patch) | |
tree | 2010e6ffaf542d0828c496c31afa56f816c069d5 /templates/base | |
parent | ea518681d95c9ef8ae5ed71d6d8cd7cfb6994a50 (diff) | |
download | gitea-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/base')
-rw-r--r-- | templates/base/head.tmpl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl index 47c0d6b473..b6afe94bb4 100644 --- a/templates/base/head.tmpl +++ b/templates/base/head.tmpl @@ -6,7 +6,7 @@ <meta http-equiv="x-ua-compatible" content="ie=edge"> <title>{{if .Title}}{{.Title}} - {{end}}{{AppName}}</title> <link rel="manifest" href="{{AppSubUrl}}/manifest.json"> - + <script> if ('serviceWorker' in navigator) { window.addEventListener('load', function() { @@ -147,7 +147,11 @@ <meta property="og:url" content="{{AppUrl}}" /> <meta property="og:description" content="{{MetaDescription}}"> {{end}} -{{if ne DefaultTheme "gitea"}} +{{if .IsSigned }} + {{ if ne .SignedUser.Theme "gitea" }} + <link rel="stylesheet" href="{{AppSubUrl}}/css/theme-{{.SignedUser.Theme}}.css"> + {{end}} +{{else if ne DefaultTheme "gitea"}} <link rel="stylesheet" href="{{AppSubUrl}}/css/theme-{{DefaultTheme}}.css"> {{end}} {{template "custom/header" .}} |