Skip to content

Commit

Permalink
Merge pull request #32993 from nextcloud/fixes-for-quota-text-in-navi…
Browse files Browse the repository at this point in the history
…gation-bar

Fixes for quota text in navigation bar
  • Loading branch information
danxuliu authored Jul 5, 2022
2 parents 8b23c1c + 5572209 commit 79b6caa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 8 additions & 2 deletions apps/files/js/filelist.js
Original file line number Diff line number Diff line change
Expand Up @@ -2637,7 +2637,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){
Expand Down Expand Up @@ -2817,7 +2820,10 @@
}
});
};
return this.reportOperationProgress(fileNames, copyFileFunction, callback);
return this.reportOperationProgress(fileNames, copyFileFunction, callback).then(function() {
self.updateStorageStatistics();
self.updateStorageQuotas();
});
},

/**
Expand Down
4 changes: 2 additions & 2 deletions apps/files/js/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion apps/files/templates/appnavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: ?>
Expand Down

0 comments on commit 79b6caa

Please sign in to comment.