From 75689b8973ccf149b39f9b883fe312ca993ba6bc Mon Sep 17 00:00:00 2001 From: yp05327 <576951401@qq.com> Date: Tue, 22 Aug 2023 18:20:09 +0900 Subject: [PATCH] Improve repo sub menu (#26531) Before: ![image](https://github.com/go-gitea/gitea/assets/18380374/9e71282c-4645-45f3-bdb8-13c4333f7c2b) After: ![image](https://github.com/go-gitea/gitea/assets/18380374/656ff837-35cf-43f8-88d0-f5e123600e57) Icons are not in the middle of the line. --- templates/repo/sub_menu.tmpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl index 27b707d33..da5f37fa0 100644 --- a/templates/repo/sub_menu.tmpl +++ b/templates/repo/sub_menu.tmpl @@ -4,20 +4,20 @@
{{if and (.Permission.CanRead $.UnitTypeCode) (not .IsEmptyRepo)}}
- {{svg "octicon-history"}} {{.locale.PrettyNumber .CommitsCount}} {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}} + {{svg "octicon-history"}} {{.locale.PrettyNumber .CommitsCount}} {{.locale.TrN .CommitsCount "repo.commit" "repo.commits"}}
- {{svg "octicon-git-branch"}} {{.locale.PrettyNumber .BranchesCount}} {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}} + {{svg "octicon-git-branch"}} {{.locale.PrettyNumber .BranchesCount}} {{.locale.TrN .BranchesCount "repo.branch" "repo.branches"}}
{{if $.Permission.CanRead $.UnitTypeCode}}
- {{svg "octicon-tag"}} {{.locale.PrettyNumber .NumTags}} {{.locale.TrN .NumTags "repo.tag" "repo.tags"}} + {{svg "octicon-tag"}} {{.locale.PrettyNumber .NumTags}} {{.locale.TrN .NumTags "repo.tag" "repo.tags"}}
{{end}}
{{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}} {{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}} - {{svg "octicon-database"}} {{.locale.PrettyNumber (index $fileSizeFields 0)}} {{index $fileSizeFields 1}} + {{svg "octicon-database"}} {{.locale.PrettyNumber (index $fileSizeFields 0)}} {{index $fileSizeFields 1}}
{{end}}