diff options
Diffstat (limited to 'templates/repo/settings/webhook')
-rw-r--r-- | templates/repo/settings/webhook/base_list.tmpl | 24 | ||||
-rw-r--r-- | templates/repo/settings/webhook/delete_modal.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/settings/webhook/dingtalk.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/settings/webhook/discord.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/settings/webhook/feishu.tmpl | 6 | ||||
-rw-r--r-- | templates/repo/settings/webhook/gitea.tmpl | 10 | ||||
-rw-r--r-- | templates/repo/settings/webhook/gogs.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/settings/webhook/history.tmpl | 20 | ||||
-rw-r--r-- | templates/repo/settings/webhook/matrix.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/settings/webhook/msteams.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/settings/webhook/new.tmpl | 4 | ||||
-rw-r--r-- | templates/repo/settings/webhook/packagist.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/settings/webhook/settings.tmpl | 116 | ||||
-rw-r--r-- | templates/repo/settings/webhook/slack.tmpl | 12 | ||||
-rw-r--r-- | templates/repo/settings/webhook/telegram.tmpl | 8 | ||||
-rw-r--r-- | templates/repo/settings/webhook/wechatwork.tmpl | 4 |
16 files changed, 124 insertions, 124 deletions
diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl index b0e8ace410..ed6e670d60 100644 --- a/templates/repo/settings/webhook/base_list.tmpl +++ b/templates/repo/settings/webhook/base_list.tmpl @@ -2,51 +2,51 @@ {{.Title}} <div class="ui right"> <div class="ui jump dropdown"> - <div class="ui primary tiny button">{{.locale.Tr "repo.settings.add_webhook"}}</div> + <div class="ui primary tiny button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</div> <div class="menu"> <a class="item" href="{{.BaseLinkNew}}/gitea/new"> {{template "shared/webhook/icon" (dict "HookType" "gitea" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_gitea"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_gitea"}} </a> <a class="item" href="{{.BaseLinkNew}}/gogs/new"> {{template "shared/webhook/icon" (dict "HookType" "gogs" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_gogs"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_gogs"}} </a> <a class="item" href="{{.BaseLinkNew}}/slack/new"> {{template "shared/webhook/icon" (dict "HookType" "slack" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_slack"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_slack"}} </a> <a class="item" href="{{.BaseLinkNew}}/discord/new"> {{template "shared/webhook/icon" (dict "HookType" "discord" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_discord"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_discord"}} </a> <a class="item" href="{{.BaseLinkNew}}/dingtalk/new"> {{template "shared/webhook/icon" (dict "HookType" "dingtalk" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_dingtalk"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_dingtalk"}} </a> <a class="item" href="{{.BaseLinkNew}}/telegram/new"> {{template "shared/webhook/icon" (dict "HookType" "telegram" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_telegram"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_telegram"}} </a> <a class="item" href="{{.BaseLinkNew}}/msteams/new"> {{template "shared/webhook/icon" (dict "HookType" "msteams" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_msteams"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_msteams"}} </a> <a class="item" href="{{.BaseLinkNew}}/feishu/new"> {{template "shared/webhook/icon" (dict "HookType" "feishu" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}} </a> <a class="item" href="{{.BaseLinkNew}}/matrix/new"> {{template "shared/webhook/icon" (dict "HookType" "matrix" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_matrix"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_matrix"}} </a> <a class="item" href="{{.BaseLinkNew}}/wechatwork/new"> {{template "shared/webhook/icon" (dict "HookType" "wechatwork" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_wechatwork"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_wechatwork"}} </a> <a class="item" href="{{.BaseLinkNew}}/packagist/new"> {{template "shared/webhook/icon" (dict "HookType" "packagist" "Size" 20)}} - {{.locale.Tr "repo.settings.web_hook_name_packagist"}} + {{ctx.Locale.Tr "repo.settings.web_hook_name_packagist"}} </a> </div> </div> diff --git a/templates/repo/settings/webhook/delete_modal.tmpl b/templates/repo/settings/webhook/delete_modal.tmpl index b78e69e6f4..9955ed3a2f 100644 --- a/templates/repo/settings/webhook/delete_modal.tmpl +++ b/templates/repo/settings/webhook/delete_modal.tmpl @@ -1,10 +1,10 @@ <div class="ui g-modal-confirm delete modal"> <div class="header"> {{svg "octicon-trash"}} - {{.locale.Tr "repo.settings.webhook_deletion"}} + {{ctx.Locale.Tr "repo.settings.webhook_deletion"}} </div> <div class="content"> - <p>{{.locale.Tr "repo.settings.webhook_deletion_desc"}}</p> + <p>{{ctx.Locale.Tr "repo.settings.webhook_deletion_desc"}}</p> </div> {{template "base/modal_actions_confirm" .}} </div> diff --git a/templates/repo/settings/webhook/dingtalk.tmpl b/templates/repo/settings/webhook/dingtalk.tmpl index 25d5adf9b9..76c4452b75 100644 --- a/templates/repo/settings/webhook/dingtalk.tmpl +++ b/templates/repo/settings/webhook/dingtalk.tmpl @@ -1,9 +1,9 @@ {{if eq .HookType "dingtalk"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (.locale.Tr "repo.settings.web_hook_name_dingtalk") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (.locale.Tr "repo.settings.web_hook_name_dingtalk") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/dingtalk/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/discord.tmpl b/templates/repo/settings/webhook/discord.tmpl index 3d943c8219..d61981c748 100644 --- a/templates/repo/settings/webhook/discord.tmpl +++ b/templates/repo/settings/webhook/discord.tmpl @@ -1,17 +1,17 @@ {{if eq .HookType "discord"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (.locale.Tr "repo.settings.web_hook_name_discord") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (.locale.Tr "repo.settings.web_hook_name_discord") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/discord/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> <div class="field"> - <label for="username">{{.locale.Tr "repo.settings.discord_username"}}</label> + <label for="username">{{ctx.Locale.Tr "repo.settings.discord_username"}}</label> <input id="username" name="username" value="{{.DiscordHook.Username}}" placeholder="Gitea"> </div> <div class="field"> - <label for="icon_url">{{.locale.Tr "repo.settings.discord_icon_url"}}</label> + <label for="icon_url">{{ctx.Locale.Tr "repo.settings.discord_icon_url"}}</label> <input id="icon_url" name="icon_url" value="{{.DiscordHook.IconURL}}" placeholder="https://example.com/assets/img/logo.svg"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/feishu.tmpl b/templates/repo/settings/webhook/feishu.tmpl index 7de4430204..3bf61b4031 100644 --- a/templates/repo/settings/webhook/feishu.tmpl +++ b/templates/repo/settings/webhook/feishu.tmpl @@ -1,10 +1,10 @@ {{if eq .HookType "feishu"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (.locale.Tr "repo.settings.web_hook_name_feishu") | Str2html}}</p> - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (.locale.Tr "repo.settings.web_hook_name_larksuite") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (.locale.Tr "repo.settings.web_hook_name_feishu") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (.locale.Tr "repo.settings.web_hook_name_larksuite") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/feishu/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/gitea.tmpl b/templates/repo/settings/webhook/gitea.tmpl index 1850c663b1..41dfc69105 100644 --- a/templates/repo/settings/webhook/gitea.tmpl +++ b/templates/repo/settings/webhook/gitea.tmpl @@ -1,14 +1,14 @@ {{if eq .HookType "gitea"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gitea") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/gitea/{{or .Webhook.ID "new"}}" method="post"> {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.http_method"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.http_method"}}</label> <div class="ui selection dropdown"> <input type="hidden" id="http_method" name="http_method" value="{{if .Webhook.HTTPMethod}}{{.Webhook.HTTPMethod}}{{else}}POST{{end}}"> <div class="default text"></div> @@ -20,7 +20,7 @@ </div> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.content_type"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.content_type"}}</label> <div class="ui selection dropdown"> <input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}"> <div class="default text"></div> @@ -32,7 +32,7 @@ </div> </div> <div class="field {{if .Err_Secret}}error{{end}}"> - <label for="secret">{{.locale.Tr "repo.settings.secret"}}</label> + <label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label> <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/gogs.tmpl b/templates/repo/settings/webhook/gogs.tmpl index 176c24eb93..e047df3388 100644 --- a/templates/repo/settings/webhook/gogs.tmpl +++ b/templates/repo/settings/webhook/gogs.tmpl @@ -1,14 +1,14 @@ {{if eq .HookType "gogs"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://docs.gitea.com/usage/webhooks" (.locale.Tr "repo.settings.web_hook_name_gogs") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/gogs/{{or .Webhook.ID "new"}}" method="post"> {{template "base/disable_form_autofill"}} {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.content_type"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.content_type"}}</label> <div class="ui selection dropdown"> <input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}"> <div class="default text"></div> @@ -20,7 +20,7 @@ </div> </div> <div class="field {{if .Err_Secret}}error{{end}}"> - <label for="secret">{{.locale.Tr "repo.settings.secret"}}</label> + <label for="secret">{{ctx.Locale.Tr "repo.settings.secret"}}</label> <input id="secret" name="secret" type="password" value="{{.Webhook.Secret}}" autocomplete="off"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/history.tmpl b/templates/repo/settings/webhook/history.tmpl index 69e50989e6..fd404ae834 100644 --- a/templates/repo/settings/webhook/history.tmpl +++ b/templates/repo/settings/webhook/history.tmpl @@ -1,12 +1,12 @@ {{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}} {{if .PageIsSettingsHooksEdit}} <h4 class="ui top attached header"> - {{.locale.Tr "repo.settings.recent_deliveries"}} + {{ctx.Locale.Tr "repo.settings.recent_deliveries"}} {{if .Permission.IsAdmin}} <div class="ui right"> <!-- the button is wrapped with a span because the tooltip doesn't show on hover if we put data-tooltip-content directly on the button --> - <span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{.locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{.locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}"> - <button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{.locale.Tr "repo.settings.webhook.test_delivery"}}</button> + <span data-tooltip-content="{{if or $isNew .Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.test_delivery_desc_disabled"}}{{end}}"> + <button class="ui teal tiny button{{if not (or $isNew .Webhook.IsActive)}} disabled{{end}}" id="test-delivery" data-link="{{.Link}}/test" data-redirect="{{.Link}}">{{ctx.Locale.Tr "repo.settings.webhook.test_delivery"}}</button> </span> </div> {{end}} @@ -30,9 +30,9 @@ </div> <div class="info gt-hidden" id="info-{{.ID}}"> <div class="ui top attached tabular menu"> - <a class="item active" data-tab="request-{{.ID}}">{{$.locale.Tr "repo.settings.webhook.request"}}</a> + <a class="item active" data-tab="request-{{.ID}}">{{ctx.Locale.Tr "repo.settings.webhook.request"}}</a> <a class="item" data-tab="response-{{.ID}}"> - {{$.locale.Tr "repo.settings.webhook.response"}} + {{ctx.Locale.Tr "repo.settings.webhook.response"}} {{if .ResponseInfo}} {{if .IsSucceed}} <span class="ui green label">{{.ResponseInfo.Status}}</span> @@ -47,7 +47,7 @@ <div class="right menu"> <form class="item" action="{{$.Link}}/replay/{{.UUID}}" method="post"> {{$.CsrfTokenHtml}} - <span data-tooltip-content="{{if $.Webhook.IsActive}}{{$.locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{$.locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}"> + <span data-tooltip-content="{{if $.Webhook.IsActive}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description"}}{{else}}{{ctx.Locale.Tr "repo.settings.webhook.replay.description_disabled"}}{{end}}"> <button class="ui tiny button{{if not $.Webhook.IsActive}} disabled{{end}}">{{svg "octicon-sync"}}</button> </span> </form> @@ -56,12 +56,12 @@ </div> <div class="ui bottom attached tab segment active" data-tab="request-{{.ID}}"> {{if .RequestInfo}} - <h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5> + <h5>{{ctx.Locale.Tr "repo.settings.webhook.headers"}}</h5> <pre class="webhook-info"><strong>Request URL:</strong> {{.RequestInfo.URL}} <strong>Request method:</strong> {{if .RequestInfo.HTTPMethod}}{{.RequestInfo.HTTPMethod}}{{else}}POST{{end}} {{range $key, $val := .RequestInfo.Headers}}<strong>{{$key}}:</strong> {{$val}} {{end}}</pre> - <h5>{{$.locale.Tr "repo.settings.webhook.payload"}}</h5> + <h5>{{ctx.Locale.Tr "repo.settings.webhook.payload"}}</h5> <pre class="webhook-info"><code class="json">{{.PayloadContent}}</code></pre> {{else}} - @@ -69,10 +69,10 @@ </div> <div class="ui bottom attached tab segment" data-tab="response-{{.ID}}"> {{if .ResponseInfo}} - <h5>{{$.locale.Tr "repo.settings.webhook.headers"}}</h5> + <h5>{{ctx.Locale.Tr "repo.settings.webhook.headers"}}</h5> <pre class="webhook-info">{{range $key, $val := .ResponseInfo.Headers}}<strong>{{$key}}:</strong> {{$val}} {{end}}</pre> - <h5>{{$.locale.Tr "repo.settings.webhook.body"}}</h5> + <h5>{{ctx.Locale.Tr "repo.settings.webhook.body"}}</h5> <pre class="webhook-info"><code>{{.ResponseInfo.Body}}</code></pre> {{else}} - diff --git a/templates/repo/settings/webhook/matrix.tmpl b/templates/repo/settings/webhook/matrix.tmpl index d3ab5588bf..01c81914b0 100644 --- a/templates/repo/settings/webhook/matrix.tmpl +++ b/templates/repo/settings/webhook/matrix.tmpl @@ -1,17 +1,17 @@ {{if eq .HookType "matrix"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (.locale.Tr "repo.settings.web_hook_name_matrix") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (.locale.Tr "repo.settings.web_hook_name_matrix") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/matrix/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_HomeserverURL}}error{{end}}"> - <label for="homeserver_url">{{.locale.Tr "repo.settings.matrix.homeserver_url"}}</label> + <label for="homeserver_url">{{ctx.Locale.Tr "repo.settings.matrix.homeserver_url"}}</label> <input id="homeserver_url" name="homeserver_url" type="url" value="{{.MatrixHook.HomeserverURL}}" autofocus required> </div> <div class="required field {{if .Err_Room}}error{{end}}"> - <label for="room_id">{{.locale.Tr "repo.settings.matrix.room_id"}}</label> + <label for="room_id">{{ctx.Locale.Tr "repo.settings.matrix.room_id"}}</label> <input id="room_id" name="room_id" type="text" value="{{.MatrixHook.Room}}" required> </div> <div class="field"> - <label>{{.locale.Tr "repo.settings.matrix.message_type"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.matrix.message_type"}}</label> <div class="ui selection dropdown"> <input type="hidden" id="message_type" name="message_type" value="{{if .MatrixHook.MessageType}}{{.MatrixHook.MessageType}}{{else}}1{{end}}"> <div class="default text"></div> diff --git a/templates/repo/settings/webhook/msteams.tmpl b/templates/repo/settings/webhook/msteams.tmpl index fecb4d97be..e2d1826d07 100644 --- a/templates/repo/settings/webhook/msteams.tmpl +++ b/templates/repo/settings/webhook/msteams.tmpl @@ -1,9 +1,9 @@ {{if eq .HookType "msteams"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (.locale.Tr "repo.settings.web_hook_name_msteams") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (.locale.Tr "repo.settings.web_hook_name_msteams") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/msteams/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl index 67a5f7296f..b04a44213a 100644 --- a/templates/repo/settings/webhook/new.tmpl +++ b/templates/repo/settings/webhook/new.tmpl @@ -1,7 +1,7 @@ {{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings new webhook")}} <div class="repo-setting-content"> - {{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}} - {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}} + {{$CustomHeaderTitle := ctx.Locale.Tr "repo.settings.update_webhook"}} + {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = ctx.Locale.Tr "repo.settings.add_webhook"}}{{end}} {{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}} </div> {{template "repo/settings/layout_footer" .}} diff --git a/templates/repo/settings/webhook/packagist.tmpl b/templates/repo/settings/webhook/packagist.tmpl index b8033c1043..7c37684369 100644 --- a/templates/repo/settings/webhook/packagist.tmpl +++ b/templates/repo/settings/webhook/packagist.tmpl @@ -1,17 +1,17 @@ {{if eq .HookType "packagist"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (.locale.Tr "repo.settings.web_hook_name_packagist") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (.locale.Tr "repo.settings.web_hook_name_packagist") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/packagist/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_Username}}error{{end}}"> - <label for="username">{{.locale.Tr "repo.settings.packagist_username"}}</label> + <label for="username">{{ctx.Locale.Tr "repo.settings.packagist_username"}}</label> <input id="username" name="username" value="{{.PackagistHook.Username}}" placeholder="Gitea" autofocus required> </div> <div class="required field {{if .Err_APIToken}}error{{end}}"> - <label for="api_token">{{.locale.Tr "repo.settings.packagist_api_token"}}</label> + <label for="api_token">{{ctx.Locale.Tr "repo.settings.packagist_api_token"}}</label> <input id="api_token" name="api_token" value="{{.PackagistHook.APIToken}}" placeholder="X5F_tZ-Wj3c1vqaU2Rky" required> </div> <div class="required field {{if .Err_PackageURL}}error{{end}}"> - <label for="package_url">{{.locale.Tr "repo.settings.packagist_package_url"}}</label> + <label for="package_url">{{ctx.Locale.Tr "repo.settings.packagist_package_url"}}</label> <input id="package_url" name="package_url" value="{{.PackagistHook.PackageURL}}" placeholder="https://packagist.org/packages/laravel/framework" required> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/settings.tmpl b/templates/repo/settings/webhook/settings.tmpl index a669d2c9a3..addf99d45a 100644 --- a/templates/repo/settings/webhook/settings.tmpl +++ b/templates/repo/settings/webhook/settings.tmpl @@ -1,23 +1,23 @@ {{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}} <div class="field"> - <h4>{{.locale.Tr "repo.settings.event_desc"}}</h4> + <h4>{{ctx.Locale.Tr "repo.settings.event_desc"}}</h4> <div class="grouped event type fields"> <div class="field"> <div class="ui radio non-events checkbox"> <input name="events" type="radio" value="push_only" {{if or $isNew .Webhook.PushOnly}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_push_only" | Str2html}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_push_only" | Str2html}}</label> </div> </div> <div class="field"> <div class="ui radio non-events checkbox"> <input name="events" type="radio" value="send_everything" {{if .Webhook.SendEverything}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_send_everything" | Str2html}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_send_everything" | Str2html}}</label> </div> </div> <div class="field"> <div class="ui radio events checkbox"> <input name="events" type="radio" value="choose_events" {{if .Webhook.ChooseEvents}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_choose" | Str2html}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_choose" | Str2html}}</label> </div> </div> </div> @@ -25,15 +25,15 @@ <div class="events fields ui grid {{if not .Webhook.ChooseEvents}}gt-hidden{{end}}"> <!-- Repository Events --> <div class="fourteen wide column"> - <label>{{.locale.Tr "repo.settings.event_header_repository"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_header_repository"}}</label> </div> <!-- Create --> <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> <input name="create" type="checkbox" {{if .Webhook.Create}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_create"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_create_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_create"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_create_desc"}}</span> </div> </div> </div> @@ -42,8 +42,8 @@ <div class="field"> <div class="ui checkbox"> <input name="delete" type="checkbox" {{if .Webhook.Delete}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_delete"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_delete_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_delete"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_delete_desc"}}</span> </div> </div> </div> @@ -52,8 +52,8 @@ <div class="field"> <div class="ui checkbox"> <input name="fork" type="checkbox" {{if .Webhook.Fork}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_fork"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_fork_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_fork"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_fork_desc"}}</span> </div> </div> </div> @@ -62,8 +62,8 @@ <div class="field"> <div class="ui checkbox"> <input name="push" type="checkbox" {{if .Webhook.Push}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_push"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_push_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_push"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_push_desc"}}</span> </div> </div> </div> @@ -72,8 +72,8 @@ <div class="field"> <div class="ui checkbox"> <input name="repository" type="checkbox" {{if .Webhook.Repository}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_repository"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_repository_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_repository"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_repository_desc"}}</span> </div> </div> </div> @@ -82,8 +82,8 @@ <div class="field"> <div class="ui checkbox"> <input name="release" type="checkbox" {{if .Webhook.Release}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_release"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_release_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_release"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_release_desc"}}</span> </div> </div> </div> @@ -92,8 +92,8 @@ <div class="field"> <div class="ui checkbox"> <input name="package" type="checkbox" {{if .Webhook.Package}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_package"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_package_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_package"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_package_desc"}}</span> </div> </div> </div> @@ -103,23 +103,23 @@ <div class="field"> <div class="ui checkbox"> <input name="wiki" type="checkbox" {{if .Webhook.Wiki}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_wiki"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_wiki_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_wiki"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_wiki_desc"}}</span> </div> </div> </div> <!-- Issue Events --> <div class="fourteen wide column"> - <label>{{.locale.Tr "repo.settings.event_header_issue"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_header_issue"}}</label> </div> <!-- Issues --> <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> <input name="issues" type="checkbox" {{if .Webhook.Issues}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issues"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issues_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issues"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issues_desc"}}</span> </div> </div> </div> @@ -128,8 +128,8 @@ <div class="field"> <div class="ui checkbox"> <input name="issue_assign" type="checkbox" {{if .Webhook.IssueAssign}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issue_assign"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issue_assign_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issue_assign"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_assign_desc"}}</span> </div> </div> </div> @@ -138,8 +138,8 @@ <div class="field"> <div class="ui checkbox"> <input name="issue_label" type="checkbox" {{if .Webhook.IssueLabel}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issue_label"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issue_label_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issue_label"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_label_desc"}}</span> </div> </div> </div> @@ -148,8 +148,8 @@ <div class="field"> <div class="ui checkbox"> <input name="issue_milestone" type="checkbox" {{if .Webhook.IssueMilestone}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issue_milestone"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issue_milestone_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issue_milestone"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_milestone_desc"}}</span> </div> </div> </div> @@ -158,23 +158,23 @@ <div class="field"> <div class="ui checkbox"> <input name="issue_comment" type="checkbox" {{if .Webhook.IssueComment}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_issue_comment"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_issue_comment_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_issue_comment"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_issue_comment_desc"}}</span> </div> </div> </div> <!-- Pull Request Events --> <div class="fourteen wide column"> - <label>{{.locale.Tr "repo.settings.event_header_pull_request"}}</label> + <label>{{ctx.Locale.Tr "repo.settings.event_header_pull_request"}}</label> </div> <!-- Pull Request --> <div class="seven wide column"> <div class="field"> <div class="ui checkbox"> <input name="pull_request" type="checkbox" {{if .Webhook.PullRequest}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_desc"}}</span> </div> </div> </div> @@ -183,8 +183,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_assign" type="checkbox" {{if .Webhook.PullRequestAssign}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_assign"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_assign"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_assign_desc"}}</span> </div> </div> </div> @@ -193,8 +193,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_label" type="checkbox" {{if .Webhook.PullRequestLabel}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_label"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_label_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_label"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_label_desc"}}</span> </div> </div> </div> @@ -203,8 +203,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_milestone" type="checkbox" {{if .Webhook.PullRequestMilestone}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_milestone"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_milestone_desc"}}</span> </div> </div> </div> @@ -213,8 +213,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_comment" type="checkbox" {{if .Webhook.PullRequestComment}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_comment"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_comment"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_comment_desc"}}</span> </div> </div> </div> @@ -223,8 +223,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_review" type="checkbox" {{if .Webhook.PullRequestReview}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_review"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_review_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_desc"}}</span> </div> </div> </div> @@ -233,8 +233,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_sync" type="checkbox" {{if .Webhook.PullRequestSync}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_sync"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_sync"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_sync_desc"}}</span> </div> </div> </div> @@ -243,8 +243,8 @@ <div class="field"> <div class="ui checkbox"> <input name="pull_request_review_request" type="checkbox" {{if .Webhook.PullRequestReviewRequest}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.event_pull_request_review_request"}}</label> - <span class="help">{{.locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.event_pull_request_review_request_desc"}}</span> </div> </div> </div> @@ -253,17 +253,17 @@ <!-- Branch filter --> <div class="field"> - <label for="branch_filter">{{.locale.Tr "repo.settings.branch_filter"}}</label> + <label for="branch_filter">{{ctx.Locale.Tr "repo.settings.branch_filter"}}</label> <input name="branch_filter" type="text" value="{{or .Webhook.BranchFilter "*"}}"> - <span class="help">{{.locale.Tr "repo.settings.branch_filter_desc" | Str2html}}</span> + <span class="help">{{ctx.Locale.Tr "repo.settings.branch_filter_desc" | Str2html}}</span> </div> <!-- Authorization Header --> <div class="field{{if eq .HookType "matrix"}} required{{end}}"> - <label for="authorization_header">{{.locale.Tr "repo.settings.authorization_header"}}</label> + <label for="authorization_header">{{ctx.Locale.Tr "repo.settings.authorization_header"}}</label> <input id="authorization_header" name="authorization_header" type="text" value="{{.Webhook.HeaderAuthorization}}"{{if eq .HookType "matrix"}} placeholder="Bearer $access_token" required{{end}}> {{if ne .HookType "matrix"}}{{/* Matrix doesn't make the authorization optional but it is implied by the help string, should be changed.*/}} - <span class="help">{{.locale.Tr "repo.settings.authorization_header_desc" "<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | Str2html}}</span> + <span class="help">{{ctx.Locale.Tr "repo.settings.authorization_header_desc" "<code>Bearer token123456</code>, <code>Basic YWxhZGRpbjpvcGVuc2VzYW1l</code>" | Str2html}}</span> {{end}} </div> @@ -272,16 +272,16 @@ <div class="inline field"> <div class="ui checkbox"> <input name="active" type="checkbox" {{if or $isNew .Webhook.IsActive}}checked{{end}}> - <label>{{.locale.Tr "repo.settings.active"}}</label> - <span class="help">{{.locale.Tr "repo.settings.active_helper"}}</span> + <label>{{ctx.Locale.Tr "repo.settings.active"}}</label> + <span class="help">{{ctx.Locale.Tr "repo.settings.active_helper"}}</span> </div> </div> <div class="field"> {{if $isNew}} - <button class="ui primary button">{{.locale.Tr "repo.settings.add_webhook"}}</button> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.add_webhook"}}</button> {{else}} - <button class="ui primary button">{{.locale.Tr "repo.settings.update_webhook"}}</button> - <a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{.locale.Tr "repo.settings.delete_webhook"}}</a> + <button class="ui primary button">{{ctx.Locale.Tr "repo.settings.update_webhook"}}</button> + <a class="ui red delete-button button" data-url="{{.BaseLink}}/delete" data-id="{{.Webhook.ID}}">{{ctx.Locale.Tr "repo.settings.delete_webhook"}}</a> {{end}} </div> diff --git a/templates/repo/settings/webhook/slack.tmpl b/templates/repo/settings/webhook/slack.tmpl index 335966a6d1..8607ec4d3c 100644 --- a/templates/repo/settings/webhook/slack.tmpl +++ b/templates/repo/settings/webhook/slack.tmpl @@ -1,26 +1,26 @@ {{if eq .HookType "slack"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (.locale.Tr "repo.settings.web_hook_name_slack") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (.locale.Tr "repo.settings.web_hook_name_slack") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/slack/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> <div class="required field {{if .Err_Channel}}error{{end}}"> - <label for="channel">{{.locale.Tr "repo.settings.slack_channel"}}</label> + <label for="channel">{{ctx.Locale.Tr "repo.settings.slack_channel"}}</label> <input id="channel" name="channel" value="{{.SlackHook.Channel}}" placeholder="#general" required> </div> <div class="field"> - <label for="username">{{.locale.Tr "repo.settings.slack_username"}}</label> + <label for="username">{{ctx.Locale.Tr "repo.settings.slack_username"}}</label> <input id="username" name="username" value="{{.SlackHook.Username}}" placeholder="Gitea"> </div> <div class="field"> - <label for="icon_url">{{.locale.Tr "repo.settings.slack_icon_url"}}</label> + <label for="icon_url">{{ctx.Locale.Tr "repo.settings.slack_icon_url"}}</label> <input id="icon_url" name="icon_url" value="{{.SlackHook.IconURL}}" placeholder="https://example.com/img/favicon.png"> </div> <div class="field"> - <label for="color">{{.locale.Tr "repo.settings.slack_color"}}</label> + <label for="color">{{ctx.Locale.Tr "repo.settings.slack_color"}}</label> <input id="color" name="color" value="{{.SlackHook.Color}}" placeholder="#dd4b39, good, warning, danger"> </div> {{template "repo/settings/webhook/settings" .}} diff --git a/templates/repo/settings/webhook/telegram.tmpl b/templates/repo/settings/webhook/telegram.tmpl index f618fea140..f9858c365f 100644 --- a/templates/repo/settings/webhook/telegram.tmpl +++ b/templates/repo/settings/webhook/telegram.tmpl @@ -1,17 +1,17 @@ {{if eq .HookType "telegram"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (.locale.Tr "repo.settings.web_hook_name_telegram") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (.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">{{.locale.Tr "repo.settings.bot_token"}}</label> + <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">{{.locale.Tr "repo.settings.chat_id"}}</label> + <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">{{.locale.Tr "repo.settings.thread_id"}}</label> + <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" .}} diff --git a/templates/repo/settings/webhook/wechatwork.tmpl b/templates/repo/settings/webhook/wechatwork.tmpl index a84bbfa5e1..e571a32539 100644 --- a/templates/repo/settings/webhook/wechatwork.tmpl +++ b/templates/repo/settings/webhook/wechatwork.tmpl @@ -1,9 +1,9 @@ {{if eq .HookType "wechatwork"}} - <p>{{.locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (.locale.Tr "repo.settings.web_hook_name_wechatwork") | Str2html}}</p> + <p>{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (.locale.Tr "repo.settings.web_hook_name_wechatwork") | Str2html}}</p> <form class="ui form" action="{{.BaseLink}}/wechatwork/{{or .Webhook.ID "new"}}" method="post"> {{.CsrfTokenHtml}} <div class="required field {{if .Err_PayloadURL}}error{{end}}"> - <label for="payload_url">{{.locale.Tr "repo.settings.payload_url"}}</label> + <label for="payload_url">{{ctx.Locale.Tr "repo.settings.payload_url"}}</label> <input id="payload_url" name="payload_url" type="url" value="{{.Webhook.URL}}" autofocus required> </div> {{template "repo/settings/webhook/settings" .}} |