[misc] update avatar utils to handle group avatars

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧
2026-04-02 20:00:48 -04:00
parent e7fa8649c4
commit 7f3e776867
+6
View File
@@ -4,6 +4,7 @@
package templates
import (
group_model "code.gitea.io/gitea/models/group"
"context"
"html"
"html/template"
@@ -55,6 +56,11 @@ func (au *AvatarUtils) Avatar(item any, others ...any) template.HTML {
if src != "" {
return AvatarHTML(src, size, class, t.AsUser().DisplayName())
}
case *group_model.Group:
src := t.AvatarLinkWithSize(size * setting.Avatar.RenderedSizeFactor)
if src != "" {
return AvatarHTML(src, size, class, t.Name)
}
}
return AvatarHTML(avatars.DefaultAvatarLink(), size, class, "")