From a86f2514235de8196926efca0193f87df1993261 Mon Sep 17 00:00:00 2001 From: Martin Green Date: Wed, 26 Jul 2023 20:40:30 +0100 Subject: [PATCH] Fixed parsing and rendering of an entrances last visited field --- parsers/caves.py | 2 +- templates/cave.html | 3 ++ templates/cave_entrances.html | 74 ----------------------------------- 3 files changed, 4 insertions(+), 75 deletions(-) delete mode 100644 templates/cave_entrances.html diff --git a/parsers/caves.py b/parsers/caves.py index 5304599..a38434e 100644 --- a/parsers/caves.py +++ b/parsers/caves.py @@ -402,7 +402,7 @@ def read_entrance(filename, ent=None): DataIssue.objects.create(parser="entrances", message=message, url=f"/cave/{slug}/edit/") print(message) - lastvisit = getXML(entrancecontents, "last visit date", maxItems=1, minItems=0, context=context) + lastvisit = getXML(entrancecontents, "lastvisit", maxItems=1, minItems=0, context=context) alt = getXMLmax1("alt") approach = getXMLmax1("approach") diff --git a/templates/cave.html b/templates/cave.html index 1bdb683..a8c0c5e 100644 --- a/templates/cave.html +++ b/templates/cave.html @@ -151,6 +151,9 @@ {% if ent.entrance.location_description %}
Location
{{ ent.entrance.location_description|safe }}
{% endif %} + {% if ent.entrance.lastvisit %} +
Date last visited
{{ ent.entrance.lastvisit|safe }}
+ {% endif %} {% if ent.entrance.approach %}
Approach
{{ ent.entrance.approach|safe }}
{% endif %} diff --git a/templates/cave_entrances.html b/templates/cave_entrances.html deleted file mode 100644 index ed02e68..0000000 --- a/templates/cave_entrances.html +++ /dev/null @@ -1,74 +0,0 @@ -
-

{% if cave.entrances %} -

Entrances

- - -{% endif %}

-New Entrance -