diff options
author | Kerwin Bryant <kerwin612@qq.com> | 2023-09-06 18:11:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-06 10:11:06 +0000 |
commit | 9b0743ae33e8342e00a7ad3a6ba8af81b4c7019e (patch) | |
tree | 9f810aa4870c9e44d6a5820ab64888ee2fbd20dd /templates/admin | |
parent | 7812ce86dcd5aa31363915c00d3d9c934b9a7191 (diff) | |
download | gitea-9b0743ae33e8342e00a7ad3a6ba8af81b4c7019e.tar.gz gitea-9b0743ae33e8342e00a7ad3a6ba8af81b4c7019e.zip |
Extract common code to new template (#26933)
Same as #26903
Diffstat (limited to 'templates/admin')
-rw-r--r-- | templates/admin/hook_new.tmpl | 38 |
1 files changed, 9 insertions, 29 deletions
diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl index e72e7bba62..f565318b8b 100644 --- a/templates/admin/hook_new.tmpl +++ b/templates/admin/hook_new.tmpl @@ -1,33 +1,13 @@ {{template "admin/layout_head" (dict "ctxData" . "pageClass" "admin settings new webhook")}} <div class="admin-setting-content"> - <h4 class="ui top attached header"> - {{if .PageIsAdminDefaultHooksNew}} - {{.locale.Tr "admin.defaulthooks.add_webhook"}} - {{else if .PageIsAdminSystemHooksNew}} - {{.locale.Tr "admin.systemhooks.add_webhook"}} - {{else if .Webhook.IsSystemWebhook}} - {{.locale.Tr "admin.systemhooks.update_webhook"}} - {{else}} - {{.locale.Tr "admin.defaulthooks.update_webhook"}} - {{end}} - <div class="ui right"> - {{template "shared/webhook/icon" .}} - </div> - </h4> - <div class="ui attached segment"> - {{template "repo/settings/webhook/gitea" .}} - {{template "repo/settings/webhook/gogs" .}} - {{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" .}} - {{template "repo/settings/webhook/feishu" .}} - {{template "repo/settings/webhook/matrix" .}} - {{template "repo/settings/webhook/wechatwork" .}} - {{template "repo/settings/webhook/packagist" .}} - </div> - - {{template "repo/settings/webhook/history" .}} + {{$CustomHeaderTitle := .locale.Tr "admin.defaulthooks.update_webhook"}} + {{if .PageIsAdminDefaultHooksNew}} + {{$CustomHeaderTitle = .locale.Tr "admin.defaulthooks.add_webhook"}} + {{else if .PageIsAdminSystemHooksNew}} + {{$CustomHeaderTitle = .locale.Tr "admin.systemhooks.add_webhook"}} + {{else if .Webhook.IsSystemWebhook}} + {{$CustomHeaderTitle = .locale.Tr "admin.systemhooks.update_webhook"}} + {{end}} + {{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}} </div> {{template "admin/layout_footer" .}} |