From d3d983eedbc5db4ddbeb3eac2b9895870c6e042d Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Wed, 5 Apr 2023 23:13:12 +0100 Subject: [PATCH] QM check-box report for open leads --- core/views/caves.py | 4 ++- templates/cave_open_qms.html | 64 ++++++++++++++++++++++++++++++++++++ urls.py | 1 + 3 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 templates/cave_open_qms.html diff --git a/core/views/caves.py b/core/views/caves.py index 41c14ef..7a3818c 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -500,7 +500,7 @@ def get_entrances(request, caveslug): ) -def caveQMs(request, slug): +def caveQMs(request, slug, open=False): """Lists all the QMs on a particular cave relies on the template to find all the QMs for the cave specified in the slug, e.g. '1623-161' Now working in July 2022 @@ -512,6 +512,8 @@ def caveQMs(request, slug): if cave.non_public and settings.PUBLIC_SITE and not request.user.is_authenticated: return render(request, "nonpublic.html", {"instance": cave}) + elif open: + return render(request, "cave_open_qms.html", {"cave": cave}) else: return render(request, "cave_qms.html", {"cave": cave}) diff --git a/templates/cave_open_qms.html b/templates/cave_open_qms.html new file mode 100644 index 0000000..b2f5029 --- /dev/null +++ b/templates/cave_open_qms.html @@ -0,0 +1,64 @@ +{% extends "base.html" %} +{% load link %} +{% block title %} QM: {{qm|safe}} {% endblock %} +{% block contentheader %} +

Open Leads for {{cave.kataster_number}} {% if cave.official_name %}- {{cave.official_name|safe}}{% endif %}{% if cave.unofficial_number %} - ({{cave.unofficial_number|safe}}){% endif %}

+ + +{% endblock %} +{% block content %} + +{{cave.slug}} - All QMs
+{{cave.slug}} - all Survexfiles
+{{cave.slug}} - Primary survexfile
+
+§ QM.nearest_station_name
+☉ QM.page_ref
QM.comment
+ + + + + +
+

Note that QMs loaded for 1623-161, 1623-204 and 1623-234 are imported from CSV files . + +

+

QMs are also loaded directly from the survex files, e.g. see +

+ +

For how to set up your own QMs, see Adding QMs . +

For full explanation of the current status of the QM system(s), see scriptsqms page. +


+{% endblock %} \ No newline at end of file diff --git a/urls.py b/urls.py index fbee871..c06b94a 100644 --- a/urls.py +++ b/urls.py @@ -208,6 +208,7 @@ trogglepatterns = [ # QMs pages - must precede other /caves pages? re_path(r'^cave/qms/([^/]+)/?$', caveQMs, name="caveQMs"), + re_path(r'^cave/openqms/([^/]+)/?$', caveQMs, {'open': True}, name="cave_openQMs"), re_path(r'^cave/qms/(?P[^/]+)/(?P\d\d\d\d)-(?P\d*)(?P[ABCDXV\?]?)-?(?P[a-zA-Z]+.*)?$', qm, name="qm"), # Dogs breakfast # the resolution of a QM uses several fields together, there is no clean slug field. Artefact of history.