From e68b9d00a6e05b3a941f63ffb696f91e554ac5ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.3. Signed-off-by: Daniel Baumann --- templates/webhook/new.tmpl | 44 +++++++ templates/webhook/new/dingtalk.tmpl | 9 ++ templates/webhook/new/discord.tmpl | 17 +++ templates/webhook/new/feishu.tmpl | 10 ++ templates/webhook/new/forgejo.tmpl | 38 ++++++ templates/webhook/new/gitea.tmpl | 38 ++++++ templates/webhook/new/gogs.tmpl | 26 ++++ templates/webhook/new/matrix.tmpl | 32 +++++ templates/webhook/new/msteams.tmpl | 9 ++ templates/webhook/new/packagist.tmpl | 17 +++ templates/webhook/new/slack.tmpl | 26 ++++ templates/webhook/new/sourcehut_builds.tmpl | 39 ++++++ templates/webhook/new/telegram.tmpl | 17 +++ templates/webhook/new/wechatwork.tmpl | 9 ++ templates/webhook/shared-settings.tmpl | 193 ++++++++++++++++++++++++++++ 15 files changed, 524 insertions(+) create mode 100644 templates/webhook/new.tmpl create mode 100644 templates/webhook/new/dingtalk.tmpl create mode 100644 templates/webhook/new/discord.tmpl create mode 100644 templates/webhook/new/feishu.tmpl create mode 100644 templates/webhook/new/forgejo.tmpl create mode 100644 templates/webhook/new/gitea.tmpl create mode 100644 templates/webhook/new/gogs.tmpl create mode 100644 templates/webhook/new/matrix.tmpl create mode 100644 templates/webhook/new/msteams.tmpl create mode 100644 templates/webhook/new/packagist.tmpl create mode 100644 templates/webhook/new/slack.tmpl create mode 100644 templates/webhook/new/sourcehut_builds.tmpl create mode 100644 templates/webhook/new/telegram.tmpl create mode 100644 templates/webhook/new/wechatwork.tmpl create mode 100644 templates/webhook/shared-settings.tmpl (limited to 'templates/webhook') diff --git a/templates/webhook/new.tmpl b/templates/webhook/new.tmpl new file mode 100644 index 0000000..a3fd896 --- /dev/null +++ b/templates/webhook/new.tmpl @@ -0,0 +1,44 @@ +

+ {{.CustomHeaderTitle}} + +

+
+ {{with .ctxData}} + + {{if eq .HookType "forgejo"}} + {{template "webhook/new/forgejo" .}} + {{else if eq .HookType "gitea"}} + {{template "webhook/new/gitea" .}} + {{else if eq .HookType "gogs"}} + {{template "webhook/new/gogs" .}} + {{else if eq .HookType "slack"}} + {{template "webhook/new/slack" .}} + {{else if eq .HookType "discord"}} + {{template "webhook/new/discord" .}} + {{else if eq .HookType "dingtalk"}} + {{template "webhook/new/dingtalk" .}} + {{else if eq .HookType "telegram"}} + {{template "webhook/new/telegram" .}} + {{else if eq .HookType "msteams"}} + {{template "webhook/new/msteams" .}} + {{else if eq .HookType "feishu"}} + {{template "webhook/new/feishu" .}} + {{else if eq .HookType "matrix"}} + {{template "webhook/new/matrix" .}} + {{else if eq .HookType "wechatwork"}} + {{template "webhook/new/wechatwork" .}} + {{else if eq .HookType "packagist"}} + {{template "webhook/new/packagist" .}} + {{else if eq .HookType "sourcehut_builds"}} + {{template "webhook/new/sourcehut_builds" .}} + {{end}} + {{end}} +
+{{template "repo/settings/webhook/history" .ctxData}} diff --git a/templates/webhook/new/dingtalk.tmpl b/templates/webhook/new/dingtalk.tmpl new file mode 100644 index 0000000..e805ead --- /dev/null +++ b/templates/webhook/new/dingtalk.tmpl @@ -0,0 +1,9 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://dingtalk.com" (ctx.Locale.Tr "repo.settings.web_hook_name_dingtalk")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/discord.tmpl b/templates/webhook/new/discord.tmpl new file mode 100644 index 0000000..455a96c --- /dev/null +++ b/templates/webhook/new/discord.tmpl @@ -0,0 +1,17 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://discord.com" (ctx.Locale.Tr "repo.settings.web_hook_name_discord")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/feishu.tmpl b/templates/webhook/new/feishu.tmpl new file mode 100644 index 0000000..10c2827 --- /dev/null +++ b/templates/webhook/new/feishu.tmpl @@ -0,0 +1,10 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://feishu.cn" (ctx.Locale.Tr "repo.settings.web_hook_name_feishu_only")}}

+

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://larksuite.com" (ctx.Locale.Tr "repo.settings.web_hook_name_larksuite_only")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/forgejo.tmpl b/templates/webhook/new/forgejo.tmpl new file mode 100644 index 0000000..cdb3334 --- /dev/null +++ b/templates/webhook/new/forgejo.tmpl @@ -0,0 +1,38 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://forgejo.org/docs/latest/user/webhooks/" (ctx.Locale.Tr "repo.settings.web_hook_name_forgejo")}}

+
+ {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/gitea.tmpl b/templates/webhook/new/gitea.tmpl new file mode 100644 index 0000000..3926370 --- /dev/null +++ b/templates/webhook/new/gitea.tmpl @@ -0,0 +1,38 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://forgejo.org/docs/latest/user/webhooks/" (ctx.Locale.Tr "repo.settings.web_hook_name_gitea")}}

+
+ {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/gogs.tmpl b/templates/webhook/new/gogs.tmpl new file mode 100644 index 0000000..5b6cd72 --- /dev/null +++ b/templates/webhook/new/gogs.tmpl @@ -0,0 +1,26 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://forgejo.org/docs/latest/user/webhooks/" (ctx.Locale.Tr "repo.settings.web_hook_name_gogs")}}

+
+ {{template "base/disable_form_autofill"}} + {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/matrix.tmpl b/templates/webhook/new/matrix.tmpl new file mode 100644 index 0000000..920180d --- /dev/null +++ b/templates/webhook/new/matrix.tmpl @@ -0,0 +1,32 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://matrix.org/" (ctx.Locale.Tr "repo.settings.web_hook_name_matrix")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+ +
+ + + {{ctx.Locale.Tr "repo.settings.matrix.access_token_helper"}} +
+
+ + + {{ctx.Locale.Tr "repo.settings.matrix.room_id_helper" ("!opaque_id:example.org"|SafeHTML)}} +
+
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/msteams.tmpl b/templates/webhook/new/msteams.tmpl new file mode 100644 index 0000000..535d0fc --- /dev/null +++ b/templates/webhook/new/msteams.tmpl @@ -0,0 +1,9 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://teams.microsoft.com" (ctx.Locale.Tr "repo.settings.web_hook_name_msteams")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/packagist.tmpl b/templates/webhook/new/packagist.tmpl new file mode 100644 index 0000000..04240bb --- /dev/null +++ b/templates/webhook/new/packagist.tmpl @@ -0,0 +1,17 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://packagist.org" (ctx.Locale.Tr "repo.settings.web_hook_name_packagist")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/slack.tmpl b/templates/webhook/new/slack.tmpl new file mode 100644 index 0000000..cfaeb41 --- /dev/null +++ b/templates/webhook/new/slack.tmpl @@ -0,0 +1,26 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://slack.com" (ctx.Locale.Tr "repo.settings.web_hook_name_slack")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+ +
+ + +
+
+ + +
+
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/sourcehut_builds.tmpl b/templates/webhook/new/sourcehut_builds.tmpl new file mode 100644 index 0000000..3bcbe1b --- /dev/null +++ b/templates/webhook/new/sourcehut_builds.tmpl @@ -0,0 +1,39 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://sourcehut.org/" (ctx.Locale.Tr "repo.settings.web_hook_name_sourcehut_builds")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+
+
+ + + {{ctx.Locale.Tr "repo.settings.sourcehut_builds.secrets_helper"}} +
+
+ +
+ + + {{ctx.Locale.Tr "repo.settings.sourcehut_builds.access_token_helper" "https://meta.sr.ht/oauth2/personal-token?grants=builds.sr.ht/JOBS:RW" "https://meta.sr.ht/oauth2/personal-token?grants=builds.sr.ht/JOBS:RW+builds.sr.ht/SECRETS:RO"}} +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/telegram.tmpl b/templates/webhook/new/telegram.tmpl new file mode 100644 index 0000000..3627dff --- /dev/null +++ b/templates/webhook/new/telegram.tmpl @@ -0,0 +1,17 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://core.telegram.org/bots" (ctx.Locale.Tr "repo.settings.web_hook_name_telegram")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/new/wechatwork.tmpl b/templates/webhook/new/wechatwork.tmpl new file mode 100644 index 0000000..ae9d36a --- /dev/null +++ b/templates/webhook/new/wechatwork.tmpl @@ -0,0 +1,9 @@ +

{{ctx.Locale.Tr "repo.settings.add_web_hook_desc" "https://work.weixin.qq.com" (ctx.Locale.Tr "repo.settings.web_hook_name_wechatwork")}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+ {{template "webhook/shared-settings" .}} +
diff --git a/templates/webhook/shared-settings.tmpl b/templates/webhook/shared-settings.tmpl new file mode 100644 index 0000000..b6c05b7 --- /dev/null +++ b/templates/webhook/shared-settings.tmpl @@ -0,0 +1,193 @@ +{{$isNew:=or .PageIsSettingsHooksNew .PageIsAdminDefaultHooksNew .PageIsAdminSystemHooksNew}} +
+
+ {{ctx.Locale.Tr "repo.settings.event_desc"}} + + + +
+ +
+ {{ctx.Locale.Tr "repo.settings.event_header_repository"}} + + + + + + + + + + + + + + + + +
+ +
+ {{ctx.Locale.Tr "repo.settings.event_header_issue"}} + + + + + + + + + + +
+ +
+ {{ctx.Locale.Tr "repo.settings.event_header_pull_request"}} + + + + + + + + + + + + + + + + +
+
+
+
+ + +
+ + + {{ctx.Locale.Tr "repo.settings.branch_filter_desc" "https://pkg.go.dev/github.com/gobwas/glob#Compile" "github.com/gobwas/glob"}} +
+ +{{$skipAuthorizationHeader := or (eq .HookType "sourcehut_builds") (eq .HookType "matrix")}} +{{if not $skipAuthorizationHeader}} + +
+ + + {{ctx.Locale.Tr "repo.settings.authorization_header_desc" ("Bearer token123456, Basic YWxhZGRpbjpvcGVuc2VzYW1l" | SafeHTML)}} +
+{{end}} + +
+ +
+ + {{if $isNew}} + + {{else}} + + {{ctx.Locale.Tr "repo.settings.delete_webhook"}} + {{end}} +
+ +{{template "repo/settings/webhook/delete_modal" .}} -- cgit v1.2.3