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.
This commit is contained in:
wxiaoguang authored and GitHub committed 2023-08-10 11:19:39 +08:00
1 parent 36eb3c433a
commit a370efc13f
54 files changed
+162 -155

No files matched your search

+1 -1
View File
@@ -1,5 +1,5 @@
<div class="commit-form-wrapper">
{{avatar $.Context .SignedUser 48 "commit-avatar"}}
{{ctx.AvatarUtils.Avatar .SignedUser 48 "commit-avatar"}}
<div class="commit-form">
<h3>{{- if .CanCommitToBranch.WillSign}}
<span title="{{.locale.Tr "repo.signing.will_sign" .CanCommitToBranch.SigningKey}}">{{svg "octicon-lock" 24}}</span>