aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorUnknwon <joe2010xtmf@163.com>2014-08-14 14:12:21 +0800
committerUnknwon <joe2010xtmf@163.com>2014-08-14 14:12:21 +0800
commit5acc948562547b393ba1e89b012e7421143c6dd8 (patch)
tree657653112b206fb01ff184bd30cb680b5b5a21fa /cmd
parent2935ee440c82a7f998a74159255cc38924f6e0bc (diff)
downloadgitea-5acc948562547b393ba1e89b012e7421143c6dd8.tar.gz
gitea-5acc948562547b393ba1e89b012e7421143c6dd8.zip
Page: `/org/:orgname/settings`
Diffstat (limited to 'cmd')
-rw-r--r--cmd/web.go54
1 files changed, 31 insertions, 23 deletions
diff --git a/cmd/web.go b/cmd/web.go
index c49ba10540..03704c64de 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -159,18 +159,16 @@ func runWeb(*cli.Context) {
r.Get("/reset_password", user.ResetPasswd)
r.Post("/reset_password", user.ResetPasswdPost)
}, reqSignOut)
- m.Group("/user", func(r *macaron.Router) {
- r.Get("/settings", user.Settings)
- r.Post("/settings", bindIgnErr(auth.UpdateProfileForm{}), user.SettingsPost)
- m.Group("/settings", func(r *macaron.Router) {
- r.Get("/password", user.SettingsPassword)
- r.Post("/password", bindIgnErr(auth.ChangePasswordForm{}), user.SettingsPasswordPost)
- r.Get("/ssh", user.SettingsSSHKeys)
- r.Post("/ssh", bindIgnErr(auth.AddSSHKeyForm{}), user.SettingsSSHKeysPost)
- r.Get("/social", user.SettingsSocial)
- r.Get("/orgs", user.SettingsOrgs)
- r.Route("/delete", "GET,POST", user.SettingsDelete)
- })
+ m.Group("/user/settings", func(r *macaron.Router) {
+ r.Get("", user.Settings)
+ r.Post("", bindIgnErr(auth.UpdateProfileForm{}), user.SettingsPost)
+ r.Get("/password", user.SettingsPassword)
+ r.Post("/password", bindIgnErr(auth.ChangePasswordForm{}), user.SettingsPasswordPost)
+ r.Get("/ssh", user.SettingsSSHKeys)
+ r.Post("/ssh", bindIgnErr(auth.AddSSHKeyForm{}), user.SettingsSSHKeysPost)
+ r.Get("/social", user.SettingsSocial)
+ r.Get("/orgs", user.SettingsOrgs)
+ r.Route("/delete", "GET,POST", user.SettingsDelete)
}, reqSignIn)
m.Group("/user", func(r *macaron.Router) {
// r.Get("/feeds", binding.Bind(auth.FeedsForm{}), user.Feeds)
@@ -226,20 +224,30 @@ func runWeb(*cli.Context) {
m.Group("/org", func(r *macaron.Router) {
r.Get("/create", org.Create)
r.Post("/create", bindIgnErr(auth.CreateOrgForm{}), org.CreatePost)
- r.Get("/:org", org.Home)
- r.Get("/:org/dashboard", user.Dashboard)
- r.Get("/:org/members", org.Members)
- r.Get("/:org/teams", org.Teams)
- r.Get("/:org/teams/new", org.NewTeam)
- r.Post("/:org/teams/new", bindIgnErr(auth.CreateTeamForm{}), org.NewTeamPost)
- r.Get("/:org/teams/:team/edit", org.EditTeam)
+ m.Group("/:org", func(r *macaron.Router) {
+ r.Get("", org.Home)
+ }, middleware.OrgAssignment(true))
- r.Get("/:org/teams/:team", org.SingleTeam)
+ m.Group("/:org", func(r *macaron.Router) {
+ r.Get("/dashboard", user.Dashboard)
+ r.Get("/members", org.Members)
- r.Get("/:org/settings", org.Settings)
- r.Post("/:org/settings", bindIgnErr(auth.OrgSettingForm{}), org.SettingsPost)
- r.Post("/:org/settings/delete", org.DeletePost)
+ r.Get("/teams", org.Teams)
+ r.Get("/teams/:team", org.SingleTeam)
+ }, middleware.OrgAssignment(true, true))
+
+ m.Group("/:org", func(r *macaron.Router) {
+ r.Get("/teams/new", org.NewTeam)
+ r.Post("/teams/new", bindIgnErr(auth.CreateTeamForm{}), org.NewTeamPost)
+ r.Get("/teams/:team/edit", org.EditTeam)
+
+ m.Group("/settings", func(r *macaron.Router) {
+ r.Get("", org.Settings)
+ r.Post("", bindIgnErr(auth.UpdateOrgSettingForm{}), org.SettingsPost)
+ r.Route("/delete", "GET,POST", org.SettingsDelete)
+ })
+ }, middleware.OrgAssignment(true, true, true))
}, reqSignIn)
// Repository routers.