summaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-26 21:45:51 +0800
committerUnknwon <u@gogs.io>2015-08-26 21:45:51 +0800
commit28814564212b7c64136cc3eda3774af56983557e (patch)
treec0ea1c8ecb6504241a1d2b4111075ee2b0905470 /cmd
parent1cb03135b745675e614b0b89ab3fde412276fec1 (diff)
downloadgitea-28814564212b7c64136cc3eda3774af56983557e.tar.gz
gitea-28814564212b7c64136cc3eda3774af56983557e.zip
new webhooks list UI
Diffstat (limited to 'cmd')
-rw-r--r--cmd/web.go41
1 files changed, 27 insertions, 14 deletions
diff --git a/cmd/web.go b/cmd/web.go
index 0093600902..c661c13063 100644
--- a/cmd/web.go
+++ b/cmd/web.go
@@ -303,6 +303,7 @@ func runWeb(ctx *cli.Context) {
adminReq := middleware.Toggle(&middleware.ToggleOptions{SignInRequire: true, AdminRequire: true})
+ // ***** START: Admin *****
m.Group("/admin", func() {
m.Get("", adminReq, admin.Dashboard)
m.Get("/config", admin.Config)
@@ -339,6 +340,7 @@ func runWeb(ctx *cli.Context) {
m.Get("/:id:int/delete", admin.DeleteNotice)
})
}, adminReq)
+ // ***** END: Admin *****
m.Group("", func() {
m.Get("/:username", user.Profile)
@@ -377,7 +379,7 @@ func runWeb(ctx *cli.Context) {
reqRepoAdmin := middleware.RequireRepoAdmin()
- // Organization.
+ // ***** START: Organization *****
m.Group("/org", func() {
m.Get("/create", org.Create)
m.Post("/create", bindIgnErr(auth.CreateOrgForm{}), org.CreatePost)
@@ -403,9 +405,14 @@ func runWeb(ctx *cli.Context) {
m.Post("/teams/:team/delete", org.DeleteTeam)
m.Group("/settings", func() {
- m.Get("", org.Settings)
- m.Post("", bindIgnErr(auth.UpdateOrgSettingForm{}), org.SettingsPost)
- m.Get("/hooks", org.SettingsHooks)
+ m.Combo("").Get(org.Settings).
+ Post(bindIgnErr(auth.UpdateOrgSettingForm{}), org.SettingsPost)
+
+ m.Group("/hooks", func() {
+ m.Get("", org.Webhooks)
+ m.Post("/delete", org.DeleteWebhook)
+ })
+
m.Get("/hooks/new", repo.WebHooksNew)
m.Post("/hooks/gogs/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost)
m.Post("/hooks/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost)
@@ -421,8 +428,9 @@ func runWeb(ctx *cli.Context) {
m.Group("/org", func() {
m.Get("/:org", org.Home)
}, ignSignIn, middleware.OrgAssignment(true))
+ // ***** END: Organization *****
- // Repository.
+ // ***** START: Repository *****
m.Group("/repo", func() {
m.Get("/create", repo.Create)
m.Post("/create", bindIgnErr(auth.CreateRepoForm{}), repo.CreatePost)
@@ -433,11 +441,15 @@ func runWeb(ctx *cli.Context) {
}, reqSignIn)
m.Group("/:username/:reponame", func() {
- m.Get("/settings", repo.Settings)
- m.Post("/settings", bindIgnErr(auth.RepoSettingForm{}), repo.SettingsPost)
m.Group("/settings", func() {
- m.Route("/collaboration", "GET,POST", repo.SettingsCollaboration)
- m.Get("/hooks", repo.Webhooks)
+ m.Combo("").Get(repo.Settings).
+ Post(bindIgnErr(auth.RepoSettingForm{}), repo.SettingsPost)
+ m.Route("/collaboration", "GET,POST", repo.Collaboration)
+
+ m.Group("/hooks", func() {
+ m.Get("", repo.Webhooks)
+ m.Post("/delete", repo.DeleteWebhook)
+ })
m.Get("/hooks/new", repo.WebHooksNew)
m.Post("/hooks/gogs/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost)
m.Post("/hooks/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost)
@@ -446,14 +458,14 @@ func runWeb(ctx *cli.Context) {
m.Post("/hooks/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost)
m.Group("/hooks/git", func() {
- m.Get("", repo.SettingsGitHooks)
- m.Combo("/:name").Get(repo.SettingsGitHooksEdit).
- Post(repo.SettingsGitHooksEditPost)
+ m.Get("", repo.GitHooks)
+ m.Combo("/:name").Get(repo.GitHooksEdit).
+ Post(repo.GitHooksEditPost)
}, middleware.GitHookService())
m.Group("/keys", func() {
- m.Combo("").Get(repo.SettingsDeployKeys).
- Post(bindIgnErr(auth.AddSSHKeyForm{}), repo.SettingsDeployKeysPost)
+ m.Combo("").Get(repo.DeployKeys).
+ Post(bindIgnErr(auth.AddSSHKeyForm{}), repo.DeployKeysPost)
m.Post("/delete", repo.DeleteDeployKey)
})
@@ -536,6 +548,7 @@ func runWeb(ctx *cli.Context) {
m.Head("/hooks/trigger", repo.TriggerHook)
})
})
+ // ***** END: Repository *****
// robots.txt
m.Get("/robots.txt", func(ctx *middleware.Context) {