Skip to content

Commit 3cfff5a

Browse files
GiteaBotyp05327
andauthored
Move repo size to sidebar (#33155) (#33182)
Backport #33155 by @yp05327 ![image](https://github.com/user-attachments/assets/8b14dbb7-ec36-4596-a6aa-72c14d93309d) Co-authored-by: yp05327 <[email protected]>
1 parent 6f6c66a commit 3cfff5a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

templates/repo/home_sidebar_top.tmpl

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@
6262
{{svg "octicon-cross-reference"}} {{ctx.Locale.Tr "repo.cite_this_repo"}}
6363
</a>
6464
{{end}}
65+
<span class="flex-text-block muted" {{if not (eq .Repository.Size 0)}}data-tooltip-placement="top" data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>
66+
{{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
67+
{{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
68+
{{svg "octicon-database"}} <b>{{ctx.Locale.PrettyNumber (index $fileSizeFields 0)}}</b> {{index $fileSizeFields 1}}
69+
</span>
6570
</div>
6671
</div>
6772
</div>

templates/repo/sub_menu.tmpl

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
{{svg "octicon-tag"}} <b>{{ctx.Locale.PrettyNumber .NumTags}}</b> {{ctx.Locale.TrN .NumTags "repo.tag" "repo.tags"}}
1414
</a>
1515
{{end}}
16-
<span class="item not-mobile" {{if not (eq .Repository.Size 0)}}data-tooltip-placement="top" data-tooltip-content="{{.Repository.SizeDetailsString}}"{{end}}>
17-
{{$fileSizeFormatted := FileSize .Repository.Size}}{{/* the formatted string is always "{val} {unit}" */}}
18-
{{$fileSizeFields := StringUtils.Split $fileSizeFormatted " "}}
19-
{{svg "octicon-database"}} <b>{{ctx.Locale.PrettyNumber (index $fileSizeFields 0)}}</b> {{index $fileSizeFields 1}}
20-
</span>
2116
{{end}}
2217
</div>
2318
</div>

0 commit comments

Comments
 (0)