summaryrefslogtreecommitdiffstats
path: root/modules/auth/org.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-07-26 00:24:27 -0400
committerUnknwon <joe2010xtmf@163.com>2014-07-26 00:24:27 -0400
commit8dd07c0ddd99ae626a1ec8c06f75f27fed51269f (patch)
tree261d3c9911dabc58c1ac54e4e36b3dee24d2032b /modules/auth/org.go
parent0a739cf9ac901f54484c34bba8322418dedb09b0 (diff)
downloadgitea-8dd07c0ddd99ae626a1ec8c06f75f27fed51269f.tar.gz
gitea-8dd07c0ddd99ae626a1ec8c06f75f27fed51269f.zip
New UI merge in progress
Diffstat (limited to 'modules/auth/org.go')
-rw-r--r--modules/auth/org.go49
1 files changed, 8 insertions, 41 deletions
diff --git a/modules/auth/org.go b/modules/auth/org.go
index e243627ef2..c45d83a711 100644
--- a/modules/auth/org.go
+++ b/modules/auth/org.go
@@ -5,12 +5,9 @@
package auth
import (
- "net/http"
- "reflect"
+ "github.com/Unknwon/macaron"
+ "github.com/macaron-contrib/i18n"
- "github.com/go-martini/martini"
-
- "github.com/gogits/gogs/modules/base"
"github.com/gogits/gogs/modules/middleware/binding"
)
@@ -26,17 +23,8 @@ type CreateOrgForm struct {
Email string `form:"email" binding:"Required;Email;MaxSize(50)"`
}
-func (f *CreateOrgForm) Name(field string) string {
- names := map[string]string{
- "OrgName": "Organization name",
- "Email": "E-mail address",
- }
- return names[field]
-}
-
-func (f *CreateOrgForm) Validate(errs *binding.Errors, req *http.Request, ctx martini.Context) {
- data := ctx.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
- validate(errs, data, f)
+func (f *CreateOrgForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) {
+ validate(errs, ctx.Data, f, l)
}
type OrgSettingForm struct {
@@ -47,20 +35,8 @@ type OrgSettingForm struct {
Location string `form:"location" binding:"MaxSize(50)"`
}
-func (f *OrgSettingForm) Name(field string) string {
- names := map[string]string{
- "DisplayName": "Display name",
- "Email": "E-mail address",
- "Description": "Description",
- "Website": "Website address",
- "Location": "Location",
- }
- return names[field]
-}
-
-func (f *OrgSettingForm) Validate(errors *binding.Errors, req *http.Request, context martini.Context) {
- data := context.Get(reflect.TypeOf(base.TmplData{})).Interface().(base.TmplData)
- validate(errors, data, f)
+func (f *OrgSettingForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) {
+ validate(errs, ctx.Data, f, l)
}
// ___________
@@ -76,15 +52,6 @@ type CreateTeamForm struct {
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)
+func (f *CreateTeamForm) Validate(ctx *macaron.Context, errs *binding.Errors, l i18n.Locale) {
+ validate(errs, ctx.Data, f, l)
}