|
@@ -14,6 +14,13 @@ import (
|
|
|
"github.com/gogits/gogs/modules/middleware/binding"
|
|
|
)
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
type CreateRepoForm struct {
|
|
|
RepoName string `form:"repo" binding:"Required;AlphaDash;MaxSize(100)"`
|
|
|
Private bool `form:"private"`
|
|
@@ -63,7 +70,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)"`
|
|
|
- Website string `form:"url" binding:"Url;MaxSize(100)"`
|
|
|
+ Website string `form:"site" binding:"Url;MaxSize(100)"`
|
|
|
Branch string `form:"branch"`
|
|
|
Interval int `form:"interval"`
|
|
|
Private bool `form:"private"`
|
|
@@ -84,6 +91,13 @@ func (f *RepoSettingForm) Validate(errors *binding.Errors, req *http.Request, co
|
|
|
validate(errors, data, f)
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
type NewWebhookForm struct {
|
|
|
Url string `form:"url" binding:"Required;Url"`
|
|
|
ContentType string `form:"content_type" binding:"Required"`
|
|
@@ -104,3 +118,83 @@ func (f *NewWebhookForm) Validate(errors *binding.Errors, req *http.Request, con
|
|
|
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
|
|
|
validate(errors, data, f)
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+type CreateIssueForm struct {
|
|
|
+ IssueName string `form:"title" binding:"Required;MaxSize(50)"`
|
|
|
+ MilestoneId int64 `form:"milestoneid"`
|
|
|
+ AssigneeId int64 `form:"assigneeid"`
|
|
|
+ Labels string `form:"labels"`
|
|
|
+ Content string `form:"content"`
|
|
|
+}
|
|
|
+
|
|
|
+func (f *CreateIssueForm) Name(field string) string {
|
|
|
+ names := map[string]string{
|
|
|
+ "IssueName": "Issue name",
|
|
|
+ }
|
|
|
+ return names[field]
|
|
|
+}
|
|
|
+
|
|
|
+func (f *CreateIssueForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
|
|
|
+ data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
|
|
|
+ validate(errors, data, f)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+type CreateMilestoneForm struct {
|
|
|
+ Title string `form:"title" binding:"Required;MaxSize(50)"`
|
|
|
+ Content string `form:"content"`
|
|
|
+ Deadline string `form:"due_date"`
|
|
|
+}
|
|
|
+
|
|
|
+func (f *CreateMilestoneForm) Name(field string) string {
|
|
|
+ names := map[string]string{
|
|
|
+ "Title": "Milestone name",
|
|
|
+ }
|
|
|
+ return names[field]
|
|
|
+}
|
|
|
+
|
|
|
+func (f *CreateMilestoneForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
|
|
|
+ data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
|
|
|
+ validate(errors, data, f)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+type NewReleaseForm struct {
|
|
|
+ TagName string `form:"tag_name" binding:"Required"`
|
|
|
+ Title string `form:"title" binding:"Required"`
|
|
|
+ Content string `form:"content" binding:"Required"`
|
|
|
+ Prerelease bool `form:"prerelease"`
|
|
|
+}
|
|
|
+
|
|
|
+func (f *NewReleaseForm) Name(field string) string {
|
|
|
+ names := map[string]string{
|
|
|
+ "TagName": "Tag name",
|
|
|
+ "Title": "Release title",
|
|
|
+ "Content": "Release content",
|
|
|
+ }
|
|
|
+ return names[field]
|
|
|
+}
|
|
|
+
|
|
|
+func (f *NewReleaseForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
|
|
|
+ data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
|
|
|
+ validate(errors, data, f)
|
|
|
+}
|