diff --git a/templates/repo/settings/webhook/dingtalk.tmpl b/templates/repo/settings/webhook/dingtalk.tmpl deleted file mode 100644 index f1cd6a193..000000000 --- a/templates/repo/settings/webhook/dingtalk.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -{{if eq .HookType "dingtalk"}} -

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

-
- {{.CsrfTokenHtml}} -
- - -
- {{template "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/discord.tmpl b/templates/repo/settings/webhook/discord.tmpl deleted file mode 100644 index 95a3806c8..000000000 --- a/templates/repo/settings/webhook/discord.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -{{if eq .HookType "discord"}} -

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

-
- {{.CsrfTokenHtml}} -
- - -
-
- - -
-
- - -
- {{template "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/feishu.tmpl b/templates/repo/settings/webhook/feishu.tmpl deleted file mode 100644 index cd6aaf935..000000000 --- a/templates/repo/settings/webhook/feishu.tmpl +++ /dev/null @@ -1,12 +0,0 @@ -{{if eq .HookType "feishu"}} -

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

-

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

-
- {{.CsrfTokenHtml}} -
- - -
- {{template "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/forgejo.tmpl b/templates/repo/settings/webhook/forgejo.tmpl deleted file mode 100644 index 5c8233a63..000000000 --- a/templates/repo/settings/webhook/forgejo.tmpl +++ /dev/null @@ -1,40 +0,0 @@ -{{if eq .HookType "forgejo"}} -

{{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 "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/gitea.tmpl b/templates/repo/settings/webhook/gitea.tmpl deleted file mode 100644 index e2a80d3c7..000000000 --- a/templates/repo/settings/webhook/gitea.tmpl +++ /dev/null @@ -1,40 +0,0 @@ -{{if eq .HookType "gitea"}} -

{{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 "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/gogs.tmpl b/templates/repo/settings/webhook/gogs.tmpl deleted file mode 100644 index 3c6003365..000000000 --- a/templates/repo/settings/webhook/gogs.tmpl +++ /dev/null @@ -1,28 +0,0 @@ -{{if eq .HookType "gogs"}} -

{{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 "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/matrix.tmpl b/templates/repo/settings/webhook/matrix.tmpl deleted file mode 100644 index 57a78d3c8..000000000 --- a/templates/repo/settings/webhook/matrix.tmpl +++ /dev/null @@ -1,27 +0,0 @@ -{{if eq .HookType "matrix"}} -

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

-
- {{.CsrfTokenHtml}} -
- - -
-
- - -
-
- - -
- {{template "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/msteams.tmpl b/templates/repo/settings/webhook/msteams.tmpl deleted file mode 100644 index 771183c13..000000000 --- a/templates/repo/settings/webhook/msteams.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -{{if eq .HookType "msteams"}} -

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

-
- {{.CsrfTokenHtml}} -
- - -
- {{template "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/packagist.tmpl b/templates/repo/settings/webhook/packagist.tmpl deleted file mode 100644 index aad1ab591..000000000 --- a/templates/repo/settings/webhook/packagist.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -{{if eq .HookType "packagist"}} -

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

-
- {{.CsrfTokenHtml}} -
- - -
-
- - -
-
- - -
- {{template "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/slack.tmpl b/templates/repo/settings/webhook/slack.tmpl deleted file mode 100644 index 1000f4a63..000000000 --- a/templates/repo/settings/webhook/slack.tmpl +++ /dev/null @@ -1,28 +0,0 @@ -{{if eq .HookType "slack"}} -

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

-
- {{.CsrfTokenHtml}} -
- - -
-
- - -
- -
- - -
-
- - -
-
- - -
- {{template "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/telegram.tmpl b/templates/repo/settings/webhook/telegram.tmpl deleted file mode 100644 index 84bc2dc49..000000000 --- a/templates/repo/settings/webhook/telegram.tmpl +++ /dev/null @@ -1,19 +0,0 @@ -{{if eq .HookType "telegram"}} -

{{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 "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/repo/settings/webhook/wechatwork.tmpl b/templates/repo/settings/webhook/wechatwork.tmpl deleted file mode 100644 index bee753bf6..000000000 --- a/templates/repo/settings/webhook/wechatwork.tmpl +++ /dev/null @@ -1,11 +0,0 @@ -{{if eq .HookType "wechatwork"}} -

{{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 "repo/settings/webhook/settings" .}} -
-{{end}} diff --git a/templates/webhook/new.tmpl b/templates/webhook/new.tmpl index 0347455f2..17eb578b0 100644 --- a/templates/webhook/new.tmpl +++ b/templates/webhook/new.tmpl @@ -10,17 +10,33 @@
- {{template "repo/settings/webhook/forgejo" .ctxData}} - {{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}} + {{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" .}} + {{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 000000000..398cb45f8 --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/discord.tmpl b/templates/webhook/new/discord.tmpl new file mode 100644 index 000000000..c6a7ea7d1 --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/feishu.tmpl b/templates/webhook/new/feishu.tmpl new file mode 100644 index 000000000..b691c3f18 --- /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")}}

+

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

+
+ {{.CsrfTokenHtml}} +
+ + +
+ {{template "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/forgejo.tmpl b/templates/webhook/new/forgejo.tmpl new file mode 100644 index 000000000..6bc4eb489 --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/gitea.tmpl b/templates/webhook/new/gitea.tmpl new file mode 100644 index 000000000..a8e66202d --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/gogs.tmpl b/templates/webhook/new/gogs.tmpl new file mode 100644 index 000000000..876c0e2be --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/matrix.tmpl b/templates/webhook/new/matrix.tmpl new file mode 100644 index 000000000..afa28941b --- /dev/null +++ b/templates/webhook/new/matrix.tmpl @@ -0,0 +1,25 @@ +

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

+
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+ + +
+ {{template "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/msteams.tmpl b/templates/webhook/new/msteams.tmpl new file mode 100644 index 000000000..f668342ac --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/packagist.tmpl b/templates/webhook/new/packagist.tmpl new file mode 100644 index 000000000..5cf6ed001 --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/slack.tmpl b/templates/webhook/new/slack.tmpl new file mode 100644 index 000000000..d24e65909 --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/telegram.tmpl b/templates/webhook/new/telegram.tmpl new file mode 100644 index 000000000..ea677ca4c --- /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 "repo/settings/webhook/settings" .}} +
diff --git a/templates/webhook/new/wechatwork.tmpl b/templates/webhook/new/wechatwork.tmpl new file mode 100644 index 000000000..15050d71b --- /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 "repo/settings/webhook/settings" .}} +