summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--models/user.go1
-rw-r--r--modules/auth/user.go1
-rw-r--r--routers/user/setting.go1
-rw-r--r--templates/user/profile.tmpl1
-rw-r--r--templates/user/setting.tmpl7
5 files changed, 11 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 6751d11d49..42b3ebe6ae 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 973894221d..8d60670db4 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 a55e617f44..f62e931051 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 15d2a0bd5a..43ecabfa16 100644
--- a/templates/user/profile.tmpl
+++ b/templates/user/profile.tmpl
@@ -6,6 +6,7 @@
<a href="http://gravatar.com/emails/" class="center-block" data-toggle="tooltip" data-placement="bottom" title="Change your avatar at gravatar.com">
<img id="user-avatar" src="{{.Owner.AvatarLink}}?s=200" alt="user-avatar" title="{{.Owner.Name}}"/>
</a>
+ {{if .Owner.FullName}}<span id="user-name" class="center-block">{{.Owner.FullName}}</span>{{end}}
<span id="user-name" class="center-block">{{.Owner.Name}}</span>
</div>
<div class="profile-info">
diff --git a/templates/user/setting.tmpl b/templates/user/setting.tmpl
index 56d859fe41..bdcf9ce3b7 100644
--- a/templates/user/setting.tmpl
+++ b/templates/user/setting.tmpl
@@ -18,6 +18,13 @@
</div>
<div class="form-group">
+ <label class="col-md-2 control-label">Full Name</label>
+ <div class="col-md-8">
+ <input name="fullname" class="form-control" placeholder="Type your full name" value="{{.SignedUser.FullName}}">
+ </div>
+ </div>
+
+ <div class="form-group">
<label class="col-md-2 control-label">Email<strong class="text-danger">*</strong></label>
<div class="col-md-8">
<input name="email" class="form-control" placeholder="Type your e-mail address" required="required" value="{{.SignedUser.Email}}">