summaryrefslogtreecommitdiffstats
path: root/models/user.go
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2016-11-13 00:54:04 -0200
committerLunny Xiao <xiaolunwen@gmail.com>2016-11-13 10:54:04 +0800
commit739f07c98e1254f776a7cb943a3430de32b17d1d (patch)
tree5ba37863a5b2f3188413dc9267d57c63cdb744ff /models/user.go
parentbd76e156bb08424841ff992aaffcc5aef913b703 (diff)
downloadgitea-739f07c98e1254f776a7cb943a3430de32b17d1d.tar.gz
gitea-739f07c98e1254f776a7cb943a3430de32b17d1d.zip
Remember diff view style (#163)
Diffstat (limited to 'models/user.go')
-rw-r--r--models/user.go8
1 files changed, 8 insertions, 0 deletions
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":