Browse Source

Add percentage to user's quota info

* Add percentage to user's quota info

Fixes https://github.com/owncloud/core/issues/24011

* Do not show percentage if the quota is Unlimited

* translate quota

* correct condition and remove print_unescaped

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
pull/3933/head
David Toledo 9 years ago
committed by Morris Jobke
parent
commit
aa72f0e612
No known key found for this signature in database GPG Key ID: 9CE5ED29E7FCD38A
  1. 1
      settings/personal.php
  2. 9
      settings/templates/personal.php

1
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);

9
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>

Loading…
Cancel
Save