diff options
author | John Molakvoæ <skjnldsv@users.noreply.github.com> | 2019-07-01 12:39:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-01 12:39:58 +0200 |
commit | 41ccf5e8c72e7ca64350f3d2a1bff54ac9f09c09 (patch) | |
tree | 53e2488ac2ee1030b84ba0c760b5f29bf54937af /apps | |
parent | 7fbfa5cd99dca4260e7b819a2157f0421955ed10 (diff) | |
parent | 5c3fc44f33696e118abfec612493a9663891aca1 (diff) | |
download | nextcloud-server-41ccf5e8c72e7ca64350f3d2a1bff54ac9f09c09.tar.gz nextcloud-server-41ccf5e8c72e7ca64350f3d2a1bff54ac9f09c09.zip |
Hide quota bar if unlimited quota (#16049)
Hide quota bar if unlimited quota
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/lib/Controller/ViewController.php | 2 | ||||
-rw-r--r-- | apps/files/templates/appnavigation.php | 37 |
2 files changed, 18 insertions, 21 deletions
diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index cf1b4374da4..49f1818780b 100644 --- a/apps/files/lib/Controller/ViewController.php +++ b/apps/files/lib/Controller/ViewController.php @@ -227,7 +227,7 @@ class ViewController extends Controller { $nav->assign('navigationItems', $navItems); - $nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used'])); + $nav->assign('usage', \OC_Helper::humanFileSize(ceil($storageInfo['used'] / 102400) * 102400)); if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) { $totalSpace = $this->l10n->t('Unlimited'); } else { diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php index fecaa8401a9..b4436714985 100644 --- a/apps/files/templates/appnavigation.php +++ b/apps/files/templates/appnavigation.php @@ -9,26 +9,23 @@ } ?> - <li id="quota" - class="pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?><?php - if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) { - ?>has-tooltip" title="<?php p($_['usage_relative'] . '%, '); - p($l->t('%s of %s used', [$_['usage'], $_['total_space']])); - } ?>"> - <a href="#" class="icon-quota svg"> - <p id="quotatext"><?php - if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) { - p($l->t('%1$s%% of %2$s used', [round($_['usage_relative'], 1), $_['total_space']])); - } else { - p($l->t('%s used', [$_['usage']])); - } ?></p> - <div class="quota-container"> - <progress value="<?php p($_['usage_relative']); ?>" - max="100" - <?php if ($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress> - </div> - </a> - </li> + <?php if($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?> + <li id="quota" class="pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?>"> + <a href="#" class="icon-quota svg"> + <p><?php p($l->t('%s used', [$_['usage']])); ?></p> + </a> + </li> + <?php else: ?> + <li id="quota" class="has-tooltip pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?>" + title="<?php p($l->t('%s%% of %s used', [$_['usage_relative'], $_['total_space']])); ?>"> + <a href="#" class="icon-quota svg"> + <p id="quotatext"><?php p($l->t('%1$s of %2$s used', [$_['usage'], $_['total_space']])); ?></p> + <div class="quota-container"> + <progress value="<?php p($_['usage_relative']); ?>" max="100" class="<?= ($_['usage_relative'] > 80) ? 'warn' : '' ?>"></progress> + </div> + </a> + </li> + <?php endif; ?> </ul> <div id="app-settings"> <div id="app-settings-header"> |