From 15702642727ac24d5a857af448b90c3c9adae4bd Mon Sep 17 00:00:00 2001 From: Joey Hines Date: Sun, 29 Sep 2019 14:55:28 -0500 Subject: [PATCH] Setting "GEOFFREY_DYNMAP_URL" to none disabled the dynmap iframe --- GeoffreyApp/models.py | 2 +- GeoffreyApp/templates/GeoffreyApp/location.html | 10 ++++++---- GeoffreyApp/views.py | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/GeoffreyApp/models.py b/GeoffreyApp/models.py index d77e006..31e9933 100644 --- a/GeoffreyApp/models.py +++ b/GeoffreyApp/models.py @@ -272,7 +272,7 @@ class Location(models.Model): base_url = getattr(settings, "GEOFFREY_DYNMAP_BASE_URL") world_name = getattr(settings, "GEOFFREY_DYNMAP_WORLD_NAME") - if base_url is not None: + if base_url: url = base_url + "/?worldname={}&mapname=surface&zoom=4&x={}&y=65&z={}".format(world_name, self.x_coord, self.z_coord) return url diff --git a/GeoffreyApp/templates/GeoffreyApp/location.html b/GeoffreyApp/templates/GeoffreyApp/location.html index c7d9b13..20c4b90 100644 --- a/GeoffreyApp/templates/GeoffreyApp/location.html +++ b/GeoffreyApp/templates/GeoffreyApp/location.html @@ -24,9 +24,11 @@

Tunnel: {{ loc.tunnel.tunnel_str }}

{% endif %}
- {% block info %}{% endblock %} - + {% if loc.dynmap %} + {% block info %}{% endblock %} + {% endif %} + {% endblock %} \ No newline at end of file diff --git a/GeoffreyApp/views.py b/GeoffreyApp/views.py index 2403ec5..233fa14 100644 --- a/GeoffreyApp/views.py +++ b/GeoffreyApp/views.py @@ -90,6 +90,7 @@ class MarketList(GeoffreyModelList): class PointOfInterestList(GeoffreyModelList): model = PointOfInterest + class AttractionList(GeoffreyModelList): model = Attraction