mirror of
https://github.com/go-gitea/gitea
synced 2025-07-27 04:38:36 +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:
@@ -18,9 +18,9 @@
|
||||
{{if .User.FullName}}
|
||||
{{$userName = .User.FullName}}
|
||||
{{end}}
|
||||
{{avatar $.Context .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a>
|
||||
{{ctx.AvatarUtils.Avatar .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a>
|
||||
{{else}}
|
||||
{{avatarByEmail $.Context .Author.Email .Author.Name 28 "gt-mr-2"}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "gt-mr-2"}}
|
||||
{{$userName}}
|
||||
{{end}}
|
||||
</td>
|
||||
|
Reference in New Issue
Block a user