From f310b964d453ed0192661d005e5f575918bda2c7 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Sun, 23 Jun 2019 21:21:13 +0200 Subject: [PATCH 1/3] Hide quota bar if unlimited Signed-off-by: Daniel Kesselberg --- apps/files/templates/appnavigation.php | 37 ++++++++++++-------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php index fecaa8401a..00ea164752 100644 --- a/apps/files/templates/appnavigation.php +++ b/apps/files/templates/appnavigation.php @@ -9,26 +9,23 @@ } ?> -
  • - -

    t('%1$s%% of %2$s used', [round($_['usage_relative'], 1), $_['total_space']])); - } else { - p($l->t('%s used', [$_['usage']])); - } ?>

    -
    - 80): ?> class="warn" > -
    -
    -
  • + +
  • + +

    t('%s used', [$_['usage']])); ?>

    +
    +
  • + +
  • + +

    t('%1$s%% of %2$s used', [round($_['usage_relative'], 1), $_['total_space']])); ?>

    +
    + +
    +
    +
  • +
    From d059ee34a09fe32e56a236d9ff2c5d9060b2f063 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Mon, 24 Jun 2019 18:33:10 +0200 Subject: [PATCH 2/3] Show used space in mb instead of % Signed-off-by: Daniel Kesselberg --- apps/files/lib/Controller/ViewController.php | 2 +- apps/files/templates/appnavigation.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/files/lib/Controller/ViewController.php b/apps/files/lib/Controller/ViewController.php index cf1b4374da..49f1818780 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 00ea164752..7f174b08a6 100644 --- a/apps/files/templates/appnavigation.php +++ b/apps/files/templates/appnavigation.php @@ -17,9 +17,9 @@
  • + title="t('%s (%s%%) of %s used', [$_['usage'], $_['usage_relative'], $_['total_space']])); ?>"> -

    t('%1$s%% of %2$s used', [round($_['usage_relative'], 1), $_['total_space']])); ?>

    +

    t('%1$s of %2$s used', [$_['usage'], $_['total_space']])); ?>

    From 5c3fc44f33696e118abfec612493a9663891aca1 Mon Sep 17 00:00:00 2001 From: Daniel Kesselberg Date: Mon, 24 Jun 2019 18:35:37 +0200 Subject: [PATCH 3/3] Don't show absolute number in tooltip Signed-off-by: Daniel Kesselberg --- apps/files/templates/appnavigation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php index 7f174b08a6..b443671498 100644 --- a/apps/files/templates/appnavigation.php +++ b/apps/files/templates/appnavigation.php @@ -17,7 +17,7 @@
  • + title="t('%s%% of %s used', [$_['usage_relative'], $_['total_space']])); ?>">

    t('%1$s of %2$s used', [$_['usage'], $_['total_space']])); ?>