From 98131614119f39a3f341392c98a4d2320b5b8e21 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Sat, 26 Jul 2014 23:53:16 -0400 Subject: Reser repo owner to organization when error occurs in repo create page, dashboard news feed page, create organization page --- cmd/web.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'cmd') diff --git a/cmd/web.go b/cmd/web.go index 744614f6..a0690cda 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -104,9 +104,8 @@ func runWeb(*cli.Context) { m.Get("/install", bindIgnErr(auth.InstallForm{}), routers.Install) m.Post("/install", bindIgnErr(auth.InstallForm{}), routers.InstallPost) m.Group("", func(r *macaron.Router) { - r.Get("/issues", user.Issues) r.Get("/pulls", user.Pulls) - r.Get("/stars", user.Stars) + r.Get("/issues", user.Issues) }, reqSignIn) // API routers. @@ -171,13 +170,6 @@ func runWeb(*cli.Context) { m.Map(cpt) m.Get("/captcha/*", cpt.Handler) - m.Group("/repo", func(r *macaron.Router) { - r.Get("/create", repo.Create) - r.Post("/create", bindIgnErr(auth.CreateRepoForm{}), repo.CreatePost) - r.Get("/migrate", repo.Migrate) - r.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), repo.MigratePost) - }, reqSignIn) - adminReq := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true, AdminRequire: true}) m.Get("/admin", adminReq, admin.Dashboard) @@ -215,10 +207,10 @@ func runWeb(*cli.Context) { // Organization routers. m.Group("/org", func(r *macaron.Router) { - r.Get("/create", org.New) - r.Post("/create", bindIgnErr(auth.CreateOrgForm{}), org.NewPost) + r.Get("/create", org.Create) + r.Post("/create", bindIgnErr(auth.CreateOrgForm{}), org.CreatePost) r.Get("/:org", org.Home) - r.Get("/:org/dashboard", org.Dashboard) + r.Get("/:org/dashboard", user.Dashboard) r.Get("/:org/members", org.Members) r.Get("/:org/teams", org.Teams) @@ -233,6 +225,14 @@ func runWeb(*cli.Context) { r.Post("/:org/settings/delete", org.DeletePost) }, reqSignIn) + // Repository routers. + m.Group("/repo", func(r *macaron.Router) { + r.Get("/create", repo.Create) + r.Post("/create", bindIgnErr(auth.CreateRepoForm{}), repo.CreatePost) + r.Get("/migrate", repo.Migrate) + r.Post("/migrate", bindIgnErr(auth.MigrateRepoForm{}), repo.MigratePost) + }, reqSignIn) + m.Group("/:username/:reponame", func(r *macaron.Router) { r.Get("/settings", repo.Setting) r.Post("/settings", bindIgnErr(auth.RepoSettingForm{}), repo.SettingPost) -- cgit v1.2.3