Fixed some issues on the templates for locations with multiple owners

doc_update
Joey Hines 2019-02-02 09:11:26 -06:00
parent 4c70ddf22f
commit 095e00cb72
3 changed files with 20 additions and 3 deletions

View File

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

View File

@ -4,7 +4,19 @@
{{ loc.name }}
{% endblock %}
{% block content %}
<p>Owner: {{ loc.owner }}</p>
{% if loc.owner.all|length %}
<p>
{% if loc.owner.all|length > 1 %}
Owners:
{% else %}
Owner:
{% endif %}
{{ loc.owner.all.first }}{% for owner in loc.owner.all|slice:"1:" %}, {{ owner }}
{% endfor %}
</p>
{% endif %}
<p>Location: {{ loc.location }}</p>
<hr class="my-4">
{% block info %}{% endblock %}

View File

@ -15,7 +15,12 @@
<td>{% include "GeoffreyApp/location_link.html" with loc=loc %}</td>
<td>{{ loc.location }}</td>
{% if show_owner %}
<td>{% include "GeoffreyApp/player_link.html" with player=loc.owner %}</td>
<td>
{% 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 %}
</td>
{% endif %}
</tr>
{% endfor %}