From c08600c59b8fb8d5f03fadacddb1140bc994ae94 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Thu, 27 Aug 2015 01:04:23 +0800 Subject: new edit webhook UI --- cmd/web.go | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'cmd') diff --git a/cmd/web.go b/cmd/web.go index 03b34befaa..cf681fbcb3 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -414,11 +414,11 @@ func runWeb(ctx *cli.Context) { m.Get("/:type/new", repo.WebhooksNew) m.Post("/gogs/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost) m.Post("/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost) + m.Get("/:id", repo.WebHooksEdit) + m.Post("/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) + m.Post("/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost) }) - m.Get("/hooks/:id", repo.WebHooksEdit) - m.Post("/hooks/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) - m.Post("/hooks/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost) m.Route("/delete", "GET,POST", org.SettingsDelete) }) @@ -452,18 +452,17 @@ func runWeb(ctx *cli.Context) { m.Get("/:type/new", repo.WebhooksNew) m.Post("/gogs/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost) m.Post("/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost) + m.Get("/:id", repo.WebHooksEdit) + m.Post("/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) + m.Post("/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost) + + m.Group("/git", func() { + m.Get("", repo.GitHooks) + m.Combo("/:name").Get(repo.GitHooksEdit). + Post(repo.GitHooksEditPost) + }, middleware.GitHookService()) }) - m.Get("/hooks/:id", repo.WebHooksEdit) - m.Post("/hooks/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) - m.Post("/hooks/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost) - - m.Group("/hooks/git", func() { - m.Get("", repo.GitHooks) - m.Combo("/:name").Get(repo.GitHooksEdit). - Post(repo.GitHooksEditPost) - }, middleware.GitHookService()) - m.Group("/keys", func() { m.Combo("").Get(repo.DeployKeys). Post(bindIgnErr(auth.AddSSHKeyForm{}), repo.DeployKeysPost) -- cgit v1.2.3