From c823ee5b737a56850658934ac71d2a1af6a04daf Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Mon, 29 Jan 2024 04:44:46 +0000 Subject: [PATCH 1/4] fix --- modules/templates/util_avatar.go | 6 ++++++ templates/repo/diff/comments.tmpl | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/templates/util_avatar.go b/modules/templates/util_avatar.go index 462668588a316..e8febd9ce8ec4 100644 --- a/modules/templates/util_avatar.go +++ b/modules/templates/util_avatar.go @@ -79,3 +79,9 @@ func (au *AvatarUtils) AvatarByEmail(email, name string, others ...any) template return "" } + +// AvatarDefault renders default avatars. +func (au *AvatarUtils) AvatarDefault(others ...any) template.HTML { + size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...) + return AvatarHTML(avatars.DefaultAvatarLink(), size, class, "") +} diff --git a/templates/repo/diff/comments.tmpl b/templates/repo/diff/comments.tmpl index 1e9af5c4a1f64..3d44120dfa185 100644 --- a/templates/repo/diff/comments.tmpl +++ b/templates/repo/diff/comments.tmpl @@ -3,7 +3,7 @@ {{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}