mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-25 11:22:16 +00:00
Fix action avatar loading (#13909)
Fixes #13883 Co-authored-by: 6543 <6543@obermui.de>
This commit is contained in:
parent
10b9a6df0d
commit
97ab820acc
3 changed files with 17 additions and 9 deletions
|
@ -338,11 +338,12 @@ func NewFuncMap() []template.FuncMap {
|
|||
}
|
||||
return false
|
||||
},
|
||||
"svg": SVG,
|
||||
"avatar": Avatar,
|
||||
"avatarHTML": AvatarHTML,
|
||||
"avatarByEmail": AvatarByEmail,
|
||||
"repoAvatar": RepoAvatar,
|
||||
"svg": SVG,
|
||||
"avatar": Avatar,
|
||||
"avatarHTML": AvatarHTML,
|
||||
"avatarByAction": AvatarByAction,
|
||||
"avatarByEmail": AvatarByEmail,
|
||||
"repoAvatar": RepoAvatar,
|
||||
"SortArrow": func(normSort, revSort, urlSort string, isDefault bool) template.HTML {
|
||||
// if needed
|
||||
if len(normSort) == 0 || len(urlSort) == 0 {
|
||||
|
@ -559,6 +560,12 @@ func Avatar(user *models.User, others ...interface{}) template.HTML {
|
|||
return template.HTML("")
|
||||
}
|
||||
|
||||
// AvatarByAction renders user avatars from action. args: action, size (int), class (string)
|
||||
func AvatarByAction(action *models.Action, others ...interface{}) template.HTML {
|
||||
action.LoadActUser()
|
||||
return Avatar(action.ActUser, others...)
|
||||
}
|
||||
|
||||
// RepoAvatar renders repo avatars. args: repo, size(int), class (string)
|
||||
func RepoAvatar(repo *models.Repository, others ...interface{}) template.HTML {
|
||||
size, class := parseOthers(models.DefaultAvatarPixelSize, "ui avatar image", others...)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue