diff --git a/charter_members/templates/all.html b/charter_members/templates/all.html index b335ef9..15b0814 100644 --- a/charter_members/templates/all.html +++ b/charter_members/templates/all.html @@ -26,6 +26,27 @@ {% endfor %} + {% if other %} +
+
+
+ {% for attorney in attorneys %} + {% if not attorney.region %} + +
+ +
{{ attorney.first_name }} {{ attorney.last_name }}
+ {{ attorney.position }} +
+
+
+ {% endif %} + {% endfor %} +
+
+
+ {% endif %} {% endblock %} diff --git a/charter_members/views.py b/charter_members/views.py index 83be897..891d90a 100644 --- a/charter_members/views.py +++ b/charter_members/views.py @@ -12,4 +12,5 @@ def index(request, id): def all(request): region = Region.objects.all().order_by('name') attorneys = Attorney.objects.all().annotate(Count('region')) - return render(request, 'all.html', {'region': region, 'attorneys': attorneys}) + other = Attorney.objects.filter(region=None).count() > 0 + return render(request, 'all.html', {'region': region, 'attorneys': attorneys, 'other': other})