From de54576d1131c0f2020dca082499f837ad6c672e Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Fri, 17 Mar 2023 14:33:30 +0000 Subject: [PATCH] Fix QMs reports, remove V grade --- core/models/logbooks.py | 8 ++++---- core/views/survex.py | 2 +- media/css/trog3.css | 13 ++++++++++++- templates/core/QMs_json_list.html | 14 +++++++++++++- templates/qm.html | 9 +++++---- 5 files changed, 35 insertions(+), 11 deletions(-) diff --git a/core/models/logbooks.py b/core/models/logbooks.py index fbe7e49..226f8e5 100644 --- a/core/models/logbooks.py +++ b/core/models/logbooks.py @@ -228,8 +228,8 @@ class QM(TroggleModel): ), ) - # def get_next_by_id(self): - # return QM.objects.get(id=self.id + 1) + def get_next_by_id(self): + return QM.objects.get(id=self.id + 1) - # def get_previous_by_id(self): - # return QM.objects.get(id=self.id - 1) + def get_previous_by_id(self): + return QM.objects.get(id=self.id - 1) diff --git a/core/views/survex.py b/core/views/survex.py index 714cf6d..45d63ea 100644 --- a/core/views/survex.py +++ b/core/views/survex.py @@ -105,7 +105,7 @@ survextemplatefile = """; *** THIS IS A TEMPLATE FILE NOT WHAT YOU MIGHT BE EXPE ; QM doesn't go anywhere, set the resolution-station to be the same as the ; nearest-station. Include any relevant details of how to find or push the QM in ; the textual description. -;Serial number grade(A/B/C/D/V/X) nearest-station resolution-station description +;Serial number grade(A/B/C/D/X) nearest-station resolution-station description ;[ QM1 A surveyname.3 - description of QM ] ;[ QM2 B surveyname.5 - description of QM ] diff --git a/media/css/trog3.css b/media/css/trog3.css index 48fbd95..1311686 100644 --- a/media/css/trog3.css +++ b/media/css/trog3.css @@ -301,9 +301,20 @@ th a.redtext:link { color:#F00; - } +a.whitetext:link { + color:#FFF; +} +a.whitetext:visited { + color:#bbb; +} +a.whitetext:hover { + color:#99F; +} +a.whitetext:active { + color:#F00; +} td.survexnewfile { background-color:#f99; diff --git a/templates/core/QMs_json_list.html b/templates/core/QMs_json_list.html index 45fcfa9..70ed97b 100644 --- a/templates/core/QMs_json_list.html +++ b/templates/core/QMs_json_list.html @@ -4,7 +4,7 @@ "{{qm.blockname}}","QM{{qm.number}}","{{qm.grade}}","{{qm.nearest_station_name}}","{{qm.resolution_station_name}}","{{qm.get_absolute_url}}"]{% if not forloop.last %},{% endif %} {% endfor %} }

------------------------------------------------------- +------------------------------------------------------
Hacked up list of caves with grade "?"

@@ -16,6 +16,18 @@ Hacked up list of caves with grade "?" ]{% if not forloop.last %},{% endif %} {% endif %} {% endfor %} } +

+------------------------------------------------------
+Hacked up list of caves with grade "V" +

+{% for qm in object_list %} +{% if qm.grade == "V" %}
+"{{qm.id}}": ["{{qm.expoyear}}","{{qm.cave}}",{% if qm.ticked %}"TICKed",{% else %}"OPEN",{% endif %} +"{{qm.blockname}}","QM{{qm.number}}","{{qm.grade}}","{{qm.nearest_station_name}}","{{qm.resolution_station_name}}", +"{{qm.get_absolute_url}}" +]{% if not forloop.last %},{% endif %} +{% endif %} +{% endfor %} } {% endblock %} diff --git a/templates/qm.html b/templates/qm.html index d701463..69ada72 100644 --- a/templates/qm.html +++ b/templates/qm.html @@ -21,9 +21,9 @@ - - - + + +
Previous{{qm|safe}}NextPrevious QMQM   {{qm|safe}}Next QM
{% endblock %} @@ -46,7 +46,8 @@ {{qm.number}}

Grade

-{{qm.grade}} +{{qm.grade}} +

Explanation of Grade letters: Handbook - QM grades {% if qm.block %}

Survexfile