From 547f51ee30f9d9c2808295bddcb90e0b02340205 Mon Sep 17 00:00:00 2001
From: yp05327 <576951401@qq.com>
Date: Thu, 9 Jan 2025 06:21:38 +0000
Subject: [PATCH] move repo size to side bar
---
templates/repo/home_sidebar_top.tmpl | 5 +++++
templates/repo/sub_menu.tmpl | 5 -----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/templates/repo/home_sidebar_top.tmpl b/templates/repo/home_sidebar_top.tmpl
index 607dc62e2e717..d7c2b8336f37a 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"}}
{{end}}
+
+ {{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
+ {{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
+ {{svg "octicon-database"}} {{ctx.Locale.PrettyNumber (index $fileSizeFields 0)}} {{index $fileSizeFields 1}}
+
diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl
index ccb98b94ad2f8..1e83b53ef048f 100644
--- a/templates/repo/sub_menu.tmpl
+++ b/templates/repo/sub_menu.tmpl
@@ -13,11 +13,6 @@
{{svg "octicon-tag"}} {{ctx.Locale.PrettyNumber .NumTags}} {{ctx.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"}} {{ctx.Locale.PrettyNumber (index $fileSizeFields 0)}} {{index $fileSizeFields 1}}
-
{{end}}