aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryp05327 <576951401@qq.com>2025-01-09 16:45:51 +0900
committerGitHub <noreply@github.com>2025-01-09 07:45:51 +0000
commit88366f280ec82e357e384263139b66cdc6b0b24a (patch)
tree8c4c5abe6a5b07c995dce7d400d8f2d0957426ad
parentba5e3a5161a497aa8c73827774870fb94676e68b (diff)
downloadgitea-88366f280ec82e357e384263139b66cdc6b0b24a.tar.gz
gitea-88366f280ec82e357e384263139b66cdc6b0b24a.zip
Move repo size to sidebar (#33155)
![image](https://github.com/user-attachments/assets/8b14dbb7-ec36-4596-a6aa-72c14d93309d)
-rw-r--r--templates/repo/home_sidebar_top.tmpl5
-rw-r--r--templates/repo/sub_menu.tmpl5
2 files changed, 5 insertions, 5 deletions
diff --git a/templates/repo/home_sidebar_top.tmpl b/templates/repo/home_sidebar_top.tmpl
index 607dc62e2e..d7c2b8336f 100644
--- a/templates/repo/home_sidebar_top.tmpl
+++ b/templates/repo/home_sidebar_top.tmpl
@@ -62,6 +62,11 @@
{{svg "octicon-cross-reference"}} {{ctx.Locale.Tr "repo.cite_this_repo"}}
</a>
{{end}}
+ <span class="flex-text-block muted" {{if not (eq .Repository.Size 0)}}data-tooltip-placement="top" data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>
+ {{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
+ {{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
+ {{svg "octicon-database"}} <b>{{ctx.Locale.PrettyNumber (index $fileSizeFields 0)}}</b> {{index $fileSizeFields 1}}
+ </span>
</div>
</div>
</div>
diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl
index ccb98b94ad..1e83b53ef0 100644
--- a/templates/repo/sub_menu.tmpl
+++ b/templates/repo/sub_menu.tmpl
@@ -13,11 +13,6 @@
{{svg "octicon-tag"}} <b>{{ctx.Locale.PrettyNumber .NumTags}}</b> {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}
</a>
{{end}}
- <span class="item not-mobile" {{if not (eq .Repository.Size 0)}}data-tooltip-placement="top" data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>
- {{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
- {{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
- {{svg "octicon-database"}} <b>{{ctx.Locale.PrettyNumber (index $fileSizeFields 0)}}</b> {{index $fileSizeFields 1}}
- </span>
{{end}}
</div>
</div>