diff options
author | techknowlogick <matti@mdranta.net> | 2019-04-18 22:45:02 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-18 22:45:02 -0400 |
commit | 56da256853001cf3538b8d4ae99798e084935a90 (patch) | |
tree | cdbd686d31750aa89365635eb96705c5a9fc1efc /templates/repo/settings | |
parent | 6dbd26185203d464c4a4e32e7af04a34f37ae4f2 (diff) | |
download | gitea-56da256853001cf3538b8d4ae99798e084935a90.tar.gz gitea-56da256853001cf3538b8d4ae99798e084935a90.zip |
Telegram webhook (#4227)
Diffstat (limited to 'templates/repo/settings')
-rw-r--r-- | templates/repo/settings/webhook/list.tmpl | 3 | ||||
-rw-r--r-- | templates/repo/settings/webhook/new.tmpl | 3 | ||||
-rw-r--r-- | templates/repo/settings/webhook/telegram.tmpl | 15 |
3 files changed, 21 insertions, 0 deletions
diff --git a/templates/repo/settings/webhook/list.tmpl b/templates/repo/settings/webhook/list.tmpl index d2985c3676..ddba0f863c 100644 --- a/templates/repo/settings/webhook/list.tmpl +++ b/templates/repo/settings/webhook/list.tmpl @@ -20,6 +20,9 @@ <a class="item" href="{{.BaseLink}}/dingtalk/new"> <img class="img-10" src="{{AppSubUrl}}/img/dingtalk.ico">Dingtalk </a> + <a class="item" href="{{.BaseLink}}/telegram/new"> + <img class="img-10" src="{{AppSubUrl}}/img/telegram.png">Telegram + </a> </div> </div> </div> diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl index 1b3d114577..8c8b3280e5 100644 --- a/templates/repo/settings/webhook/new.tmpl +++ b/templates/repo/settings/webhook/new.tmpl @@ -17,6 +17,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"> {{end}} </div> </h4> @@ -26,6 +28,7 @@ {{template "repo/settings/webhook/slack" .}} {{template "repo/settings/webhook/discord" .}} {{template "repo/settings/webhook/dingtalk" .}} + {{template "repo/settings/webhook/telegram" .}} </div> {{template "repo/settings/webhook/history" .}} diff --git a/templates/repo/settings/webhook/telegram.tmpl b/templates/repo/settings/webhook/telegram.tmpl new file mode 100644 index 0000000000..598ac44822 --- /dev/null +++ b/templates/repo/settings/webhook/telegram.tmpl @@ -0,0 +1,15 @@ +{{if eq .HookType "telegram"}} + <p>{{.i18n.Tr "repo.settings.add_telegram_hook_desc" "https://core.telegram.org/bots" | Str2html}}</p> + <form class="ui form" action="{{.BaseLink}}/telegram/{{or .Webhook.ID "new"}}" method="post"> + {{.CsrfTokenHtml}} + <div class="required field {{if .Err_BotToken}}error{{end}}"> + <label for="bot_token">{{.i18n.Tr "repo.settings.bot_token"}}</label> + <input id="bot_token" name="bot_token" type="text" value="{{.TelegramHook.BotToken}}" autofocus required> + </div> + <div class="required field {{if .Err_ChatID}}error{{end}}"> + <label for="chat_id">{{.i18n.Tr "repo.settings.chat_id"}}</label> + <input id="chat_id" name="chat_id" type="text" value="{{.TelegramHook.ChatID}}" required> + </div> + {{template "repo/settings/webhook/settings" .}} + </form> +{{end}} |