0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-12-12 10:39:19 +01:00
This commit is contained in:
silverwind 2025-11-28 18:27:27 +01:00
parent 092b7fd193
commit 11ed040990
No known key found for this signature in database
GPG Key ID: 2E62B41C93869443
4 changed files with 9 additions and 4 deletions

View File

@ -412,6 +412,7 @@ func Forks(ctx *context.Context) {
}
pager := context.NewPagination(int(total), pageSize, page, 5)
ctx.Data["ShowRepoOwnerAvatar"] = true
ctx.Data["ShowRepoOwnerOnList"] = true
ctx.Data["Page"] = pager
ctx.Data["Repos"] = forks

View File

@ -4,7 +4,7 @@
<div class="repo-header">
<div class="flex-item tw-items-center">
<div class="flex-item-leading">
{{template "repo/icon" (dict "Repo" . "EnableRepoAvatar" "true" "Size" 24)}}
{{template "repo/icon" (dict "Repo" . "Size" 24 "ShowRepoAvatar" true)}}
</div>
<div class="flex-item-main">
<div class="flex-item-title tw-text-18">

View File

@ -1,13 +1,17 @@
{{/* Template Attributes:
* Repo: The repo
* EnableRepoAvatar: Enable repo avatars when non-nil
* ShowRepoAvatar: Enable repo avatar when `true`
* ShowRepoOwnerAvatar: Enable owner avatars when `true`
* Size: Icon size in pixels, default is 16
*
* Note: Keep the icon logic in sync with web_src/js/utils/mappings.ts
*/}}
{{$size := or .Size 16}}
{{$avatarLink := (.Repo.RelAvatarLink ctx)}}
{{if and $avatarLink .EnableRepoAvatar}}
{{if .ShowRepoOwnerAvatar}}
{{ctx.AvatarUtils.Avatar .Repo.Owner 24}}
{{else if and $avatarLink .ShowRepoAvatar}}
<img class="ui avatar tw-align-middle" src="{{$avatarLink}}" width="{{$size}}" height="{{$size}}" alt aria-hidden="true">
{{else if .Repo.IsMirror}}
{{svg "octicon-mirror" $size}}

View File

@ -2,7 +2,7 @@
{{range .Repos}}
<div class="flex-item">
<div class="flex-item-leading">
{{template "repo/icon" (dict "Repo" . "Size" 24 "EnableRepoAvatar" "true")}}
{{template "repo/icon" (dict "Repo" . "Size" 24 "ShowRepoOwnerAvatar" $.ShowRepoOwnerAvatar)}}
</div>
<div class="flex-item-main">
<div class="flex-item-header">