1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-30 06:08:35 +00:00

Repo avatar fixes (#13891)

- Split up avatar rendering helpers for performance
- Fix showing repo SVG icon when no avatar is set
- Make repo SVG and avatar same size at 32px
- Fix fork line by adding vertical flexbox on repo title

Co-authored-by: 6543 <6543@obermui.de>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
silverwind
2020-12-08 05:14:28 +01:00
committed by GitHub
parent 9b22ada0a7
commit e7938c9c44
7 changed files with 112 additions and 104 deletions

20
templates/repo/icon.tmpl Normal file
View File

@@ -0,0 +1,20 @@
<div class="repo-icon mr-3">
{{if $.IsTemplate}}
{{svg "octicon-repo-template" 32}}
{{else}}
{{if $.IsPrivate}}
{{svg "octicon-lock" 32}}
{{else if and (not $.IsMirror) (not $.IsFork) ($.Owner)}}
{{svg "octicon-repo" 32}}
{{if $.Owner.Visibility.IsPrivate}}
{{avatar $.Owner}}
{{end}}
{{else if $.IsMirror}}
{{svg "octicon-mirror" 32}}
{{else if $.IsFork}}
{{svg "octicon-repo-forked" 32}}
{{else}}
{{svg "octicon-repo" 32}}
{{end}}
{{end}}
</div>