summaryrefslogtreecommitdiffstats
path: root/templates/repo/pulls/fork.tmpl
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/pulls/fork.tmpl
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/pulls/fork.tmpl')
-rw-r--r--templates/repo/pulls/fork.tmpl6
1 files changed, 3 insertions, 3 deletions
diff --git a/templates/repo/pulls/fork.tmpl b/templates/repo/pulls/fork.tmpl
index 525858c6aa..15635074ac 100644
--- a/templates/repo/pulls/fork.tmpl
+++ b/templates/repo/pulls/fork.tmpl
@@ -14,20 +14,20 @@
<div class="ui selection owner dropdown">
<input type="hidden" id="uid" name="uid" value="{{.ContextUser.ID}}" required>
<span class="text truncated-item-container" title="{{.ContextUser.Name}}">
- {{avatar $.Context .ContextUser 28 "mini"}}
+ {{ctx.AvatarUtils.Avatar .ContextUser 28 "mini"}}
<span class="truncated-item-name">{{.ContextUser.ShortName 40}}</span>
</span>
{{svg "octicon-triangle-down" 14 "dropdown icon"}}
<div class="menu">
{{if .CanForkToUser}}
<div class="item truncated-item-container" data-value="{{.SignedUser.ID}}" title="{{.SignedUser.Name}}">
- {{avatar $.Context .SignedUser 28 "mini"}}
+ {{ctx.AvatarUtils.Avatar .SignedUser 28 "mini"}}
<span class="truncated-item-name">{{.SignedUser.ShortName 40}}</span>
</div>
{{end}}
{{range .Orgs}}
<div class="item truncated-item-container" data-value="{{.ID}}" title="{{.Name}}">
- {{avatar $.Context . 28 "mini"}}
+ {{ctx.AvatarUtils.Avatar . 28 "mini"}}
<span class="truncated-item-name">{{.ShortName 40}}</span>
</div>
{{end}}