From 739f07c98e1254f776a7cb943a3430de32b17d1d Mon Sep 17 00:00:00 2001 From: Andrey Nering Date: Sun, 13 Nov 2016 00:54:04 -0200 Subject: Remember diff view style (#163) --- models/user.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'models/user.go') diff --git a/models/user.go b/models/user.go index d97ced931a..0b6063fbc9 100644 --- a/models/user.go +++ b/models/user.go @@ -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": -- cgit v1.2.3