From 3e856928a2254c6409bf9370c88731fce8efc974 Mon Sep 17 00:00:00 2001 From: FuXiaoHei Date: Fri, 2 May 2014 22:07:34 +0800 Subject: add webhooks page ui --- routers/repo/setting.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'routers/repo/setting.go') diff --git a/routers/repo/setting.go b/routers/repo/setting.go index 8f7b84b6..aee3fe3a 100644 --- a/routers/repo/setting.go +++ b/routers/repo/setting.go @@ -204,3 +204,25 @@ func CollaborationPost(ctx *middleware.Context) { ctx.Flash.Success("New collaborator has been added.") ctx.Redirect(ctx.Req.RequestURI) } + +func WebHooks(ctx *middleware.Context) { + if !ctx.Repo.IsOwner { + ctx.Handle(404, "repo.WebHooks", nil) + return + } + + ctx.Data["IsRepoToolbarWebHooks"] = true + ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - Web Hooks" + ctx.HTML(200, "repo/hooks") +} + +func WebHooksAdd(ctx *middleware.Context) { + if !ctx.Repo.IsOwner { + ctx.Handle(404, "repo.WebHooksAdd", nil) + return + } + + ctx.Data["IsRepoToolbarWebHooks"] = true + ctx.Data["Title"] = strings.TrimPrefix(ctx.Repo.RepoLink, "/") + " - Add Web Hook" + ctx.HTML(200, "repo/hooks_add") +} -- cgit v1.2.3