From a370efc13f0e1ea309e324639832832bc14cb6dc Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Thu, 10 Aug 2023 11:19:39 +0800 Subject: 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. --- templates/repo/shabox_badge.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates/repo/shabox_badge.tmpl') 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 @@
{{if ne .verification.SigningUser.ID 0}} {{svg "gitea-lock"}} - {{avatar $.root.Context .verification.SigningUser 28 "signature"}} + {{ctx.AvatarUtils.Avatar .verification.SigningUser 28 "signature"}} {{else}} {{svg "gitea-lock-cog"}} - {{avatarByEmail $.root.Context .verification.SigningEmail "" 28 "signature"}} + {{ctx.AvatarUtils.AvatarByEmail .verification.SigningEmail "" 28 "signature"}} {{end}}
{{else}} -- cgit v1.2.3