Skip to content

Commit ce983ec

Browse files
authored
Merge pull request #33133 from nextcloud/backport/32993/stable23
[stable23] Fixes for quota text in navigation bar
2 parents 6a49fc2 + 4cfdfc3 commit ce983ec

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

apps/files/js/filelist.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,7 +2630,10 @@
26302630
self.showFileBusyState($tr, false);
26312631
});
26322632
};
2633-
return this.reportOperationProgress(fileNames, moveFileFunction, callback);
2633+
return this.reportOperationProgress(fileNames, moveFileFunction, callback).then(function() {
2634+
self.updateStorageStatistics();
2635+
self.updateStorageQuotas();
2636+
});
26342637
},
26352638

26362639
_reflect: function (promise){
@@ -2810,7 +2813,10 @@
28102813
}
28112814
});
28122815
};
2813-
return this.reportOperationProgress(fileNames, copyFileFunction, callback);
2816+
return this.reportOperationProgress(fileNames, copyFileFunction, callback).then(function() {
2817+
self.updateStorageStatistics();
2818+
self.updateStorageQuotas();
2819+
});
28142820
},
28152821

28162822
/**

apps/files/js/files.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,9 @@
105105
if (response.data.quota > 0) {
106106
$('#quota').attr('data-original-title', Math.floor(response.data.used/response.data.quota*1000)/10 + '%');
107107
$('#quota progress').val(response.data.usedSpacePercent);
108-
$('#quotatext').text(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
108+
$('#quotatext').html(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
109109
} else {
110-
$('#quotatext').text(t('files', '{used} used', {used: humanUsed}));
110+
$('#quotatext').html(t('files', '{used} used', {used: humanUsed}));
111111
}
112112
if (response.data.usedSpacePercent > 80) {
113113
$('#quota progress').addClass('warn');

apps/files/templates/appnavigation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
1313
<li id="quota" class="pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?>">
1414
<a href="#" class="icon-quota svg">
15-
<p><?php p($l->t('%s used', [$_['usage']])); ?></p>
15+
<p id="quotatext"><?php p($l->t('%s used', [$_['usage']])); ?></p>
1616
</a>
1717
</li>
1818
<?php else: ?>

0 commit comments

Comments
 (0)