diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-08-10 11:19:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 11:19:39 +0800 |
commit | a370efc13f0e1ea309e324639832832bc14cb6dc (patch) | |
tree | 3c408cf225a4ffcc49f257fabf162831c92e23bf /templates/repo/shabox_badge.tmpl | |
parent | 36eb3c433ae384f21beec63eb648141fb9dba676 (diff) | |
download | gitea-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.tmpl | 4 |
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}} |