summaryrefslogtreecommitdiffstats
path: root/templates/repo/graph
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2023-08-10 11:19:39 +0800
committerGitHub <noreply@github.com>2023-08-10 11:19:39 +0800
commita370efc13f0e1ea309e324639832832bc14cb6dc (patch)
tree3c408cf225a4ffcc49f257fabf162831c92e23bf /templates/repo/graph
parent36eb3c433ae384f21beec63eb648141fb9dba676 (diff)
downloadgitea-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/graph')
-rw-r--r--templates/repo/graph/commits.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/graph/commits.tmpl b/templates/repo/graph/commits.tmpl
index 8652a72052..0a21aec9c0 100644
--- a/templates/repo/graph/commits.tmpl
+++ b/templates/repo/graph/commits.tmpl
@@ -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>