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 | |
parent | 32b09681b2da96afe9a44790e7944c4ac51e696c (diff) | |
download | gitea-19e910428951135b9a341554dad54a6546d2ad50.tar.gz gitea-19e910428951135b9a341554dad54a6546d2ad50.zip |
Organization settings page
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/org.go | 30 | ||||
-rw-r--r-- | modules/auth/repo.go | 2 | ||||
-rw-r--r-- | modules/auth/user.go | 2 |
3 files changed, 29 insertions, 5 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) +} diff --git a/modules/auth/repo.go b/modules/auth/repo.go index db13743de8..d3d215322a 100644 --- a/modules/auth/repo.go +++ b/modules/auth/repo.go @@ -71,7 +71,7 @@ func (f *MigrateRepoForm) Validate(errors *binding.Errors, req *http.Request, co type RepoSettingForm struct { RepoName string `form:"name" binding:"Required;AlphaDash;MaxSize(100)"` - Description string `form:"desc" binding:"MaxSize(100)"` + Description string `form:"desc" binding:"MaxSize(255)"` Website string `form:"site" binding:"Url;MaxSize(100)"` Branch string `form:"branch"` Interval int `form:"interval"` diff --git a/modules/auth/user.go b/modules/auth/user.go index 20f9933626..4a781acfa5 100644 --- a/modules/auth/user.go +++ b/modules/auth/user.go @@ -93,7 +93,7 @@ func (f *UpdateProfileForm) Name(field string) string { names := map[string]string{ "UserName": "Username", "Email": "E-mail address", - "Website": "Website", + "Website": "Website address", "Location": "Location", "Avatar": "Gravatar Email", } |