1
0
Fork 0
forked from forgejo/forgejo

Clean names

This commit is contained in:
Unknown 2014-05-08 22:12:05 -04:00
parent 3f4c040f3f
commit 09dba7d63e
11 changed files with 30 additions and 731 deletions

View file

@ -34,7 +34,7 @@ func (f *AdminEditUserForm) Name(field string) string {
return names[field]
}
func (f *AdminEditUserForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
func (f *AdminEditUserForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}

View file

@ -22,12 +22,12 @@ type MarkdownForm struct {
Context string `form:"context"`
}
func (f *MarkdownForm) Validate(errs *binding.BindingErrors, req *http.Request, ctx martini.Context) {
func (f *MarkdownForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validateApiReq(errs, data, f)
}
func validateApiReq(errs *binding.BindingErrors, data base.TmplData, f interface{}) {
func validateApiReq(errs *binding.Errors, data base.TmplData, f interface{}) {
if errs.Count() == 0 {
return
} else if len(errs.Overall) > 0 {

View file

@ -39,7 +39,7 @@ func (f *RegisterForm) Name(field string) string {
return names[field]
}
func (f *RegisterForm) Validate(errs *binding.BindingErrors, req *http.Request, ctx martini.Context) {
func (f *RegisterForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errs, data, f)
}
@ -58,7 +58,7 @@ func (f *LogInForm) Name(field string) string {
return names[field]
}
func (f *LogInForm) Validate(errs *binding.BindingErrors, req *http.Request, ctx martini.Context) {
func (f *LogInForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errs, data, f)
}
@ -72,7 +72,7 @@ func GetMinMaxSize(field reflect.StructField) string {
return ""
}
func validate(errs *binding.BindingErrors, data base.TmplData, f Form) {
func validate(errs *binding.Errors, data base.TmplData, f Form) {
if errs.Count() == 0 {
return
} else if len(errs.Overall) > 0 {
@ -182,7 +182,7 @@ func (f *InstallForm) Name(field string) string {
return names[field]
}
func (f *InstallForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
func (f *InstallForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}

View file

@ -42,7 +42,7 @@ func (f *AuthenticationForm) Name(field string) string {
return names[field]
}
func (f *AuthenticationForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
func (f *AuthenticationForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}

View file

@ -29,7 +29,7 @@ func (f *CreateIssueForm) Name(field string) string {
return names[field]
}
func (f *CreateIssueForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
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)
}

View file

@ -30,7 +30,7 @@ func (f *NewReleaseForm) Name(field string) string {
return names[field]
}
func (f *NewReleaseForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
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)
}

View file

@ -31,7 +31,7 @@ func (f *CreateRepoForm) Name(field string) string {
return names[field]
}
func (f *CreateRepoForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
func (f *CreateRepoForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}
@ -55,7 +55,7 @@ func (f *MigrateRepoForm) Name(field string) string {
return names[field]
}
func (f *MigrateRepoForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
func (f *MigrateRepoForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}
@ -79,7 +79,7 @@ func (f *RepoSettingForm) Name(field string) string {
return names[field]
}
func (f *RepoSettingForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
func (f *RepoSettingForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}
@ -100,7 +100,7 @@ func (f *NewWebhookForm) Name(field string) string {
return names[field]
}
func (f *NewWebhookForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
func (f *NewWebhookForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}

View file

@ -27,7 +27,7 @@ func (f *AddSSHKeyForm) Name(field string) string {
return names[field]
}
func (f *AddSSHKeyForm) Validate(errors *binding.BindingErrors, req *http.Request, context martini.Context) {
func (f *AddSSHKeyForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errors, data, f)
}

View file

@ -94,7 +94,7 @@ func (f *UpdateProfileForm) Name(field string) string {
return names[field]
}
func (f *UpdateProfileForm) Validate(errs *binding.BindingErrors, req *http.Request, ctx martini.Context) {
func (f *UpdateProfileForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errs, data, f)
}
@ -114,7 +114,7 @@ func (f *UpdatePasswdForm) Name(field string) string {
return names[field]
}
func (f *UpdatePasswdForm) Validate(errs *binding.BindingErrors, req *http.Request, ctx martini.Context) {
func (f *UpdatePasswdForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
validate(errs, data, f)
}