aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/web.go
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-29 20:50:43 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-29 20:50:43 +0800
commitd2aff9a46a20bfd5345fec8a88d2638997a833c0 (patch)
treef655789858cc809b080bcd49ee75824384e550a5 /cmd/web.go
parent904bf1a50b021798344f8e124439bdd6a4db9cfc (diff)
downloadgitea-d2aff9a46a20bfd5345fec8a88d2638997a833c0.tar.gz
gitea-d2aff9a46a20bfd5345fec8a88d2638997a833c0.zip
Continue working on new admin pages
Diffstat (limited to 'cmd/web.go')
-rw-r--r--cmd/web.go44
1 files changed, 26 insertions, 18 deletions
diff --git a/cmd/web.go b/cmd/web.go
index de1aa03cc2..2bc9be457a 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -192,28 +192,36 @@ func runWeb(*cli.Context) {
adminReq := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true, AdminRequire: true})
- m.Get("/admin", adminReq, admin.Dashboard)
m.Group("/admin", func(r *macaron.Router) {
- r.Get("/users", admin.Users)
- r.Get("/repos", admin.Repositories)
- r.Get("/auths", admin.Auths)
+ m.Get("", adminReq, admin.Dashboard)
r.Get("/config", admin.Config)
r.Get("/monitor", admin.Monitor)
- }, adminReq)
- m.Group("/admin/users", func(r *macaron.Router) {
- r.Get("/new", admin.NewUser)
- r.Post("/new", bindIgnErr(auth.RegisterForm{}), admin.NewUserPost)
- r.Get("/:userid", admin.EditUser)
- r.Post("/:userid", bindIgnErr(auth.AdminEditUserForm{}), admin.EditUserPost)
- r.Post("/:userid/delete", admin.DeleteUser)
- }, adminReq)
- m.Group("/admin/auths", func(r *macaron.Router) {
- r.Get("/new", admin.NewAuthSource)
- r.Post("/new", bindIgnErr(auth.AuthenticationForm{}), admin.NewAuthSourcePost)
- r.Get("/:authid", admin.EditAuthSource)
- r.Post("/:authid", bindIgnErr(auth.AuthenticationForm{}), admin.EditAuthSourcePost)
- r.Get("/:authid/delete", admin.DeleteAuthSource)
+ m.Group("/users", func(r *macaron.Router) {
+ r.Get("", admin.Users)
+ r.Get("/new", admin.NewUser)
+ r.Post("/new", bindIgnErr(auth.RegisterForm{}), admin.NewUserPost)
+ r.Get("/:userid", admin.EditUser)
+ r.Post("/:userid", bindIgnErr(auth.AdminEditUserForm{}), admin.EditUserPost)
+ r.Post("/:userid/delete", admin.DeleteUser)
+ })
+
+ m.Group("/orgs", func(r *macaron.Router) {
+ r.Get("", admin.Organizations)
+ })
+
+ m.Group("/repos", func(r *macaron.Router) {
+ r.Get("", admin.Repositories)
+ })
+
+ m.Group("/auths", func(r *macaron.Router) {
+ r.Get("", admin.Authentications)
+ r.Get("/new", admin.NewAuthSource)
+ r.Post("/new", bindIgnErr(auth.AuthenticationForm{}), admin.NewAuthSourcePost)
+ r.Get("/:authid", admin.EditAuthSource)
+ r.Post("/:authid", bindIgnErr(auth.AuthenticationForm{}), admin.EditAuthSourcePost)
+ r.Post("/:authid/delete", admin.DeleteAuthSource)
+ })
}, adminReq)
m.Get("/:username", ignSignIn, user.Profile)