mirror of
https://github.com/go-gitea/gitea
synced 2025-08-01 15:18: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:
@@ -6,9 +6,9 @@
|
||||
<div class="singular-commit" id="{{$tag}}">
|
||||
<span class="badge badge-commit">{{svg "octicon-git-commit"}}</span>
|
||||
{{if .User}}
|
||||
<a class="avatar" href="{{.User.HomeLink}}">{{avatar $.root.Context .User}}</a>
|
||||
<a class="avatar" href="{{.User.HomeLink}}">{{ctx.AvatarUtils.Avatar .User}}</a>
|
||||
{{else}}
|
||||
{{avatarByEmail $.root.Context .Author.Email .Author.Name}}
|
||||
{{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name}}
|
||||
{{end}}
|
||||
|
||||
{{$commitLink:= printf "%s/commit/%s" $.comment.Issue.PullRequest.BaseRepo.Link (PathEscape .ID.String)}}
|
||||
|
Reference in New Issue
Block a user