domain overview: first list own domains (with edit links), then list available public domains of other users

This commit is contained in:
Thomas Waldmann 2013-11-03 03:16:59 +01:00
parent 9b164f6ddc
commit a4c82cf7e3
2 changed files with 17 additions and 4 deletions

View File

@ -4,7 +4,7 @@
{% block content %}
<div class="row">
<div class="col-lg-12">
<h3>Your Domains</h3>
<h3>Domains (yours first, then public)</h3>
<table class="table">
<thead>
<tr>
@ -15,7 +15,7 @@
<th>Comment</th>
</tr>
</thead>
{% for domain in domains %}
{% for domain in your_domains %}
<tr>
<td><a href="{% url 'domain_view' domain.pk %}">{{ domain.domain }}</a></td>
<td>{{ domain.public|yesno }}</td>
@ -24,7 +24,18 @@
<td>{{ domain.comment }}</td>
</tr>
{% empty %}
<tr><td colspan="4">No domains yet.</td></tr>
<tr><td colspan="5">No domains from you yet.</td></tr>
{% endfor %}
{% for domain in public_domains %}
<tr>
<td>{{ domain.domain }}</td>
<td>{{ domain.public|yesno }}</td>
<td>{{ domain.available|yesno }}</td>
<td>{{ domain.nameserver_ip }}</td>
<td>{{ domain.comment }}</td>
</tr>
{% empty %}
<tr><td colspan="5">No public domains from other users yet.</td></tr>
{% endfor %}
</table>
</div>

View File

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