summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGary Kim <gary@garykim.dev>2019-08-26 22:59:10 +0000
committertechknowlogick <techknowlogick@gitea.io>2019-08-26 18:59:10 -0400
commit541fab196f216771a51419a8b8d353694afa6c45 (patch)
treeec221139355ba7ea697c7a091a09dfb07398461a
parentbb5f7cdae6276a2e48f106c3cf84ab7d2de74aa4 (diff)
downloadgitea-541fab196f216771a51419a8b8d353694afa6c45.tar.gz
gitea-541fab196f216771a51419a8b8d353694afa6c45.zip
Fix adding default Telegram webhook (#7972)
* Fix adding default Telegram webhook Fixes #7932 Signed-off-by: Gary Kim <gary@garykim.dev> * Run goimports Signed-off-by: Gary Kim <gary@garykim.dev>
-rw-r--r--routers/routes/routes.go2
-rw-r--r--templates/admin/hook_new.tmpl3
2 files changed, 5 insertions, 0 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go
index 8c329a5f6f..2afd0dcce9 100644
--- a/routers/routes/routes.go
+++ b/routers/routes/routes.go
@@ -446,6 +446,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost)
m.Post("/discord/new", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksNewPost)
m.Post("/dingtalk/new", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksNewPost)
+ m.Post("/telegram/new", bindIgnErr(auth.NewTelegramHookForm{}), repo.TelegramHooksNewPost)
m.Post("/msteams/new", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost)
m.Get("/:id", repo.WebHooksEdit)
m.Post("/gitea/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost)
@@ -453,6 +454,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Post("/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost)
m.Post("/discord/:id", bindIgnErr(auth.NewDiscordHookForm{}), repo.DiscordHooksEditPost)
m.Post("/dingtalk/:id", bindIgnErr(auth.NewDingtalkHookForm{}), repo.DingtalkHooksEditPost)
+ m.Post("/telegram/:id", bindIgnErr(auth.NewTelegramHookForm{}), repo.TelegramHooksEditPost)
m.Post("/msteams/:id", bindIgnErr(auth.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost)
})
diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl
index 457c9cde45..c047efe9a2 100644
--- a/templates/admin/hook_new.tmpl
+++ b/templates/admin/hook_new.tmpl
@@ -20,6 +20,8 @@
<img class="img-13" src="{{AppSubUrl}}/img/discord.png">
{{else if eq .HookType "dingtalk"}}
<img class="img-13" src="{{AppSubUrl}}/img/dingtalk.ico">
+ {{else if eq .HookType "telegram"}}
+ <img class="img-13" src="{{AppSubUrl}}/img/telegram.png">
{{else if eq .HookType "msteams"}}
<img class="img-13" src="{{AppSubUrl}}/img/msteams.png">
{{end}}
@@ -31,6 +33,7 @@
{{template "repo/settings/webhook/slack" .}}
{{template "repo/settings/webhook/discord" .}}
{{template "repo/settings/webhook/dingtalk" .}}
+ {{template "repo/settings/webhook/telegram" .}}
{{template "repo/settings/webhook/msteams" .}}
</div>