diff options
author | Unknown <joe2010xtmf@163.com> | 2014-07-02 16:42:16 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-07-02 16:42:16 -0400 |
commit | 465dc962b5e1febdfc988419d4d03e98f777019f (patch) | |
tree | 8c0f4abc434f75a7add718e98b077cb245608062 /modules/auth/org.go | |
parent | e57aebb31667a1de54e82cd26e9bbdb8e795039d (diff) | |
download | gitea-465dc962b5e1febdfc988419d4d03e98f777019f.tar.gz gitea-465dc962b5e1febdfc988419d4d03e98f777019f.zip |
Finish create organization team
Diffstat (limited to 'modules/auth/org.go')
-rw-r--r-- | modules/auth/org.go | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/auth/org.go b/modules/auth/org.go index f87d10a707..e243627ef2 100644 --- a/modules/auth/org.go +++ b/modules/auth/org.go @@ -14,6 +14,13 @@ import ( "github.com/gogits/gogs/modules/middleware/binding" ) +// ________ .__ __ .__ +// \_____ \_______ _________ ____ |__|____________ _/ |_|__| ____ ____ +// / | \_ __ \/ ___\__ \ / \| \___ /\__ \\ __\ |/ _ \ / \ +// / | \ | \/ /_/ > __ \| | \ |/ / / __ \| | | ( <_> ) | \ +// \_______ /__| \___ (____ /___| /__/_____ \(____ /__| |__|\____/|___| / +// \/ /_____/ \/ \/ \/ \/ \/ + type CreateOrgForm struct { OrgName string `form:"orgname" binding:"Required;AlphaDashDot;MaxSize(30)"` Email string `form:"email" binding:"Required;Email;MaxSize(50)"` @@ -55,3 +62,29 @@ func (f *OrgSettingForm) Validate(errors *binding.Errors, req *http.Request, con data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) validate(errors, data, f) } + +// ___________ +// \__ ___/___ _____ _____ +// | |_/ __ \\__ \ / \ +// | |\ ___/ / __ \| Y Y \ +// |____| \___ >____ /__|_| / +// \/ \/ \/ + +type CreateTeamForm struct { + TeamName string `form:"name" binding:"Required;AlphaDashDot;MaxSize(30)"` + Description string `form:"desc" binding:"MaxSize(255)"` + Permission string `form:"permission"` +} + +func (f *CreateTeamForm) Name(field string) string { + names := map[string]string{ + "TeamName": "Team name", + "Description": "Team description", + } + return names[field] +} + +func (f *CreateTeamForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) { + data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) + validate(errs, data, f) +} |