From a4c82cf7e3bdaf2ab7d95f68bab9b4b4ff7e532e Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 3 Nov 2013 03:16:59 +0100 Subject: [PATCH] domain overview: first list own domains (with edit links), then list available public domains of other users --- .../main/templates/main/domain_overview.html | 17 ++++++++++++++--- nsupdate/main/views.py | 4 +++- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/nsupdate/main/templates/main/domain_overview.html b/nsupdate/main/templates/main/domain_overview.html index 530de9a..6267f6d 100644 --- a/nsupdate/main/templates/main/domain_overview.html +++ b/nsupdate/main/templates/main/domain_overview.html @@ -4,7 +4,7 @@ {% block content %}
-

Your Domains

+

Domains (yours first, then public)

@@ -15,7 +15,7 @@ - {% for domain in domains %} + {% for domain in your_domains %} @@ -24,7 +24,18 @@ {% empty %} - + + {% endfor %} + {% for domain in public_domains %} + + + + + + + + {% empty %} + {% endfor %}
Comment
{{ domain.domain }} {{ domain.public|yesno }}{{ domain.comment }}
No domains yet.
No domains from you yet.
{{ domain.domain }}{{ domain.public|yesno }}{{ domain.available|yesno }}{{ domain.nameserver_ip }}{{ domain.comment }}
No public domains from other users yet.
diff --git a/nsupdate/main/views.py b/nsupdate/main/views.py index 846ac4b..1bd453a 100644 --- a/nsupdate/main/views.py +++ b/nsupdate/main/views.py @@ -217,8 +217,10 @@ class DomainOverwievView(CreateView): context = super( DomainOverwievView, self).get_context_data(*args, **kwargs) context['nav_domain_overview'] = True - context['domains'] = Domain.objects.filter( + context['your_domains'] = Domain.objects.filter( created_by=self.request.user) + context['public_domains'] = Domain.objects.filter( + public=True).exclude(created_by=self.request.user) return context