summaryrefslogtreecommitdiffstats
path: root/routers/org/org.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2016-11-18 11:03:03 +0800
committerGitHub <noreply@github.com>2016-11-18 11:03:03 +0800
commitcf045b029cc11dc48c3a626441b7017710088823 (patch)
treef234f8ad8b8a548bda4c9d372ca5b9af95b0b40b /routers/org/org.go
parent91953ae9b421300eef79d58891dec7f2026e5d53 (diff)
downloadgitea-cf045b029cc11dc48c3a626441b7017710088823.tar.gz
gitea-cf045b029cc11dc48c3a626441b7017710088823.zip
golint fixed for parts of routers root, dev, user and org dirs (#167)
* golint fixed for parts of routers root, dev and org dirs * add user/auth.go golint fixed * rename unnecessary exported to unexported and user dir golint fixed
Diffstat (limited to 'routers/org/org.go')
-rw-r--r--routers/org/org.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/routers/org/org.go b/routers/org/org.go
index 57d41d0e28..1475c6e542 100644
--- a/routers/org/org.go
+++ b/routers/org/org.go
@@ -14,19 +14,22 @@ import (
)
const (
- CREATE base.TplName = "org/create"
+ // tplCreateOrg template path for create organization
+ tplCreateOrg base.TplName = "org/create"
)
+// Create render the page for create organization
func Create(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("new_org")
- ctx.HTML(200, CREATE)
+ ctx.HTML(200, tplCreateOrg)
}
+// CreatePost response for create organization
func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
ctx.Data["Title"] = ctx.Tr("new_org")
if ctx.HasError() {
- ctx.HTML(200, CREATE)
+ ctx.HTML(200, tplCreateOrg)
return
}
@@ -40,11 +43,11 @@ func CreatePost(ctx *context.Context, form auth.CreateOrgForm) {
ctx.Data["Err_OrgName"] = true
switch {
case models.IsErrUserAlreadyExist(err):
- ctx.RenderWithErr(ctx.Tr("form.org_name_been_taken"), CREATE, &form)
+ ctx.RenderWithErr(ctx.Tr("form.org_name_been_taken"), tplCreateOrg, &form)
case models.IsErrNameReserved(err):
- ctx.RenderWithErr(ctx.Tr("org.form.name_reserved", err.(models.ErrNameReserved).Name), CREATE, &form)
+ ctx.RenderWithErr(ctx.Tr("org.form.name_reserved", err.(models.ErrNameReserved).Name), tplCreateOrg, &form)
case models.IsErrNamePatternNotAllowed(err):
- ctx.RenderWithErr(ctx.Tr("org.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), CREATE, &form)
+ ctx.RenderWithErr(ctx.Tr("org.form.name_pattern_not_allowed", err.(models.ErrNamePatternNotAllowed).Pattern), tplCreateOrg, &form)
default:
ctx.Handle(500, "CreateOrganization", err)
}