From f3aab5dbe30f8e6a1032b524315f7fd37c3e0b24 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 28 Apr 2015 11:59:05 -0400 Subject: [PATCH] Add full name field to admin's user edit page (fixes #1130) --- modules/auth/admin.go | 1 + routers/admin/users.go | 1 + templates/admin/user/edit.tmpl | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/modules/auth/admin.go b/modules/auth/admin.go index e6cc82cd..a95b83de 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 ddcca639..12c52236 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 bdc0e334..4f4cc727 100644 --- a/templates/admin/user/edit.tmpl +++ b/templates/admin/user/edit.tmpl @@ -32,6 +32,10 @@ +
+ + +