aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-10-21 12:52:03 +0200
committerMario Vavti <mario@mariovavti.com>2015-10-21 12:52:03 +0200
commit232742a5e6c2912fe53249465d5fe31ef3b9722f (patch)
tree00251102c2ce4853259bbcd9a26daadd1564d096
parenta33ddf373bc8a83ec7d440b46710642e26171800 (diff)
downloadvolse-hubzilla-232742a5e6c2912fe53249465d5fe31ef3b9722f.tar.gz
volse-hubzilla-232742a5e6c2912fe53249465d5fe31ef3b9722f.tar.bz2
volse-hubzilla-232742a5e6c2912fe53249465d5fe31ef3b9722f.zip
warn if quota exceeds 90% of storage limit
-rw-r--r--include/RedDAV/RedBrowser.php2
-rw-r--r--view/tpl/cloud_actionspanel.tpl2
2 files changed, 2 insertions, 2 deletions
diff --git a/include/RedDAV/RedBrowser.php b/include/RedDAV/RedBrowser.php
index c96b98742..efea5d92f 100644
--- a/include/RedDAV/RedBrowser.php
+++ b/include/RedDAV/RedBrowser.php
@@ -296,7 +296,7 @@ class RedBrowser extends DAV\Browser\Plugin {
$quota['used'] = $used;
$quota['limit'] = $limit;
$quota['desc'] = $quotaDesc;
- $quota['warning'] = (($limit && ($limit - $used) < 104857600) ? true : false); // 10485760 bytes = 100MB
+ $quota['warning'] = ((($limit) && ((round($used / $limit, 1) * 100) >= 90)) ? t('WARNING:') : ''); // 10485760 bytes = 100MB
$output .= replace_macros(get_markup_template('cloud_actionspanel.tpl'), array(
'$folder_header' => t('Create new folder'),
diff --git a/view/tpl/cloud_actionspanel.tpl b/view/tpl/cloud_actionspanel.tpl
index 4d2afa8ef..44e4eb54c 100644
--- a/view/tpl/cloud_actionspanel.tpl
+++ b/view/tpl/cloud_actionspanel.tpl
@@ -8,7 +8,7 @@
<div class="clear"></div>
</div>
<div id="files-upload-tools" class="section-content-tools-wrapper form-group">
- {{if $quota.limit || $quota.used}}<div class="{{if $quota.warning}}section-content-danger-wrapper{{else}}section-content-info-wrapper{{/if}}">{{$quota.desc}}</div>{{/if}}
+ {{if $quota.limit || $quota.used}}<div class="{{if $quota.warning}}section-content-danger-wrapper{{else}}section-content-info-wrapper{{/if}}">{{if $quota.warning}}<strong>{{$quota.warning}} </strong>{{/if}}{{$quota.desc}}</div>{{/if}}
<label for="files-upload">{{$upload_header}}</label>
<form method="post" action="" enctype="multipart/form-data">
<input type="hidden" name="sabreAction" value="put">