summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine GIRARD <sapk@users.noreply.github.com>2019-11-13 01:45:19 +0100
committerzeripath <art27@cantab.net>2019-11-13 00:45:19 +0000
commitcda8de2004f81169355fea24762d4f11c9e88560 (patch)
tree643c6920fd4d09e156c2d98e05d6da22030e659c
parent253fdfb7fab565172e150cc1ca2ac2701fa744c7 (diff)
downloadgitea-cda8de2004f81169355fea24762d4f11c9e88560.tar.gz
gitea-cda8de2004f81169355fea24762d4f11c9e88560.zip
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
-rw-r--r--options/locale/locale_en-US.ini1
-rw-r--r--templates/repo/settings/options.tmpl4
-rw-r--r--templates/repo/sub_menu.tmpl3
3 files changed, 8 insertions, 0 deletions
diff --git a/options/locale/locale_en-US.ini b/options/locale/locale_en-US.ini
index a3da32fb50..e3e0dba9fe 100644
--- a/options/locale/locale_en-US.ini
+++ b/options/locale/locale_en-US.ini
@@ -582,6 +582,7 @@ email_notifications.submit = Set Email Preference
owner = Owner
repo_name = Repository Name
repo_name_helper = Good repository names use short, memorable and unique keywords.
+repo_size = Repository Size
template = Template
template_select = Select a template.
template_helper = Make repository a template
diff --git a/templates/repo/settings/options.tmpl b/templates/repo/settings/options.tmpl
index 7ded98206c..6f96ff7f47 100644
--- a/templates/repo/settings/options.tmpl
+++ b/templates/repo/settings/options.tmpl
@@ -16,6 +16,10 @@
<input id="repo_name" name="repo_name" value="{{.Repository.Name}}" data-repo-name="{{.Repository.Name}}" autofocus required>
</div>
<div class="inline field">
+ <label>{{.i18n.Tr "repo.repo_size"}}</label>
+ <span>{{SizeFmt .Repository.Size}}</span>
+ </div>
+ <div class="inline field">
<label>{{.i18n.Tr "repo.template"}}</label>
<div class="ui checkbox">
<input name="template" type="checkbox" {{if .Repository.IsTemplate}}checked{{end}}>
diff --git a/templates/repo/sub_menu.tmpl b/templates/repo/sub_menu.tmpl
index dabaa8a1ef..b97fe902eb 100644
--- a/templates/repo/sub_menu.tmpl
+++ b/templates/repo/sub_menu.tmpl
@@ -9,6 +9,9 @@
<div class="item{{if .PageIsBranches}} active{{end}}">
<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>
</div>
+ <div class="item">
+ <a class="ui" href="#"><i class="octicon octicon-database"></i> <b>{{SizeFmt .Repository.Size}}</b></a>
+ </div>
{{end}}
</div>
</div>