diff options
author | Unknown <joe2010xtmf@163.com> | 2014-05-18 18:07:04 -0400 |
---|---|---|
committer | Unknown <joe2010xtmf@163.com> | 2014-05-18 18:07:04 -0400 |
commit | 93f8f9252304d4e8028e13dd95e4cdf2e3178594 (patch) | |
tree | 43218b1bbb2f3cb466b9afa8ed60022924526519 /modules | |
parent | a4c3ab48a52a0cade5d3c3ba76c5555ed1453566 (diff) | |
download | gitea-93f8f9252304d4e8028e13dd95e4cdf2e3178594.tar.gz gitea-93f8f9252304d4e8028e13dd95e4cdf2e3178594.zip |
Finish create new label
Diffstat (limited to 'modules')
-rw-r--r-- | modules/auth/repo.go | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/modules/auth/repo.go b/modules/auth/repo.go index 92ca839f85..82cd078613 100644 --- a/modules/auth/repo.go +++ b/modules/auth/repo.go @@ -171,6 +171,31 @@ func (f *CreateMilestoneForm) Validate(errors *binding.Errors, req *http.Request validate(errors, data, f) } +// .____ ___. .__ +// | | _____ \_ |__ ____ | | +// | | \__ \ | __ \_/ __ \| | +// | |___ / __ \| \_\ \ ___/| |__ +// |_______ (____ /___ /\___ >____/ +// \/ \/ \/ \/ + +type CreateLabelForm struct { + Title string `form:"title" binding:"Required;MaxSize(50)"` + Color string `form:"color" binding:"Required;Size(7)"` +} + +func (f *CreateLabelForm) Name(field string) string { + names := map[string]string{ + "Title": "Label name", + "Color": "Label color", + } + return names[field] +} + +func (f *CreateLabelForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) { + data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData) + validate(errors, data, f) +} + // __________ .__ // \______ \ ____ | | ____ _____ ______ ____ // | _// __ \| | _/ __ \\__ \ / ___// __ \ |