summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-07-25 00:39:16 +0800
committer无闻 <u@gogs.io>2015-07-25 00:39:16 +0800
commit91ab2538c3e79bb3382e3f0e7cd46a080c3c084e (patch)
treedf77d2d7e2161bfcadf792989746bdfcae26e559
parent9cf334fca9f3fb3177012f9682a1fb234adef704 (diff)
parentf3aab5dbe30f8e6a1032b524315f7fd37c3e0b24 (diff)
downloadgitea-91ab2538c3e79bb3382e3f0e7cd46a080c3c084e.tar.gz
gitea-91ab2538c3e79bb3382e3f0e7cd46a080c3c084e.zip
Merge pull request #1244 from jamesa/develop
Add full name field to admin's user edit page (fixes #1130)
-rw-r--r--modules/auth/admin.go1
-rw-r--r--routers/admin/users.go1
-rw-r--r--templates/admin/user/edit.tmpl4
3 files changed, 6 insertions, 0 deletions
diff --git a/modules/auth/admin.go b/modules/auth/admin.go
index e6cc82cd34..a95b83de6a 100644
--- a/modules/auth/admin.go
+++ b/modules/auth/admin.go
@@ -11,6 +11,7 @@ import (
)
type AdminEditUserForm struct {
+ FullName string `form:"fullname" binding:"MaxSize(100)"`
Email string `binding:"Required;Email;MaxSize(50)"`
Password string `binding:"OmitEmpty;MinSize(6);MaxSize(255)"`
Website string `binding:"MaxSize(50)"`
diff --git a/routers/admin/users.go b/routers/admin/users.go
index ddcca6390e..12c52236f9 100644
--- a/routers/admin/users.go
+++ b/routers/admin/users.go
@@ -185,6 +185,7 @@ func EditUserPost(ctx *middleware.Context, form auth.AdminEditUserForm) {
u.EncodePasswd()
}
+ u.FullName = form.FullName
u.Email = form.Email
u.Website = form.Website
u.Location = form.Location
diff --git a/templates/admin/user/edit.tmpl b/templates/admin/user/edit.tmpl
index bdc0e3343f..4f4cc727ab 100644
--- a/templates/admin/user/edit.tmpl
+++ b/templates/admin/user/edit.tmpl
@@ -33,6 +33,10 @@
<label class="text-left">{{.User.Name}}</label>
</div>
<div class="field">
+ <label for="full-name">{{.i18n.Tr "settings.full_name"}}</label>
+ <input class="ipt ipt-large ipt-radius {{if .Err_FullName}}ipt-error{{end}}" id="full-name" name="fullname" type="text" value="{{.User.FullName}}" />
+ </div>
+ <div class="field">
<label class="req" for="email">{{.i18n.Tr "email"}}</label>
<input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.User.Email}}" required/>
</div>