diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-08-10 11:19:39 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-10 11:19:39 +0800 |
commit | a370efc13f0e1ea309e324639832832bc14cb6dc (patch) | |
tree | 3c408cf225a4ffcc49f257fabf162831c92e23bf /templates/repo/commits_list.tmpl | |
parent | 36eb3c433ae384f21beec63eb648141fb9dba676 (diff) | |
download | gitea-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/commits_list.tmpl')
-rw-r--r-- | templates/repo/commits_list.tmpl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/templates/repo/commits_list.tmpl b/templates/repo/commits_list.tmpl index ef9d065456..9f1d182158 100644 --- a/templates/repo/commits_list.tmpl +++ b/templates/repo/commits_list.tmpl @@ -18,9 +18,9 @@ {{if .User.FullName}} {{$userName = .User.FullName}} {{end}} - {{avatar $.Context .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a> + {{ctx.AvatarUtils.Avatar .User 28 "gt-mr-2"}}<a href="{{.User.HomeLink}}">{{$userName}}</a> {{else}} - {{avatarByEmail $.Context .Author.Email .Author.Name 28 "gt-mr-2"}} + {{ctx.AvatarUtils.AvatarByEmail .Author.Email .Author.Name 28 "gt-mr-2"}} {{$userName}} {{end}} </td> |