mirror of
https://github.com/go-gitea/gitea
synced 2025-08-09 11:08:19 +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:
@@ -1,7 +1,7 @@
|
||||
{{template "base/head" .}}
|
||||
<div role="main" aria-label="{{.Title}}" class="page-content organization profile">
|
||||
<div class="ui container gt-df">
|
||||
{{avatar $.Context .Org 140 "org-avatar"}}
|
||||
{{ctx.AvatarUtils.Avatar .Org 140 "org-avatar"}}
|
||||
<div id="org-info">
|
||||
<div class="ui header gt-df gt-fw">
|
||||
{{.Org.DisplayName}}
|
||||
@@ -61,7 +61,7 @@
|
||||
{{$isMember := .IsOrganizationMember}}
|
||||
{{range .Members}}
|
||||
{{if or $isMember (call $.IsPublicMember .ID)}}
|
||||
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{avatar $.Context . 48}}</a>
|
||||
<a href="{{.HomeLink}}" title="{{.Name}}{{if .FullName}} ({{.FullName}}){{end}}">{{ctx.AvatarUtils.Avatar . 48}}</a>
|
||||
{{end}}
|
||||
{{end}}
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user