mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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:
@@ -64,10 +64,10 @@
|
||||
{{if $commit.User.FullName}}
|
||||
{{$userName = $commit.User.FullName}}
|
||||
{{end}}
|
||||
<span class="gt-mr-2">{{avatar $.Context $commit.User}}</span>
|
||||
<span class="gt-mr-2">{{ctx.AvatarUtils.Avatar $commit.User}}</span>
|
||||
<a href="{{$commit.User.HomeLink}}">{{$userName}}</a>
|
||||
{{else}}
|
||||
<span class="gt-mr-2">{{avatarByEmail $.Context $commit.Commit.Author.Email $userName}}</span>
|
||||
<span class="gt-mr-2">{{ctx.AvatarUtils.AvatarByEmail $commit.Commit.Author.Email $userName}}</span>
|
||||
{{$userName}}
|
||||
{{end}}
|
||||
</span>
|
||||
|
Reference in New Issue
Block a user