Add full name field to admin's user edit page (fixes #1130)

This commit is contained in:
James 2015-04-28 11:59:05 -04:00
parent 2c4fb6e646
commit f3aab5dbe3
3 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import (
) )
type AdminEditUserForm struct { type AdminEditUserForm struct {
FullName string `form:"fullname" binding:"MaxSize(100)"`
Email string `binding:"Required;Email;MaxSize(50)"` Email string `binding:"Required;Email;MaxSize(50)"`
Password string `binding:"OmitEmpty;MinSize(6);MaxSize(255)"` Password string `binding:"OmitEmpty;MinSize(6);MaxSize(255)"`
Website string `binding:"MaxSize(50)"` Website string `binding:"MaxSize(50)"`

View File

@ -185,6 +185,7 @@ func EditUserPost(ctx *middleware.Context, form auth.AdminEditUserForm) {
u.EncodePasswd() u.EncodePasswd()
} }
u.FullName = form.FullName
u.Email = form.Email u.Email = form.Email
u.Website = form.Website u.Website = form.Website
u.Location = form.Location u.Location = form.Location

View File

@ -32,6 +32,10 @@
<label>{{.i18n.Tr "username"}}</label> <label>{{.i18n.Tr "username"}}</label>
<label class="text-left">{{.User.Name}}</label> <label class="text-left">{{.User.Name}}</label>
</div> </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"> <div class="field">
<label class="req" for="email">{{.i18n.Tr "email"}}</label> <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/> <input class="ipt ipt-large ipt-radius {{if .Err_Email}}ipt-error{{end}}" id="email" name="email" type="email" value="{{.User.Email}}" required/>