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:
wxiaoguang 2023-08-10 11:19:39 +08:00 committed by GitHub
parent 36eb3c433a
commit a370efc13f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 162 additions and 155 deletions

View file

@ -52,14 +52,11 @@ func NewFuncMap() template.FuncMap {
// -----------------------------------------------------------------
// svg / avatar / icon
"svg": svg.RenderHTML,
"avatar": Avatar,
"avatarHTML": AvatarHTML,
"avatarByAction": AvatarByAction,
"avatarByEmail": AvatarByEmail,
"EntryIcon": base.EntryIcon,
"MigrationIcon": MigrationIcon,
"ActionIcon": ActionIcon,
"svg": svg.RenderHTML,
"avatarHTML": AvatarHTML,
"EntryIcon": base.EntryIcon,
"MigrationIcon": MigrationIcon,
"ActionIcon": ActionIcon,
"SortArrow": SortArrow,