diff --git a/cmd/web.go b/cmd/web.go index d6679fa254..bad19bfeb1 100644 --- a/cmd/web.go +++ b/cmd/web.go @@ -163,6 +163,7 @@ func runWeb(*cli.Context) { r.Post("/settings/collaboration", repo.CollaborationPost) r.Get("/settings/hooks", repo.WebHooks) r.Get("/settings/hooks/add", repo.WebHooksAdd) + r.Get("/settings/hooks/id", repo.WebHooksEdit) r.Get("/action/:action", repo.Action) r.Get("/issues/new", repo.CreateIssue) r.Post("/issues/new", bindIgnErr(auth.CreateIssueForm{}), repo.CreateIssuePost) diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 79d5f175da..b0ec761830 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -235,3 +235,14 @@ func WebHooksAdd(ctx *middleware.Context) { ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - Add Web Hook" ctx.HTML(200, "repo/hooks_add") } + +func WebHooksEdit(ctx *middleware.Context) { + if !ctx.Repo.IsOwner { + ctx.Handle(404, "repo.WebHooksEdit", nil) + return + } + + ctx.Data["IsRepoToolbarWebHooks"] = true + ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - Web Hook Name" + ctx.HTML(200, "repo/hooks_edit") +} diff --git a/templates/admin/nav.tmpl b/templates/admin/nav.tmpl index b9542228bc..e22ae0b9f5 100644 --- a/templates/admin/nav.tmpl +++ b/templates/admin/nav.tmpl @@ -4,6 +4,6 @@