aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-02-12 16:48:28 +0800
committerGitHub <noreply@github.com>2020-02-12 08:48:28 +0000
commit83a8944fcf64af9bf5b0a4e233f9a7f917838a4d (patch)
treeebb4436506a4e36939fcfa358ccb09dfd3a01d3a /templates
parentea7ad382e78486fc881bf46d9c1c004e3f311163 (diff)
downloadgitea-83a8944fcf64af9bf5b0a4e233f9a7f917838a4d.tar.gz
gitea-83a8944fcf64af9bf5b0a4e233f9a7f917838a4d.zip
Add feishu webhook support (#10229)
Add feishu webhook support
Diffstat (limited to 'templates')
-rw-r--r--templates/admin/hook_new.tmpl3
-rw-r--r--templates/org/settings/hook_new.tmpl3
-rw-r--r--templates/repo/settings/webhook/feishu.tmpl11
-rw-r--r--templates/repo/settings/webhook/list.tmpl3
-rw-r--r--templates/repo/settings/webhook/new.tmpl3
-rw-r--r--templates/swagger/v1_json.tmpl3
6 files changed, 25 insertions, 1 deletions
diff --git a/templates/admin/hook_new.tmpl b/templates/admin/hook_new.tmpl
index 2292377f6e..65f567b5dc 100644
--- a/templates/admin/hook_new.tmpl
+++ b/templates/admin/hook_new.tmpl
@@ -24,6 +24,8 @@
<img class="img-13" src="{{StaticUrlPrefix}}/img/telegram.png">
{{else if eq .HookType "msteams"}}
<img class="img-13" src="{{StaticUrlPrefix}}/img/msteams.png">
+ {{else if eq .HookType "feishu"}}
+ <img class="img-13" src="{{StaticUrlPrefix}}/img/feishu.png">
{{end}}
</div>
</h4>
@@ -35,6 +37,7 @@
{{template "repo/settings/webhook/dingtalk" .}}
{{template "repo/settings/webhook/telegram" .}}
{{template "repo/settings/webhook/msteams" .}}
+ {{template "repo/settings/webhook/feishu" .}}
</div>
{{template "repo/settings/webhook/history" .}}
diff --git a/templates/org/settings/hook_new.tmpl b/templates/org/settings/hook_new.tmpl
index c83957dc6a..ce45eed5cd 100644
--- a/templates/org/settings/hook_new.tmpl
+++ b/templates/org/settings/hook_new.tmpl
@@ -23,6 +23,8 @@
<img class="img-13" src="{{StaticUrlPrefix}}/img/telegram.png">
{{else if eq .HookType "msteams"}}
<img class="img-13" src="{{StaticUrlPrefix}}/img/msteams.png">
+ {{else if eq .HookType "feishu"}}
+ <img class="img-13" src="{{StaticUrlPrefix}}/img/feishu.png">
{{end}}
</div>
</h4>
@@ -34,6 +36,7 @@
{{template "repo/settings/webhook/dingtalk" .}}
{{template "repo/settings/webhook/telegram" .}}
{{template "repo/settings/webhook/msteams" .}}
+ {{template "repo/settings/webhook/feishu" .}}
</div>
{{template "repo/settings/webhook/history" .}}
diff --git a/templates/repo/settings/webhook/feishu.tmpl b/templates/repo/settings/webhook/feishu.tmpl
new file mode 100644
index 0000000000..95a5102530
--- /dev/null
+++ b/templates/repo/settings/webhook/feishu.tmpl
@@ -0,0 +1,11 @@
+{{if eq .HookType "feishu"}}
+ <p>{{.i18n.Tr "repo.settings.add_feishu_hook_desc" "https://feishu.cn" | 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">{{.i18n.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" .}}
+ </form>
+{{end}}
diff --git a/templates/repo/settings/webhook/list.tmpl b/templates/repo/settings/webhook/list.tmpl
index 5813b74914..0bdc95fa39 100644
--- a/templates/repo/settings/webhook/list.tmpl
+++ b/templates/repo/settings/webhook/list.tmpl
@@ -26,6 +26,9 @@
<a class="item" href="{{.BaseLink}}/msteams/new">
<img class="img-10" src="{{StaticUrlPrefix}}/img/msteams.png">Microsoft Teams
</a>
+ <a class="item" href="{{.BaseLink}}/feishu/new">
+ <img class="img-10" src="{{StaticUrlPrefix}}/img/feishu.png">Feishu
+ </a>
</div>
</div>
</div>
diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl
index 1d5d849738..d02da057f2 100644
--- a/templates/repo/settings/webhook/new.tmpl
+++ b/templates/repo/settings/webhook/new.tmpl
@@ -21,6 +21,8 @@
<img class="img-13" src="{{StaticUrlPrefix}}/img/telegram.png">
{{else if eq .HookType "msteams"}}
<img class="img-13" src="{{StaticUrlPrefix}}/img/msteams.png">
+ {{else if eq .HookType "feishu"}}
+ <img class="img-13" src="{{StaticUrlPrefix}}/img/feishu.png">
{{end}}
</div>
</h4>
@@ -32,6 +34,7 @@
{{template "repo/settings/webhook/dingtalk" .}}
{{template "repo/settings/webhook/telegram" .}}
{{template "repo/settings/webhook/msteams" .}}
+ {{template "repo/settings/webhook/feishu" .}}
</div>
{{template "repo/settings/webhook/history" .}}
diff --git a/templates/swagger/v1_json.tmpl b/templates/swagger/v1_json.tmpl
index ad2d2cca95..e6a5189928 100644
--- a/templates/swagger/v1_json.tmpl
+++ b/templates/swagger/v1_json.tmpl
@@ -9752,7 +9752,8 @@
"gogs",
"msteams",
"slack",
- "telegram"
+ "telegram",
+ "feishu"
],
"x-go-name": "Type"
}