diff options
author | Unknwon <u@gogs.io> | 2015-08-26 21:45:51 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-26 21:45:51 +0800 |
commit | 28814564212b7c64136cc3eda3774af56983557e (patch) | |
tree | c0ea1c8ecb6504241a1d2b4111075ee2b0905470 /routers/org | |
parent | 1cb03135b745675e614b0b89ab3fde412276fec1 (diff) | |
download | gitea-28814564212b7c64136cc3eda3774af56983557e.tar.gz gitea-28814564212b7c64136cc3eda3774af56983557e.zip |
new webhooks list UI
Diffstat (limited to 'routers/org')
-rw-r--r-- | routers/org/setting.go | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/routers/org/setting.go b/routers/org/setting.go index 7a76199502..a15af26d43 100644 --- a/routers/org/setting.go +++ b/routers/org/setting.go @@ -105,9 +105,11 @@ func SettingsDelete(ctx *middleware.Context) { ctx.HTML(200, SETTINGS_DELETE) } -func SettingsHooks(ctx *middleware.Context) { +func Webhooks(ctx *middleware.Context) { ctx.Data["Title"] = ctx.Tr("org.settings") ctx.Data["PageIsSettingsHooks"] = true + ctx.Data["BaseLink"] = ctx.Org.OrgLink + ctx.Data["Description"] = ctx.Tr("org.settings.hooks_desc") // Delete web hook. remove := com.StrTo(ctx.Query("remove")).MustInt64() @@ -130,3 +132,15 @@ func SettingsHooks(ctx *middleware.Context) { ctx.Data["Webhooks"] = ws ctx.HTML(200, SETTINGS_HOOKS) } + +func DeleteWebhook(ctx *middleware.Context) { + if err := models.DeleteWebhook(ctx.QueryInt64("id")); err != nil { + ctx.Flash.Error("DeleteWebhook: " + err.Error()) + } else { + ctx.Flash.Success(ctx.Tr("repo.settings.webhook_deletion_success")) + } + + ctx.JSON(200, map[string]interface{}{ + "redirect": ctx.Org.OrgLink + "/settings/hooks", + }) +} |