summaryrefslogtreecommitdiffstats
path: root/templates/repo/shabox_badge.tmpl
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-08-10 11:19:39 +0800
committerGitHub <noreply@github.com>2023-08-10 11:19:39 +0800
commita370efc13f0e1ea309e324639832832bc14cb6dc (patch)
tree3c408cf225a4ffcc49f257fabf162831c92e23bf /templates/repo/shabox_badge.tmpl
parent36eb3c433ae384f21beec63eb648141fb9dba676 (diff)
downloadgitea-a370efc13f0e1ea309e324639832832bc14cb6dc.tar.gz
gitea-a370efc13f0e1ea309e324639832832bc14cb6dc.zip
Use template context function for avatar rendering (#26385)
Introduce `AvatarUtils`, no need to pass `$.Context` to every sub-template, and simplify the template helper functions.
Diffstat (limited to 'templates/repo/shabox_badge.tmpl')
-rw-r--r--templates/repo/shabox_badge.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/shabox_badge.tmpl b/templates/repo/shabox_badge.tmpl
index 2418d95c67..20fbe553a4 100644
--- a/templates/repo/shabox_badge.tmpl
+++ b/templates/repo/shabox_badge.tmpl
@@ -3,10 +3,10 @@
<div title="{{if eq .verification.TrustStatus "trusted"}}{{else if eq .verification.TrustStatus "untrusted"}}{{$.root.locale.Tr "repo.commits.signed_by_untrusted_user"}}: {{else}}{{$.root.locale.Tr "repo.commits.signed_by_untrusted_user_unmatched"}}: {{end}}{{.verification.Reason}}">
{{if ne .verification.SigningUser.ID 0}}
{{svg "gitea-lock"}}
- {{avatar $.root.Context .verification.SigningUser 28 "signature"}}
+ {{ctx.AvatarUtils.Avatar .verification.SigningUser 28 "signature"}}
{{else}}
<span title="{{$.root.locale.Tr "gpg.default_key"}}">{{svg "gitea-lock-cog"}}</span>
- {{avatarByEmail $.root.Context .verification.SigningEmail "" 28 "signature"}}
+ {{ctx.AvatarUtils.AvatarByEmail .verification.SigningEmail "" 28 "signature"}}
{{end}}
</div>
{{else}}