Skip to content

Commit

Permalink
backport: Fix adding default Telegram webhook (#7992)
Browse files Browse the repository at this point in the history
Signed-off-by: Gary Kim <[email protected]>
  • Loading branch information
gary-kim authored and lunny committed Aug 27, 2019
1 parent b6b1560 commit 4d6c8d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions routers/routes/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,15 @@ 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)
m.Post("/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.GogsHooksEditPost)
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)
})

Expand Down
3 changes: 3 additions & 0 deletions templates/admin/hook_new.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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}}
Expand All @@ -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>

Expand Down

0 comments on commit 4d6c8d9

Please sign in to comment.