Skip to content

Commit 6083dbc

Browse files
[misc] update avatar utils to handle group avatars
1 parent df90a0d commit 6083dbc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/templates/util_avatar.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package templates
55

66
import (
7+
group_model "code.gitea.io/gitea/models/group"
78
"context"
89
"html"
910
"html/template"
@@ -58,6 +59,11 @@ func (au *AvatarUtils) Avatar(item any, others ...any) template.HTML {
5859
if src != "" {
5960
return AvatarHTML(src, size, class, t.AsUser().DisplayName())
6061
}
62+
case *group_model.Group:
63+
src := t.AvatarLinkWithSize(size * setting.Avatar.RenderedSizeFactor)
64+
if src != "" {
65+
return AvatarHTML(src, size, class, t.Name)
66+
}
6167
}
6268

6369
return AvatarHTML(avatars.DefaultAvatarLink(), size, class, "")

0 commit comments

Comments
 (0)