aboutsummaryrefslogtreecommitdiffstats
path: root/templates/repo
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2023-07-31 10:00:52 +0200
committerGitHub <noreply@github.com>2023-07-31 08:00:52 +0000
commit72363be7caa3c253e08daf058e5aebd6e795f0ef (patch)
tree1017e65f7cb526aaf996ff72d620fbdeea89bdaf /templates/repo
parent7e160f8824d1b37baaedbc547a59aaf77c503ec5 (diff)
downloadgitea-72363be7caa3c253e08daf058e5aebd6e795f0ef.tar.gz
gitea-72363be7caa3c253e08daf058e5aebd6e795f0ef.zip
Use shared template for webhook icons (#26242)
Fixes: https://github.com/go-gitea/gitea/issues/26241
Diffstat (limited to 'templates/repo')
-rw-r--r--templates/repo/settings/webhook/base_list.tmpl33
-rw-r--r--templates/repo/settings/webhook/new.tmpl24
2 files changed, 23 insertions, 34 deletions
diff --git a/templates/repo/settings/webhook/base_list.tmpl b/templates/repo/settings/webhook/base_list.tmpl
index 8db9a9263e..1bc9447110 100644
--- a/templates/repo/settings/webhook/base_list.tmpl
+++ b/templates/repo/settings/webhook/base_list.tmpl
@@ -5,37 +5,48 @@
<div class="ui primary tiny button">{{.locale.Tr "repo.settings.add_webhook"}}</div>
<div class="menu">
<a class="item" href="{{.BaseLinkNew}}/gitea/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/gitea.svg">{{.locale.Tr "repo.settings.web_hook_name_gitea"}}
+ {{template "shared/webhook/icon" (dict "HookType" "gitea" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_gitea"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/gogs/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/gogs.ico">{{.locale.Tr "repo.settings.web_hook_name_gogs"}}
+ {{template "shared/webhook/icon" (dict "HookType" "gogs" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_gogs"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/slack/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/slack.png">{{.locale.Tr "repo.settings.web_hook_name_slack"}}
+ {{template "shared/webhook/icon" (dict "HookType" "slack" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_slack"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/discord/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/discord.png">{{.locale.Tr "repo.settings.web_hook_name_discord"}}
+ {{template "shared/webhook/icon" (dict "HookType" "discord" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_discord"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/dingtalk/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/dingtalk.ico">{{.locale.Tr "repo.settings.web_hook_name_dingtalk"}}
+ {{template "shared/webhook/icon" (dict "HookType" "dingtalk" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_dingtalk"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/telegram/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/telegram.png">{{.locale.Tr "repo.settings.web_hook_name_telegram"}}
+ {{template "shared/webhook/icon" (dict "HookType" "telegram" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_telegram"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/msteams/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/msteams.png">{{.locale.Tr "repo.settings.web_hook_name_msteams"}}
+ {{template "shared/webhook/icon" (dict "HookType" "msteams" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_msteams"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/feishu/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/feishu.png">{{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}}
+ {{template "shared/webhook/icon" (dict "HookType" "feishu" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_feishu_or_larksuite"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/matrix/new">
- {{svg "gitea-matrix" 20 "img"}}{{.locale.Tr "repo.settings.web_hook_name_matrix"}}
+ {{template "shared/webhook/icon" (dict "HookType" "matrix" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_matrix"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/wechatwork/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/wechatwork.png">{{.locale.Tr "repo.settings.web_hook_name_wechatwork"}}
+ {{template "shared/webhook/icon" (dict "HookType" "wechatwork" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_wechatwork"}}
</a>
<a class="item" href="{{.BaseLinkNew}}/packagist/new">
- <img width="20" height="20" src="{{AssetUrlPrefix}}/img/packagist.png">{{.locale.Tr "repo.settings.web_hook_name_packagist"}}
+ {{template "shared/webhook/icon" (dict "HookType" "packagist" "Size" 20)}}
+ {{.locale.Tr "repo.settings.web_hook_name_packagist"}}
</a>
</div>
</div>
diff --git a/templates/repo/settings/webhook/new.tmpl b/templates/repo/settings/webhook/new.tmpl
index 73d6726a57..1b04742221 100644
--- a/templates/repo/settings/webhook/new.tmpl
+++ b/templates/repo/settings/webhook/new.tmpl
@@ -3,29 +3,7 @@
<h4 class="ui top attached header">
{{if .PageIsSettingsHooksNew}}{{.locale.Tr "repo.settings.add_webhook"}}{{else}}{{.locale.Tr "repo.settings.update_webhook"}}{{end}}
<div class="ui right">
- {{if eq .HookType "gitea"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/gitea.svg">
- {{else if eq .HookType "gogs"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/gogs.ico">
- {{else if eq .HookType "slack"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/slack.png">
- {{else if eq .HookType "discord"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/discord.png">
- {{else if eq .HookType "dingtalk"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/dingtalk.ico">
- {{else if eq .HookType "telegram"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/telegram.png">
- {{else if eq .HookType "msteams"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/msteams.png">
- {{else if eq .HookType "feishu"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/feishu.png">
- {{else if eq .HookType "matrix"}}
- {{svg "gitea-matrix" 26}}
- {{else if eq .HookType "wechatwork"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/wechatwork.png">
- {{else if eq .HookType "packagist"}}
- <img width="26" height="26" src="{{AssetUrlPrefix}}/img/packagist.png">
- {{end}}
+ {{template "shared/webhook/icon" .}}
</div>
</h4>
<div class="ui attached segment">