mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
@@ -14,7 +14,8 @@
|
||||
<td>{{ mbox.get_quota }}M</td>
|
||||
<td>{{ mbox.quota }}M</td>
|
||||
<td name="quota">
|
||||
<div id="quotabar" class="progress {% progress_color mbox.get_quota_in_percent %}">
|
||||
<div id="quotabar" rel="tooltip" title="{{ mbox.get_quota_in_percent }}%"
|
||||
class="progress {% progress_color mbox.get_quota_in_percent %}">
|
||||
<div class="bar" style="width: {{ mbox.get_quota_in_percent }}%"></div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@@ -354,8 +354,10 @@ def list_quotas(request, tplname="admin/quotas.html"):
|
||||
if sort_order in ["address", "quota", "quota_value__bytes"]:
|
||||
mboxes = mboxes.order_by("%s%s" % (sort_dir, sort_order))
|
||||
elif sort_order == "quota_usage":
|
||||
mboxes.select_related().extra(
|
||||
select={'quota_usage': 'quota_value.bytes / (quota * 1048576) * 100'},
|
||||
mboxes.extra(
|
||||
select={'quota_usage': 'admin_quota.bytes / (admin_mailbox.quota * 1048576) * 100'},
|
||||
where=["admin_quota.mbox_id=admin_mailbox.id"],
|
||||
tables=["admin_quota"],
|
||||
order_by=["%s%s" % (sort_dir, sort_order)]
|
||||
)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user