forgejo/templates/repo/settings/webhook/telegram.tmpl
wxiaoguang 597b04fe2f
Backport ctx locale refactoring manually (#27231) (#27259) (#27260)
Backport #27231 #27259 manually

---------

Co-authored-by: delvh <dev.lh@web.de>
2023-09-25 13:15:51 +00:00

19 lines
1.1 KiB
Go HTML Template

{{if eq .HookType "telegram"}}
<p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (ctx.Locale.Tr "repo.settings.web_hook_name_telegram") | 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">{{ctx.Locale.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">{{ctx.Locale.Tr "repo.settings.chat_id"}}</label>
<input id="chat_id" name="chat_id" type="text" value="{{.TelegramHook.ChatID}}" required>
</div>
<div class="field {{if .Err_ThreadID}}error{{end}}">
<label for="thread_id">{{ctx.Locale.Tr "repo.settings.thread_id"}}</label>
<input id="thread_id" name="thread_id" type="text" value="{{.TelegramHook.ThreadID}}">
</div>
{{template "repo/settings/webhook/settings" .}}
</form>
{{end}}