Skip to content

Commit 3aed8ae

Browse files
authored
Fix default avatar image size in PR diff page (#28971)
Fix #28941 ps: didn't test. The repo is too big to migrate.
1 parent a062725 commit 3aed8ae

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

modules/templates/util_avatar.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (au *AvatarUtils) Avatar(item any, others ...any) template.HTML {
5959
}
6060
}
6161

62-
return ""
62+
return AvatarHTML(avatars.DefaultAvatarLink(), size, class, "")
6363
}
6464

6565
// AvatarByAction renders user avatars from action. args: action, size (int), class (string)

templates/repo/diff/comments.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
44
<div class="comment" id="{{.HashTag}}">
55
{{if .OriginalAuthor}}
6-
<span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
6+
<span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
77
{{else}}
88
{{template "shared/user/avatarlink" dict "user" .Poster}}
99
{{end}}

templates/repo/issue/view_content.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<div id="{{.Issue.HashTag}}" class="timeline-item comment first">
1313
{{if .Issue.OriginalAuthor}}
1414
<span class="timeline-avatar">
15-
<img src="{{AppSubUrl}}/assets/img/avatar_default.png" width="40" height="40">
15+
{{ctx.AvatarUtils.Avatar nil 40}}
1616
</span>
1717
{{else}}
1818
<a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>

templates/repo/issue/view_content/comments.tmpl

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<div class="timeline-item comment" id="{{.HashTag}}">
1818
{{if .OriginalAuthor}}
1919
<span class="timeline-avatar">
20-
<img src="{{AppSubUrl}}/assets/img/avatar_default.png" width="40" height="40">
20+
{{ctx.AvatarUtils.Avatar nil 40}}
2121
</span>
2222
{{else}}
2323
<a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>

0 commit comments

Comments
 (0)