diff --git a/admin/views.py b/admin/views.py
index 57f58afd3..46bac3a90 100644
--- a/admin/views.py
+++ b/admin/views.py
@@ -60,12 +60,11 @@ def domains(request):
return HttpResponseRedirect(reverse(userprefs.views.preferences))
domains = Domain.objects.all()
- counters = {}
for dom in domains:
- dom.mboxcounter = len(dom.mailbox_set.all())
+ dom.mbalias_counter = len(Alias.objects.filter(mboxes__domain__pk=dom.id))
deloptions = {"keepdir" : _("Do not delete domain directory")}
return render_domains_page(request, "domains",
- domains=domains, counter=counters,
+ domains=domains,
deloptions=deloptions)
@login_required
@@ -376,8 +375,8 @@ def delmailbox(request):
@permission_required("admin.view_aliases")
def mbaliases(request):
if request.GET.has_key("domid"):
- aliases = Alias.objects.filter(mboxes__domain__id=request.GET["domid"]).distinct()
- if request.GET.has_key("mbid"):
+ aliases = Alias.objects.filter(mboxes__domain__pk=request.GET["domid"]).distinct()
+ elif request.GET.has_key("mbid"):
aliases = Alias.objects.filter(mboxes__id=request.GET["mbid"]).distinct()
else:
aliases = Alias.objects.all()
diff --git a/static/css/default.css b/static/css/default.css
index 1eadb1605..40ca79bf6 100644
--- a/static/css/default.css
+++ b/static/css/default.css
@@ -74,12 +74,16 @@ div#footer {
#content {
position: fixed;
overflow: auto;
- padding: 5px;
+ /*padding: 5px;*/
top: 130px;
bottom: 35px;
width: 100%;
}
+#subcontent {
+ margin: 5px;
+}
+
#header {
width: 100%;
padding: 5px 0;
@@ -267,7 +271,6 @@ table {
border-collapse: collapse;
}
-
tr.odd {
background: white;
}
@@ -277,13 +280,13 @@ tr.even {
}
th, td {
- height: 20px;
+ line-height: 15px;
+ padding: 5px;
}
th {
background: #CEDBEC;
text-align: left;
- padding: 5px;
}
th.right {
@@ -296,7 +299,6 @@ th.center, td.center {
td {
border-bottom: 1px solid #C8D6E8;
- /*padding: 5px;*/
}
tr.table-tr-selected {
diff --git a/templates/admin/domains.html b/templates/admin/domains.html
index 2e2151a4a..50c5969f8 100644
--- a/templates/admin/domains.html
+++ b/templates/admin/domains.html
@@ -16,19 +16,23 @@
{% else %}
- | {% trans "Actions" %} |
{% trans "Name" %} |
- {% trans "Mailboxes" %} |
- {% trans "Quota" %} |
- {% trans "Enabled" %} |
+ {% trans "Domain aliases" %} |
+ {% trans "Mailboxes" %} |
+ {% trans "Mailbox aliases" %} |
+ {% trans "Quota" %} |
+ {% trans "Enabled" %} |
+ {% trans "Actions" %} |
{% for dom in domains %}
- | {% domain_actions user dom.id %} |
{{ dom.name }} |
- {{ dom.mboxcounter }} |
- {{ dom.quota }} {% trans "MB" %} |
- {{ dom.enabled|yesno:_("yes,no") }} |
+ {{ dom.domainalias_set.all|length }} |
+ {{ dom.mailbox_set.all|length }} |
+ {{ dom.mbalias_counter }} |
+ {{ dom.quota }} {% trans "MB" %} |
+ {{ dom.enabled|yesno:_("yes,no") }} |
+ {% domain_actions user dom.id %} |
{% endfor %}
diff --git a/templates/admin/domaliases.html b/templates/admin/domaliases.html
index 46dd758c7..6cc06be70 100644
--- a/templates/admin/domaliases.html
+++ b/templates/admin/domaliases.html
@@ -8,17 +8,17 @@
{% else %}
- | {% trans "Actions" %} |
{% trans "Name" %} |
- {% trans "Targeted domain" %} |
- {% trans "Enabled" %} |
+ {% trans "Targeted domain" %} |
+ {% trans "Enabled" %} |
+ {% trans "Actions" %} |
{% for domalias in domaliases %}
- | {% domalias_actions user domalias.id %} |
{{ domalias.name }} |
{{ domalias.target.name }} |
- {{ domalias.enabled|yesno }} |
+ {{ domalias.enabled|yesno }} |
+ {% domalias_actions user domalias.id %} |
{% endfor %}
diff --git a/templates/admin/mailboxes.html b/templates/admin/mailboxes.html
index cacaa48c9..b3324aeb6 100644
--- a/templates/admin/mailboxes.html
+++ b/templates/admin/mailboxes.html
@@ -8,19 +8,21 @@
{% else %}
- | {% trans "Actions" %} |
- {% trans "Name" %} |
- {% trans "Address" %} |
- {% trans "Quota" %} |
- {{ "Enabled"|gender:"f" }} |
+ {% trans "Name" %} |
+ {% trans "Address" %} |
+ {% trans "Defined aliases" %} |
+ {% trans "Quota" %} |
+ {{ "Enabled"|gender:"f" }} |
+ {% trans "Actions" %} |
{% for mb in mailboxes %}
- | {% mailbox_actions user mb %} |
{{ mb.name }} |
{{ mb.address }}@{{ mb.domain.name }} |
- {{ mb.quota }} {% trans "MB" %} |
- {{ mb.user.is_active|yesno:_("yes,no") }} |
+ {{ mb.alias_set.all|length }} |
+ {{ mb.quota }} {% trans "MB" %} |
+ {{ mb.user.is_active|yesno:_("yes,no") }} |
+ {% mailbox_actions user mb %} |
{% endfor %}
diff --git a/templates/admin/mbaliases.html b/templates/admin/mbaliases.html
index 51038ab63..f9fddf4b4 100644
--- a/templates/admin/mbaliases.html
+++ b/templates/admin/mbaliases.html
@@ -8,21 +8,21 @@
{% else %}
- | {% trans "Actions" %} |
- {% trans "Address" %} |
- {% trans "Mailbox" %} |
- {% trans "Enabled" %} |
+ {% trans "Address" %} |
+ {% trans "Mailbox" %} |
+ {% trans "Enabled" %} |
+ {% trans "Actions" %} |
{% for alias in aliases %}
- | {% mbalias_actions user alias %}
| {{ alias.full_address }} |
{% for mb in alias.mboxes.all %}
{{ mb.full_address }}
{% endfor %}
|
- {{ alias.enabled|yesno }} |
+ {{ alias.enabled|yesno }} |
+ {% mbalias_actions user alias %} |
{% endfor %}