forked from forgejo/forgejo
Finish create organization team
This commit is contained in:
parent
e57aebb316
commit
465dc962b5
13 changed files with 389 additions and 247 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue