From dbf7d1aa74050bb561d35c5968ae902a71aa09c3 Mon Sep 17 00:00:00 2001 From: Valkum Date: Mon, 8 Aug 2011 18:39:03 +0000 Subject: [PATCH] added quota level percentage display git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@1168 a1433add-5e2c-0410-b055-b7f2511e0802 --- css/default.css | 26 ++++++++++++++++++++++++++ images/quota-colors.png | Bin 0 -> 492 bytes list-virtual.php | 5 +++++ templates/list-virtual_mailbox.tpl | 13 ++++++++++++- 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 images/quota-colors.png diff --git a/css/default.css b/css/default.css index acf58c26..274c9c5a 100644 --- a/css/default.css +++ b/css/default.css @@ -352,3 +352,29 @@ span.active { div.nav_bar { text-align: left; } + + +.quota { +z-index:99; +height:14px; +position: absolute; +} +.quota_text { +z-index:100; + text-align: center; + font-size: 10px; + color: #666; + + cursor: default; + position: absolute; + width:120px; + height:14px; + margin-top:-14px; +} +.quota_bg { background-color: white; z-index:98; width:120px; height:14px;margin-top:-1px;margin-left:-1px; border: 1px solid #999;} +.quota_high { background: url(images/quota-colors.png) repeat-x 0 -28px #f90509; } +.quota_mid { background: url(images/quota-colors.png) repeat-x 0 -14px #e3e909; } +.quota_low { background: url(images/quota-colors.png) repeat-x 0 0px #05f905; } +.quota_text_high { color: white; } +.quota_text_mid { color: #666; } +.quota_text_low { color: #666; } \ No newline at end of file diff --git a/images/quota-colors.png b/images/quota-colors.png new file mode 100644 index 0000000000000000000000000000000000000000..4c1f17edda1636f4ada39a2c40922cccf5a7d41f GIT binary patch literal 492 zcmVw*L(r!qGKBXKp2RD zp$n-&qCzP956J@dZSekJy!a96aER2IM4DY9C6h?sMWp&5^2H|dP!svB$QPh;x;Fw4 zgaR0xMlAFI8$Ak-!k_&|WPw+NZ-#^kUE|cq8n?!xv1@T)adof8p>b*a8lOhh;^yNK i9*s?7)hHTGBWVN2S9%fN7+kmj0000 0)) if(isset($tMailbox[$i]['quota'])) { $divide_quota ['quota'][$i] = divide_quota ($tMailbox[$i]['quota']); } + if(isset($tMailbox[$i]['quota']) && isset($tMailbox[$i]['current'])) + { + $divide_quota ['percent'][$i] = min(100, round(($divide_quota ['current'][$i]/max(1,$divide_quota ['quota'][$i]))*100)); + $divide_quota ['quota_width'][$i] = ($divide_quota ['percent'][$i] / 100 * 120); + } } class cNav_bar diff --git a/templates/list-virtual_mailbox.tpl b/templates/list-virtual_mailbox.tpl index 03d11d09..71d952ba 100644 --- a/templates/list-virtual_mailbox.tpl +++ b/templates/list-virtual_mailbox.tpl @@ -49,7 +49,18 @@ {$PALANG.pOverview_disabled} {else} {if $boolconf_used_quotas} - {$divide_quota.current[$i]} / {$divide_quota.quota[$i]} + + + {if $divide_quota.quota_width[$i]>90} + {assign var="quota_level" value="high"} + {elseif $divide_quota.quota_width[$i]>55} + {assign var="quota_level" value="mid"} + {else} + {assign var="quota_level" value="low"} + {/if} +
+
+
{$divide_quota.current[$i]} / {$divide_quota.quota[$i]}
{/if} {/if}