From d1dc505b370b21400951c596103e91f36aa7e96a Mon Sep 17 00:00:00 2001 From: James Graham Date: Mon, 8 Mar 2021 11:45:43 +0000 Subject: [PATCH] feat: group org list by hq country Resolves #86 --- .../templates/people/organisation/list.html | 53 +++++++++---------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/people/templates/people/organisation/list.html b/people/templates/people/organisation/list.html index cf2961a..c862bc7 100644 --- a/people/templates/people/organisation/list.html +++ b/people/templates/people/organisation/list.html @@ -15,39 +15,36 @@ href="{% url 'people:organisation.create' %}">New Organisation - - - - - + {% regroup organisation_list.all by current_answers.hq_country as countries %} - {% for organisation in organisation_list.all %} - - - - {% if organisation.pk in existing_relationships %} - Update Relationship - + {% for organisation in country.list %} + + + {% comment %} + - + {% if organisation.pk in existing_relationships %} + Update Relationship + - {% empty %} - - - + {% else %} + New Relationship + + {% endif %} + + {% endcomment %} + + {% endfor %} {% endfor %}
Name
{{ organisation }} - Details + {% for country in countries %} +
{{ country.grouper.name|default:"Unknown" }}
{{ organisation }} + Details - {% else %} - New Relationship - - {% endif %} -
No records