summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-03-20 01:10:16 -0600
committerGitHub <noreply@github.com>2017-03-20 01:10:16 -0600
commitea54afb1b6cf90aa85e99073c0e0290ecdf80d88 (patch)
tree189c6733ce1d19b387ef1a76075d1011ca841b2a /settings
parentab16383853a68574f5eff1afdb6a83e239305fdd (diff)
parentaa72f0e612d6764f13960c7c32e1c0da1388c4a2 (diff)
downloadnextcloud-server-ea54afb1b6cf90aa85e99073c0e0290ecdf80d88.tar.gz
nextcloud-server-ea54afb1b6cf90aa85e99073c0e0290ecdf80d88.zip
Merge pull request #3933 from nextcloud/downstream-27258
Add percentage to user's quota info
Diffstat (limited to 'settings')
-rw-r--r--settings/personal.php1
-rw-r--r--settings/templates/personal.php9
2 files changed, 8 insertions, 2 deletions
diff --git a/settings/personal.php b/settings/personal.php
index a1fcd10e0ad..a4449754f64 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -158,6 +158,7 @@ $userData = $accountManager->getUser($user);
$tmpl->assign('total_space', $totalSpace);
$tmpl->assign('usage_relative', $storageInfo['relative']);
+$tmpl->assign('quota', $storageInfo['quota']);
$tmpl->assign('clients', $clients);
$tmpl->assign('email', $userData[\OC\Accounts\AccountManager::PROPERTY_EMAIL]['value']);
$tmpl->assign('languages', $languages);
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index 31aa268f776..b47e2e28ffa 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -28,8 +28,13 @@
<div style="width:<?php p($_['usage_relative']);?>%"
<?php if($_['usage_relative'] > 80): ?> class="quota-warning" <?php endif; ?>>
<p id="quotatext">
- <?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
- array($_['usage'], $_['total_space'])));?>
+ <?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
+ <?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong>',
+ [$_['usage'], $_['total_space']]));?>
+ <?php else: ?>
+ <?php print_unescaped($l->t('You are using <strong>%s</strong> of <strong>%s</strong> (<strong>%s %%</strong>)',
+ [$_['usage'], $_['total_space'], $_['usage_relative']]));?>
+ <?php endif ?>
</p>
</div>
</div>