diff options
author | Unknown <joe2010xtmf@163.com> | 2014-06-27 03:37:01 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-06-27 03:37:01 -0400 |
commit | 19e910428951135b9a341554dad54a6546d2ad50 (patch) | |
tree | fde86e17d1cfccd3fb42b1f57f0f1eb9f0f9b9be /modules/auth/org.go | |
parent | 32b09681b2da96afe9a44790e7944c4ac51e696c (diff) | |
download | gitea-19e910428951135b9a341554dad54a6546d2ad50.tar.gz gitea-19e910428951135b9a341554dad54a6546d2ad50.zip |
Organization settings page
Diffstat (limited to 'modules/auth/org.go')
-rw-r--r-- | modules/auth/org.go | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/modules/auth/org.go b/modules/auth/org.go index a60fbb851e..f87d10a707 100644 --- a/modules/auth/org.go +++ b/modules/auth/org.go @@ -14,12 +14,12 @@ import ( "github.com/gogits/gogs/modules/middleware/binding" ) -type CreateOrganizationForm struct { +type CreateOrgForm struct { OrgName string `form:"orgname" binding:"Required;AlphaDashDot;MaxSize(30)"` Email string `form:"email" binding:"Required;Email;MaxSize(50)"` } -func (f *CreateOrganizationForm) Name(field string) string { +func (f *CreateOrgForm) Name(field string) string { names := map[string]string{ "OrgName": "Organization name", "Email": "E-mail address", @@ -27,7 +27,31 @@ func (f *CreateOrganizationForm) Name(field string) string { return names[field] } -func (f *CreateOrganizationForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) { +func (f *CreateOrgForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) { data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) validate(errs, data, f) } + +type OrgSettingForm struct { + DisplayName string `form:"display_name" binding:"Required;MaxSize(100)"` + Email string `form:"email" binding:"Required;Email;MaxSize(50)"` + Description string `form:"desc" binding:"MaxSize(255)"` + Website string `form:"site" binding:"Url;MaxSize(100)"` + Location string `form:"location" binding:"MaxSize(50)"` +} + +func (f *OrgSettingForm) Name(field string) string { + names := map[string]string{ + "DisplayName": "Display name", + "Email": "E-mail address", + "Description": "Description", + "Website": "Website address", + "Location": "Location", + } + return names[field] +} + +func (f *OrgSettingForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) { + data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) + validate(errors, data, f) +} |