]> source.dussan.org Git - gitea.git/commitdiff
Fix default avatar image size in PR diff page (#28971)
authoryp05327 <576951401@qq.com>
Fri, 2 Feb 2024 10:01:11 +0000 (19:01 +0900)
committerGitHub <noreply@github.com>
Fri, 2 Feb 2024 10:01:11 +0000 (10:01 +0000)
Fix #28941

ps: didn't test. The repo is too big to migrate.

modules/templates/util_avatar.go
templates/repo/diff/comments.tmpl
templates/repo/issue/view_content.tmpl
templates/repo/issue/view_content/comments.tmpl

index 462668588a316316a244533d763ddda54c5b5dbf..85832cf264cda4d6630bcccb172ce180cdd9447f 100644 (file)
@@ -59,7 +59,7 @@ func (au *AvatarUtils) Avatar(item any, others ...any) template.HTML {
                }
        }
 
-       return ""
+       return AvatarHTML(avatars.DefaultAvatarLink(), size, class, "")
 }
 
 // AvatarByAction renders user avatars from action. args: action, size (int), class (string)
index 1e9af5c4a1f64afc2b98363194eab66696e6dc56..2fbfe2fd6a07d70639938fe90cde9e6598f71d56 100644 (file)
@@ -3,7 +3,7 @@
 {{$createdStr:= TimeSinceUnix .CreatedUnix ctx.Locale}}
 <div class="comment" id="{{.HashTag}}">
        {{if .OriginalAuthor}}
-               <span class="avatar"><img src="{{AppSubUrl}}/assets/img/avatar_default.png"></span>
+               <span class="avatar">{{ctx.AvatarUtils.Avatar nil}}</span>
        {{else}}
                {{template "shared/user/avatarlink" dict "user" .Poster}}
        {{end}}
index 9967997b92411347d522dc98e186d09be211e0da..ed444f6dcee4cc66cb72b025d17b61fa42284c32 100644 (file)
@@ -12,7 +12,7 @@
                        <div id="{{.Issue.HashTag}}" class="timeline-item comment first">
                                {{if .Issue.OriginalAuthor}}
                                <span class="timeline-avatar">
-                                       <img src="{{AppSubUrl}}/assets/img/avatar_default.png" width="40" height="40">
+                                       {{ctx.AvatarUtils.Avatar nil 40}}
                                </span>
                                {{else}}
                                <a class="timeline-avatar" {{if gt .Issue.Poster.ID 0}}href="{{.Issue.Poster.HomeLink}}"{{end}}>
index ad7b836e9c9fb8d4fe35823f682c44a6fda07f6b..ade0ea34cfa467102c3ea1bc0450097cbbdd5488 100644 (file)
@@ -17,7 +17,7 @@
                        <div class="timeline-item comment" id="{{.HashTag}}">
                        {{if .OriginalAuthor}}
                                <span class="timeline-avatar">
-                                       <img src="{{AppSubUrl}}/assets/img/avatar_default.png" width="40" height="40">
+                                       {{ctx.AvatarUtils.Avatar nil 40}}
                                </span>
                        {{else}}
                                <a class="timeline-avatar"{{if gt .Poster.ID 0}} href="{{.Poster.HomeLink}}"{{end}}>