diff options
author | Xinyu Zhou <i@sourcehut.net> | 2022-11-24 05:57:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-23 15:57:37 -0600 |
commit | e483ec3a00752349dd4aa326ae75b2bbdd45981f (patch) | |
tree | a940a2fdf76c5501f8216147f13f262bc4604d18 /modules/templates | |
parent | a3c09fb36d7820076687e683c7dd6cbc6bf8cfb5 (diff) | |
download | gitea-e483ec3a00752349dd4aa326ae75b2bbdd45981f.tar.gz gitea-e483ec3a00752349dd4aa326ae75b2bbdd45981f.zip |
Fix vertical align of committer avatar rendered by email address (#21884)
Committer avatar rendered by `func AvatarByEmail` are not vertical align
as `func Avatar` does.
- Replace literals `ui avatar` and `ui avatar vm` with the constant
`DefaultAvatarClass`
Diffstat (limited to 'modules/templates')
-rw-r--r-- | modules/templates/helper.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index d0866d3e2c..95671e791a 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -607,7 +607,7 @@ func AvatarHTML(src string, size int, class, name string) template.HTML { // Avatar renders user avatars. args: user, size (int), class (string) func Avatar(item interface{}, others ...interface{}) template.HTML { - size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, "ui avatar vm", others...) + size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...) switch t := item.(type) { case *user_model.User: @@ -638,7 +638,7 @@ func AvatarByAction(action *activities_model.Action, others ...interface{}) temp // RepoAvatar renders repo avatars. args: repo, size(int), class (string) func RepoAvatar(repo *repo_model.Repository, others ...interface{}) template.HTML { - size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, "ui avatar", others...) + size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...) src := repo.RelAvatarLink() if src != "" { @@ -649,7 +649,7 @@ func RepoAvatar(repo *repo_model.Repository, others ...interface{}) template.HTM // AvatarByEmail renders avatars by email address. args: email, name, size (int), class (string) func AvatarByEmail(email, name string, others ...interface{}) template.HTML { - size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, "ui avatar", others...) + size, class := gitea_html.ParseSizeAndClass(avatars.DefaultAvatarPixelSize, avatars.DefaultAvatarClass, others...) src := avatars.GenerateEmailAvatarFastLink(email, size*setting.Avatar.RenderedSizeFactor) if src != "" { |