From ea507e20d45ef90b1552d72341038354f8801cf4 Mon Sep 17 00:00:00 2001 From: fuxiaohei Date: Mon, 23 Jun 2014 11:40:49 +0800 Subject: [PATCH] add organization create page --- cmd/web.go | 1 + public/css/gogs.css | 2 +- routers/org/org.go | 18 ++++++++++------ templates/org/new.tmpl | 48 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 templates/org/new.tmpl diff --git a/cmd/web.go b/cmd/web.go index b2521de968..9786576d78 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -189,6 +189,7 @@ func runWeb(*cli.Context) { reqOwner := middleware.RequireOwner() m.Group("/o", func(r martini.Router) { + r.Get("/create",org.New) r.Get("/:org", org.Organization) r.Get("/:org/members", org.Members) r.Get("/:org/teams", org.Teams) diff --git a/public/css/gogs.css b/public/css/gogs.css index 7fdde19ccc..bb341a8a35 100755 --- a/public/css/gogs.css +++ b/public/css/gogs.css @@ -372,7 +372,7 @@ html, body { /* gogits repo create */ -#repo-create { +#repo-create, #org-create { width: 800px; } diff --git a/routers/org/org.go b/routers/org/org.go index 21f2a189cf..4d9b831deb 100644 --- a/routers/org/org.go +++ b/routers/org/org.go @@ -6,17 +6,21 @@ import ( ) func Organization(ctx *middleware.Context, params martini.Params) { - ctx.Data["Title"] = "Organization " + params["org"] + ctx.Data["Title"] = "Organization "+params["org"] ctx.HTML(200, "org/org") } -func Members(ctx *middleware.Context,params martini.Params){ - ctx.Data["Title"] = "Organization " + params["org"]+" Members" - ctx.HTML(200,"org/members") +func Members(ctx *middleware.Context, params martini.Params) { + ctx.Data["Title"] = "Organization "+params["org"]+" Members" + ctx.HTML(200, "org/members") } -func Teams(ctx *middleware.Context,params martini.Params){ - ctx.Data["Title"] = "Organization " + params["org"]+" Teams" - ctx.HTML(200,"org/teams") +func Teams(ctx *middleware.Context, params martini.Params) { + ctx.Data["Title"] = "Organization "+params["org"]+" Teams" + ctx.HTML(200, "org/teams") } +func New(ctx *middleware.Context) { + ctx.Data["Title"] = "Create an Organization" + ctx.HTML(200, "org/new") +} diff --git a/templates/org/new.tmpl b/templates/org/new.tmpl new file mode 100644 index 0000000000..baa9c9dfa0 --- /dev/null +++ b/templates/org/new.tmpl @@ -0,0 +1,48 @@ +{{template "base/head" .}} +{{template "base/navbar" .}} +
+
+ {{.CsrfTokenHtml}} +

Create New Organization

+ {{template "base/alert" .}} +
+ +
+

{{.SignedUserName}}

+ +
+
+ +
+ +
+ + Great organization names are short and memorable. +
+
+ +
+ +
+ + Organization's Email receives all notifications and confirmations. +
+
+ + + +
+
+ + Cancel +
+
+
+
+{{template "base/footer" .}} \ No newline at end of file