Skip to content
Snippets Groups Projects
Unverified Commit 0554dba6 authored by Joas Schilling's avatar Joas Schilling Committed by Lukas Reschke
Browse files

Add quota to the files view

parent c46422b7
No related branches found
No related tags found
No related merge requests found
......@@ -747,3 +747,16 @@ table.dragshadow td.size {
#filestable tbody tr.canDrop {
background-color: rgba(255, 255, 140, 1);
}
#quota {
margin: 0 !important;
border: none;
div {
border-radius: 0;
}
}
#quotatext {
padding: 3px;
}
......@@ -108,6 +108,10 @@
// trigger URL change event handlers
this._onPopState(urlParams);
$('#quota.has-tooltip').tooltip({
placement: 'bottom'
});
this._debouncedPersistShowHiddenFilesState = _.debounce(this._persistShowHiddenFilesState, 1200);
},
......
......@@ -174,6 +174,17 @@ class ViewController extends Controller {
});
$nav->assign('navigationItems', $navItems);
$nav->assign('usage', \OC_Helper::humanFileSize($storageInfo['used']));
if ($storageInfo['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
$totalSpace = $this->l10n->t('Unlimited');
} else {
$totalSpace = \OC_Helper::humanFileSize($storageInfo['total']);
}
$nav->assign('total_space', $totalSpace);
$nav->assign('quota', $storageInfo['quota']);
$nav->assign('usage_relative', $storageInfo['relative']);
$contentItems = [];
// render the container content for every navigation item
......
<div id="app-navigation">
<div id="quota" class="section has-tooltip" title="<?php
if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED) {
p($l->t('You are using %s of %s', [$_['usage'], $_['total_space']]));
} else {
p($l->t('You are using %s of %s (%s %%)', [$_['usage'], $_['total_space'], $_['usage_relative']]));
}
?>">
<div style="width:<?php p($_['usage_relative']);?>%"
<?php if($_['usage_relative'] > 80): ?>class="quota-warning"<?php endif; ?>>
<p id="quotatext"><?php p($l->t('%s of %s in use', [$_['usage'], $_['total_space']])); ?></p>
</div>
</div>
<ul class="with-icon">
<?php foreach ($_['navigationItems'] as $item) { ?>
<li data-id="<?php p($item['id']) ?>" class="nav-<?php p($item['id']) ?>">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment