From 9d4a97fc19faa1b56a6fca07dfcf546a6c27c0d1 Mon Sep 17 00:00:00 2001
From: Philip Sargent
Date: Tue, 5 Jul 2022 17:02:43 +0300
Subject: [PATCH] Tidy HTML output
---
core/models/caves.py | 6 +++---
templates/base.html | 1 +
templates/cave_qms.html | 11 +++++++++--
templates/qm.html | 2 ++
urls.py | 4 ++--
5 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/core/models/caves.py b/core/models/caves.py
index 20e2d5b..5ba4804 100644
--- a/core/models/caves.py
+++ b/core/models/caves.py
@@ -496,7 +496,7 @@ class QM(TroggleModel):
('C', 'C: Tight unpromising lead'),
('D', 'D: Dig'),
('X', 'X: Unclimbable aven')
- )
+ ) # also seen "?"
grade = models.CharField(max_length=1, choices=GRADE_CHOICES)
location_description = models.TextField(blank=True)
nearest_station_description = models.CharField(max_length=400,blank=True, null=True)
@@ -525,8 +525,8 @@ class QM(TroggleModel):
def get_previous_by_id(self):
return QM.objects.get(id=self.id-1)
- def wiki_link(self):
- return "%s%s%s" % ('[[QM:',self.code(),']]')
+ # def wiki_link(self):
+ # return "%s%s%s" % ('[[QM:',self.code(),']]')
class PersonTrip(TroggleModel):
"""Single Person going on a trip, which may or may not be written up.
diff --git a/templates/base.html b/templates/base.html
index e94db63..34f6581 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -43,6 +43,7 @@
Data Issues |
tasks to do |
caves |
+ QMs |
ents |
expoers |
survey lengths |
diff --git a/templates/cave_qms.html b/templates/cave_qms.html
index 96df2eb..988ffa5 100644
--- a/templates/cave_qms.html
+++ b/templates/cave_qms.html
@@ -1,3 +1,7 @@
+{% extends "base.html" %}
+{% load link %}
+{% block title %} QM: {{qm|safe}} {% endblock %}
+{% block contentheader %}
Question marks for {{cave.kataster_number}} - {{cave.official_name|safe}} - {{cave.unofficial_number}}
Note that QMs are only loaded for 1623-161, 1623-204 and 1623-234 as these are the only CSV files loaded by the import parser.
@@ -7,13 +11,15 @@
1623-204 QMs
1623-234 QMs
+{% endblock %}
+{% block content %}
Extant
{% if cave.get_QMs %}
{% for QM in cave.get_QMs %}
{% if QM.ticked_off_by %}
{% else %}
- - {{QM}} {{QM.nearest_station_name}} :: {{QM.nearest_station_description}} {{QM.cave}}
+ - {{QM}} {{QM.nearest_station_name}} :: {{QM.nearest_station_description}} {{QM.location_description}} {{QM.grade}}
{% endif %}
{% endfor %}
@@ -21,8 +27,9 @@
{% for QM in cave.get_QMs %}
{% if QM.ticked_off_by %}
- - {{QM}} {{QM.nearest_station_name}} :: {{QM.nearest_station_description}} {{QM.cave}}
+ - {{QM}} {{QM.nearest_station_name}} :: {{QM.nearest_station_description}} {{QM.location_description}} {{QM.grade}}
{% endif %}
{% endfor %}
{% endif %}
+{% endblock %}
\ No newline at end of file
diff --git a/templates/qm.html b/templates/qm.html
index 807b3ea..b9b22c7 100644
--- a/templates/qm.html
+++ b/templates/qm.html
@@ -29,6 +29,8 @@ Parent cave: {{qm.found_by.cave|link}}
Location
{{qm.location_description}}
+Grade
+{{qm.grade}}
Creation
Found by {{qm.found_by}} on {{qm.found_by.date}}.
diff --git a/urls.py b/urls.py
index 977fcba..d4dbf9d 100644
--- a/urls.py
+++ b/urls.py
@@ -176,8 +176,8 @@ trogglepatterns = [
path('dwgdataraw/', dwgfilesingle, name="dwgfilesingle"),
# QMs pages - must precede other /caves pages?
- re_path(r'^cave/qms/([^/]+)/?$', caveQMs), # Being fixed, currently returns all QMs for all caves
- re_path(r'^cave/qms/(?P[^/]+)/(?P\d\d\d\d)-(?P\d*)(?P[ABCDXV]?)?$', qm, name="qm"), # broken..
+ re_path(r'^cave/qms/([^/]+)/?$', caveQMs, name="caveQMs"), # Fixed. July 2022
+ re_path(r'^cave/qms/(?P[^/]+)/(?P\d\d\d\d)-(?P\d*)(?P[ABCDXV\?]?)?$', qm, name="qm"), # Fixed. July 2022
# Prospecting Guide document
re_path(r'^prospecting_guide/$', prospecting), # disabled. Bad links, incompatible image package use and very, very out of date.