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 reviewtokarchuk/v1.17
parent
ea518681d9
commit
8d2c24f7f9
@ -0,0 +1,17 @@ |
|||||||
|
// Copyright 2019 The Gitea Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a MIT-style
|
||||||
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
|
package migrations |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/go-xorm/xorm" |
||||||
|
) |
||||||
|
|
||||||
|
func addUserDefaultTheme(x *xorm.Engine) error { |
||||||
|
type User struct { |
||||||
|
Theme string `xorm:"VARCHAR(30)"` |
||||||
|
} |
||||||
|
|
||||||
|
return x.Sync2(new(User)) |
||||||
|
} |
Loading…
Reference in new issue