diff options
author | Unknwon <u@gogs.io> | 2015-08-28 16:44:04 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-28 16:44:04 +0800 |
commit | 46bee50e45ef8f3e9f3727649fa24d50bb2fc782 (patch) | |
tree | 3b55f109f957c54890972d533af435d3a3ed8e96 /modules/auth | |
parent | 4cfa2ca40d4f211a124ab9973dfc814190b758b9 (diff) |
complate list of gitignores and licenses
Diffstat (limited to 'modules/auth')
-rw-r--r-- | modules/auth/repo_form.go | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index 21a6cfda..bdfa412c 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -16,14 +16,19 @@ import ( // |____|_ /_______ / |____| \_______ /_______ /|___| |____| \_______ /____|_ // ______| // \/ \/ \/ \/ \/ \/ \/ +type RepoForm struct { + Uid int64 `binding:"Required"` + RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` + Private bool + Description string `binding:"MaxSize(255)"` +} + type CreateRepoForm struct { - Uid int64 `form:"uid" binding:"Required"` - RepoName string `form:"repo_name" binding:"Required;AlphaDashDot;MaxSize(100)"` - Private bool `form:"private"` - Description string `form:"desc" binding:"MaxSize(255)"` - AutoInit bool `form:"auto_init"` - Gitignore string `form:"gitignore"` - License string `form:"license"` + RepoForm + AutoInit bool + Gitignores string + License string + Readme string } func (f *CreateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { @@ -34,11 +39,8 @@ type MigrateRepoForm struct { CloneAddr string `binding:"Required"` AuthUsername string AuthPassword string - Uid int64 `binding:"Required"` - RepoName string `binding:"Required;AlphaDashDot;MaxSize(100)"` - Mirror bool - Private bool - Description string `binding:"MaxSize(255)"` + RepoForm + Mirror bool } func (f *MigrateRepoForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { |