Skip to content

Commit f310b96

Browse files
committed
Hide quota bar if unlimited
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
1 parent e558cb2 commit f310b96

1 file changed

Lines changed: 17 additions & 20 deletions

File tree

apps/files/templates/appnavigation.php

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,23 @@
99
}
1010
?>
1111

12-
<li id="quota"
13-
class="pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?><?php
14-
if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
15-
?>has-tooltip" title="<?php p($_['usage_relative'] . '%, ');
16-
p($l->t('%s of %s used', [$_['usage'], $_['total_space']]));
17-
} ?>">
18-
<a href="#" class="icon-quota svg">
19-
<p id="quotatext"><?php
20-
if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
21-
p($l->t('%1$s%% of %2$s used', [round($_['usage_relative'], 1), $_['total_space']]));
22-
} else {
23-
p($l->t('%s used', [$_['usage']]));
24-
} ?></p>
25-
<div class="quota-container">
26-
<progress value="<?php p($_['usage_relative']); ?>"
27-
max="100"
28-
<?php if ($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress>
29-
</div>
30-
</a>
31-
</li>
12+
<?php if($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?>
13+
<li id="quota" class="pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?>">
14+
<a href="#" class="icon-quota svg">
15+
<p><?php p($l->t('%s used', [$_['usage']])); ?></p>
16+
</a>
17+
</li>
18+
<?php else: ?>
19+
<li id="quota" class="has-tooltip pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?>"
20+
title="<?php p($_['usage_relative'] . '%, '); p($l->t('%s of %s used', [$_['usage'], $_['total_space']])); ?>">
21+
<a href="#" class="icon-quota svg">
22+
<p id="quotatext"><?php p($l->t('%1$s%% of %2$s used', [round($_['usage_relative'], 1), $_['total_space']])); ?></p>
23+
<div class="quota-container">
24+
<progress value="<?php p($_['usage_relative']); ?>" max="100" class="<?= ($_['usage_relative'] > 80) ? 'warn' : '' ?>"></progress>
25+
</div>
26+
</a>
27+
</li>
28+
<?php endif; ?>
3229
</ul>
3330
<div id="app-settings">
3431
<div id="app-settings-header">

0 commit comments

Comments
 (0)