Merge pull request #33125 from nextcloud/backport/32993/stable24

[stable24] Fixes for quota text in navigation bar
This commit is contained in:
Pytal 2022-07-06 12:32:28 -07:00 committed by GitHub
commit 6dd941aba0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 5 deletions

View file

@ -2630,7 +2630,10 @@
self.showFileBusyState($tr, false);
});
};
return this.reportOperationProgress(fileNames, moveFileFunction, callback);
return this.reportOperationProgress(fileNames, moveFileFunction, callback).then(function() {
self.updateStorageStatistics();
self.updateStorageQuotas();
});
},
_reflect: function (promise){
@ -2810,7 +2813,10 @@
}
});
};
return this.reportOperationProgress(fileNames, copyFileFunction, callback);
return this.reportOperationProgress(fileNames, copyFileFunction, callback).then(function() {
self.updateStorageStatistics();
self.updateStorageQuotas();
});
},
/**

View file

@ -105,9 +105,9 @@
if (response.data.quota > 0) {
$('#quota').attr('data-original-title', Math.floor(response.data.used/response.data.quota*1000)/10 + '%');
$('#quota progress').val(response.data.usedSpacePercent);
$('#quotatext').text(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
$('#quotatext').html(t('files', '{used} of {quota} used', {used: humanUsed, quota: humanQuota}));
} else {
$('#quotatext').text(t('files', '{used} used', {used: humanUsed}));
$('#quotatext').html(t('files', '{used} used', {used: humanUsed}));
}
if (response.data.usedSpacePercent > 80) {
$('#quota progress').addClass('warn');

View file

@ -12,7 +12,7 @@
<?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>
<p id="quotatext"><?php p($l->t('%s used', [$_['usage']])); ?></p>
</a>
</li>
<?php else: ?>