forked from forgejo/forgejo
Remember diff view style (#163)
This commit is contained in:
parent
bd76e156bb
commit
739f07c98e
7 changed files with 47 additions and 7 deletions
|
@ -107,6 +107,9 @@ type User struct {
|
|||
NumMembers int
|
||||
Teams []*Team `xorm:"-"`
|
||||
Members []*User `xorm:"-"`
|
||||
|
||||
// Preferences
|
||||
DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"`
|
||||
}
|
||||
|
||||
func (u *User) BeforeInsert() {
|
||||
|
@ -126,6 +129,11 @@ func (u *User) SetLastLogin() {
|
|||
u.LastLoginUnix = time.Now().Unix()
|
||||
}
|
||||
|
||||
func (u *User) UpdateDiffViewStyle(style string) error {
|
||||
u.DiffViewStyle = style
|
||||
return UpdateUser(u)
|
||||
}
|
||||
|
||||
func (u *User) AfterSet(colName string, _ xorm.Cell) {
|
||||
switch colName {
|
||||
case "full_name":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue