Skip to content

Commit cda8de2

Browse files
sapkzeripath
authored andcommitted
Show repository size in repo home page and settings (#8940)
* feat: display repository size on repo home and settings * refactor: move repo size up in setting page
1 parent 253fdfb commit cda8de2

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

options/locale/locale_en-US.ini

+1
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ email_notifications.submit = Set Email Preference
582582
owner = Owner
583583
repo_name = Repository Name
584584
repo_name_helper = Good repository names use short, memorable and unique keywords.
585+
repo_size = Repository Size
585586
template = Template
586587
template_select = Select a template.
587588
template_helper = Make repository a template

templates/repo/settings/options.tmpl

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
<label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
1616
<input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
1717
</div>
18+
<div class="inline field">
19+
<label>{{.i18n.Tr "repo.repo_size"}}</label>
20+
<span>{{SizeFmt .Repository.Size}}</span>
21+
</div>
1822
<div class="inline field">
1923
<label>{{.i18n.Tr "repo.template"}}</label>
2024
<div class="ui checkbox">

templates/repo/sub_menu.tmpl

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<div class="item{{if .PageIsBranches}} active{{end}}">
1010
<a class="ui" href="{{.RepoLink}}/branches/"><i class="octicon octicon-git-branch"></i> <b>{{.BranchesCount}}</b> {{.i18n.Tr (TrN .i18n.Lang .BranchesCount "repo.branch" "repo.branches") }}</a>
1111
</div>
12+
<div class="item">
13+
<a class="ui" href="#"><i class="octicon octicon-database"></i> <b>{{SizeFmt .Repository.Size}}</b></a>
14+
</div>
1215
{{end}}
1316
</div>
1417
</div>

0 commit comments

Comments
 (0)