warn if quota exceeds 90% of storage limit

This commit is contained in:
Mario Vavti 2015-10-21 12:52:03 +02:00
parent a33ddf373b
commit 232742a5e6
2 changed files with 2 additions and 2 deletions

View File

@ -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'),

View File

@ -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">