From 89c99167b2916a36ef112125662e014ca5b9da26 Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 1 May 2014 08:26:41 -0400 Subject: [PATCH] Fix #149 --- models/user.go | 1 + modules/auth/user.go | 1 + routers/user/setting.go | 1 + templates/user/profile.tmpl | 1 + templates/user/setting.tmpl | 7 +++++++ 5 files changed, 11 insertions(+) diff --git a/models/user.go b/models/user.go index 6751d11d..42b3ebe6 100644 --- a/models/user.go +++ b/models/user.go @@ -46,6 +46,7 @@ type User struct { Id int64 LowerName string `xorm:"unique not null"` Name string `xorm:"unique not null"` + FullName string Email string `xorm:"unique not null"` Passwd string `xorm:"not null"` LoginType int diff --git a/modules/auth/user.go b/modules/auth/user.go index 97389422..8d60670d 100644 --- a/modules/auth/user.go +++ b/modules/auth/user.go @@ -75,6 +75,7 @@ type FeedsForm struct { type UpdateProfileForm struct { UserName string `form:"username" binding:"Required;AlphaDash;MaxSize(30)"` + FullName string `form:"fullname" binding:"MaxSize(40)"` Email string `form:"email" binding:"Required;Email;MaxSize(50)"` Website string `form:"website" binding:"MaxSize(50)"` Location string `form:"location" binding:"MaxSize(50)"` diff --git a/routers/user/setting.go b/routers/user/setting.go index a55e617f..f62e9310 100644 --- a/routers/user/setting.go +++ b/routers/user/setting.go @@ -54,6 +54,7 @@ func SettingPost(ctx *middleware.Context, form auth.UpdateProfileForm) { user.Name = form.UserName } + user.FullName = form.FullName user.Email = form.Email user.Website = form.Website user.Location = form.Location diff --git a/templates/user/profile.tmpl b/templates/user/profile.tmpl index 15d2a0bd..43ecabfa 100644 --- a/templates/user/profile.tmpl +++ b/templates/user/profile.tmpl @@ -6,6 +6,7 @@ user-avatar + {{if .Owner.FullName}}{{.Owner.FullName}}{{end}} {{.Owner.Name}}
diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl index 56d859fe..bdcf9ce3 100644 --- a/templates/user/setting.tmpl +++ b/templates/user/setting.tmpl @@ -17,6 +17,13 @@
+
+ +
+ +
+
+