summaryrefslogtreecommitdiffstats
path: root/templates/repo/release
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/release
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/release')
-rw-r--r--templates/repo/release/list.tmpl4
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/release/list.tmpl b/templates/repo/release/list.tmpl
index fb8534f102..f326fb3272 100644
--- a/templates/repo/release/list.tmpl
+++ b/templates/repo/release/list.tmpl
@@ -38,7 +38,7 @@
<p class="text grey">
{{if gt .Publisher.ID 0}}
<span class="author">
- {{avatar $.Context .Publisher 20}}
+ {{ctx.AvatarUtils.Avatar .Publisher 20}}
<a href="{{.Publisher.HomeLink}}">{{.Publisher.Name}}</a>
</span>
<span class="released">
@@ -57,7 +57,7 @@
{{if .OriginalAuthor}}
{{svg "octicon-mark-github" 16 "gt-mr-2"}}{{.OriginalAuthor}}
{{else if .Publisher}}
- {{avatar $.Context .Publisher 20}}
+ {{ctx.AvatarUtils.Avatar .Publisher 20}}
<a href="{{.Publisher.HomeLink}}">{{.Publisher.GetDisplayName}}</a>
{{else}}
Ghost