Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/files/js/files.js7
-rw-r--r--apps/files/lib/Helper.php3
-rw-r--r--apps/files/templates/appnavigation.php2
3 files changed, 7 insertions, 5 deletions
diff --git a/apps/files/js/files.js b/apps/files/js/files.js
index 0fb0165e89f..37b084234f9 100644
--- a/apps/files/js/files.js
+++ b/apps/files/js/files.js
@@ -98,14 +98,15 @@
}
if (response.data !== undefined
&& response.data.quota !== undefined
+ && response.data.total !== undefined
&& response.data.used !== undefined
&& response.data.usedSpacePercent !== undefined) {
var humanUsed = OC.Util.humanFileSize(response.data.used, true);
- var humanQuota = OC.Util.humanFileSize(response.data.quota, true);
+ var humanTotal = OC.Util.humanFileSize(response.data.total, true);
if (response.data.quota > 0) {
- $('#quota').attr('data-original-title', Math.floor(response.data.used/response.data.quota*1000)/10 + '%');
+ $('#quota').attr('data-original-title', t('files', '{used}%', {used: Math.round(response.data.usedSpacePercent)}));
$('#quota progress').val(response.data.usedSpacePercent);
- $('#quotatext').html(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
+ $('#quotatext').html(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanTotal}));
} else {
$('#quotatext').html(t('files', '{used} used', {used: humanUsed}));
}
diff --git a/apps/files/lib/Helper.php b/apps/files/lib/Helper.php
index 18fea3aa2a1..1d9591cafe0 100644
--- a/apps/files/lib/Helper.php
+++ b/apps/files/lib/Helper.php
@@ -58,8 +58,9 @@ class Helper {
'maxHumanFilesize' => $maxHumanFileSize,
'freeSpace' => $storageInfo['free'],
'quota' => $storageInfo['quota'],
+ 'total' => $storageInfo['total'],
'used' => $storageInfo['used'],
- 'usedSpacePercent' => (int)$storageInfo['relative'],
+ 'usedSpacePercent' => $storageInfo['relative'],
'owner' => $storageInfo['owner'],
'ownerDisplayName' => $storageInfo['ownerDisplayName'],
'mountType' => $storageInfo['mountType'],
diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php
index 9aea68fef99..7b0bc0291bb 100644
--- a/apps/files/templates/appnavigation.php
+++ b/apps/files/templates/appnavigation.php
@@ -17,7 +17,7 @@
</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']])); ?>">
+ title="<?php p($l->t('%s%%', [round($_['usage_relative'])])); ?>">
<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">