diff options
author | Jonas <cez81@users.noreply.github.com> | 2017-04-11 15:30:15 +0200 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-04-11 21:30:15 +0800 |
commit | be6edaddcba1e607884539a250bd19debabba751 (patch) | |
tree | 352d09f7eb4643fb36bae9625fbeafd77643689e /modules/templates | |
parent | 54f0293f0ab73f357f545f8e05d16f9b254aba5e (diff) | |
download | gitea-be6edaddcba1e607884539a250bd19debabba751.tar.gz gitea-be6edaddcba1e607884539a250bd19debabba751.zip |
Repo size in admin panel (#1482)
* Implementation of the feature to view repository size in admin panel
* Move GetRepoSize to git module
* Repository.RepoSize -> Repository.Size
* RepoSize -> Size in template
* Redo a few bits and pieces
* Update size when syncing mirror or forking
* Remove GetRepoSize
* Changed fatal errors to error message
* Copy migration code from Gogs
* make fmt
Diffstat (limited to 'modules/templates')
-rw-r--r-- | modules/templates/helper.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/templates/helper.go b/modules/templates/helper.go index 2e756ce364..51877f8039 100644 --- a/modules/templates/helper.go +++ b/modules/templates/helper.go @@ -82,6 +82,9 @@ func NewFuncMap() []template.FuncMap { "DateFmtShort": func(t time.Time) string { return t.Format("Jan 02, 2006") }, + "SizeFmt": func(s int64) string { + return base.FileSize(s) + }, "List": List, "SubStr": func(str string, start, length int) string { if len(str) == 0 { |