mirror of
https://github.com/go-gitea/gitea.git
synced 2026-04-13 11:44:56 +02:00
[misc] update avatar utils to handle group avatars
This commit is contained in:
parent
e7fa8649c4
commit
7f3e776867
@ -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, "")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user