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")}}
-
-
- {{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" .}}
-
-
- {{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)}}
{{template "admin/layout_footer" .}}
diff --git a/templates/org/settings/hook_new.tmpl b/templates/org/settings/hook_new.tmpl
index d4343f8c68..ea477c9975 100644
--- a/templates/org/settings/hook_new.tmpl
+++ b/templates/org/settings/hook_new.tmpl
@@ -1,5 +1,7 @@
{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings new webhook")}}
- {{template "webhook/new" .}}
+ {{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
+ {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}}
+ {{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
{{template "org/settings/layout_footer" .}}
diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl
index 79fd4bd2ff..67a5f7296f 100644
--- a/templates/repo/settings/webhook/new.tmpl
+++ b/templates/repo/settings/webhook/new.tmpl
@@ -1,5 +1,7 @@
{{template "repo/settings/layout_head" (dict "ctxData" . "pageClass" "repository settings new webhook")}}
- {{template "webhook/new" .}}
+ {{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
+ {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}}
+ {{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
{{template "repo/settings/layout_footer" .}}
diff --git a/templates/user/settings/hook_new.tmpl b/templates/user/settings/hook_new.tmpl
index 4d3ddf0383..9a857db85c 100644
--- a/templates/user/settings/hook_new.tmpl
+++ b/templates/user/settings/hook_new.tmpl
@@ -1,5 +1,7 @@
{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings new webhook")}}
- {{template "webhook/new" .}}
+ {{$CustomHeaderTitle := .locale.Tr "repo.settings.update_webhook"}}
+ {{if .PageIsSettingsHooksNew}}{{$CustomHeaderTitle = .locale.Tr "repo.settings.add_webhook"}}{{end}}
+ {{template "webhook/new" (dict "ctxData" . "CustomHeaderTitle" $CustomHeaderTitle)}}
{{template "user/settings/layout_footer" .}}
diff --git a/templates/webhook/new.tmpl b/templates/webhook/new.tmpl
index b5878fc930..a185c42b51 100644
--- a/templates/webhook/new.tmpl
+++ b/templates/webhook/new.tmpl
@@ -1,20 +1,20 @@
- {{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" .}}
+ {{template "repo/settings/webhook/gitea" .ctxData}}
+ {{template "repo/settings/webhook/gogs" .ctxData}}
+ {{template "repo/settings/webhook/slack" .ctxData}}
+ {{template "repo/settings/webhook/discord" .ctxData}}
+ {{template "repo/settings/webhook/dingtalk" .ctxData}}
+ {{template "repo/settings/webhook/telegram" .ctxData}}
+ {{template "repo/settings/webhook/msteams" .ctxData}}
+ {{template "repo/settings/webhook/feishu" .ctxData}}
+ {{template "repo/settings/webhook/matrix" .ctxData}}
+ {{template "repo/settings/webhook/wechatwork" .ctxData}}
+ {{template "repo/settings/webhook/packagist" .ctxData}}
-{{template "repo/settings/webhook/history" .}}
+{{template "repo/settings/webhook/history" .ctxData}}