From 095e00cb7216a13dee39dcada7d86c6a3619d5ef Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Sat, 2 Feb 2019 09:11:26 -0600 Subject: [PATCH] Fixed some issues on the templates for locations with multiple owners --- templates/GeoffreyApp/base_list.html | 2 +- templates/GeoffreyApp/location.html | 14 +++++++++++++- templates/GeoffreyApp/location_table.html | 7 ++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/templates/GeoffreyApp/base_list.html b/templates/GeoffreyApp/base_list.html index d203997..8842eda 100644 --- a/templates/GeoffreyApp/base_list.html +++ b/templates/GeoffreyApp/base_list.html @@ -5,5 +5,5 @@ {% endblock %} {% block content %} - {% include "GeoffreyApp/location_table.html" with loc_list=base_list %} + {% include "GeoffreyApp/location_table.html" with loc_list=base_list show_owner=True %} {% endblock %} diff --git a/templates/GeoffreyApp/location.html b/templates/GeoffreyApp/location.html index 9a80c5a..07e46eb 100644 --- a/templates/GeoffreyApp/location.html +++ b/templates/GeoffreyApp/location.html @@ -4,7 +4,19 @@ {{ loc.name }} {% endblock %} {% block content %} -

Owner: {{ loc.owner }}

+ {% if loc.owner.all|length %} +

+ {% if loc.owner.all|length > 1 %} + Owners: + {% else %} + Owner: + {% endif %} + + {{ loc.owner.all.first }}{% for owner in loc.owner.all|slice:"1:" %}, {{ owner }} + {% endfor %} +

+ + {% endif %}

Location: {{ loc.location }}


{% block info %}{% endblock %} diff --git a/templates/GeoffreyApp/location_table.html b/templates/GeoffreyApp/location_table.html index ea31537..9579b97 100644 --- a/templates/GeoffreyApp/location_table.html +++ b/templates/GeoffreyApp/location_table.html @@ -15,7 +15,12 @@ {% include "GeoffreyApp/location_link.html" with loc=loc %} {{ loc.location }} {% if show_owner %} - {% include "GeoffreyApp/player_link.html" with player=loc.owner %} + + {% include "GeoffreyApp/player_link.html" with player=loc.owner.first %} + {% for owner in loc.owner.all|slice:"1:3" %}, + {% include "GeoffreyApp/player_link.html" with player=owner %} + {% endfor %} + {% endif %} {% endfor %}