]> source.dussan.org Git - gitea.git/commitdiff
Show repository size in repo home page and settings (#8940)
authorAntoine GIRARD <sapk@users.noreply.github.com>
Wed, 13 Nov 2019 00:45:19 +0000 (01:45 +0100)
committerzeripath <art27@cantab.net>
Wed, 13 Nov 2019 00:45:19 +0000 (00:45 +0000)
* feat: display repository size on repo home and settings

* refactor: move repo size up in setting page

options/locale/locale_en-US.ini
templates/repo/settings/options.tmpl
templates/repo/sub_menu.tmpl

index a3da32fb503058fdea7d668d9c3fbc19ab21a9c8..e3e0dba9fecda319b1225c785ce82141e40f717d 100644 (file)
@@ -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
index 7ded98206cb3841ae1687fb257d5ef6bde8ca363..6f96ff7f47cea6bbebe78891b336ab0090b7692d 100644 (file)
                                        <label for="repo_name">{{.i18n.Tr "repo.repo_name"}}</label>
                                        <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">
index dabaa8a1ef74967353aceef86e963df7152890c9..b97fe902eb6beb5dd80ca1cabecddf8d50bc2725 100644 (file)
@@ -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>