diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-07-05 17:02:43 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-07-05 17:02:43 +0300 |
commit | 9d4a97fc19faa1b56a6fca07dfcf546a6c27c0d1 (patch) | |
tree | a1282d03ab8fb323427a57d69bfcffcc96fc1b60 | |
parent | c9a33a401004240e9cac7d58bb12e5a846acede1 (diff) | |
download | troggle-9d4a97fc19faa1b56a6fca07dfcf546a6c27c0d1.tar.gz troggle-9d4a97fc19faa1b56a6fca07dfcf546a6c27c0d1.tar.bz2 troggle-9d4a97fc19faa1b56a6fca07dfcf546a6c27c0d1.zip |
Tidy HTML output
-rw-r--r-- | core/models/caves.py | 6 | ||||
-rw-r--r-- | templates/base.html | 1 | ||||
-rw-r--r-- | templates/cave_qms.html | 11 | ||||
-rw-r--r-- | templates/qm.html | 2 | ||||
-rw-r--r-- | 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 @@ <a href="{% url "dataissues" %}">Data Issues</a> | <a href="/handbook/computing/todo-data.html">tasks to do </a> | <a id="cavesLink" href="{% url "caveindex" %}">caves</a> | + <a id="qmsLink" href="{% url "caveQMs" "1623-161" %}">QMs</a> | <a id="entsLink" href="{% url "eastings" %}">ents</a> | <a id="folklink" href="/folk">expoers</a> | <a id="caversLink" href="{% url "notablepersons" %}">survey lengths</a> | 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 %} <h2>Question marks for {{cave.kataster_number}} - {{cave.official_name|safe}} - {{cave.unofficial_number}}</h2> <p>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 @@ <li><a href="/cave/qms/1623-204">1623-204 QMs</a> <li><a href="/cave/qms/1623-234">1623-234 QMs</a> </ul> +{% endblock %} +{% block content %} <h3>Extant</h3> <p>{% if cave.get_QMs %} <ul id="cavelist"> {% for QM in cave.get_QMs %} {% if QM.ticked_off_by %} {% else %} - <li><a href="{{QM.get_absolute_url}}">{{QM}}</a> {{QM.nearest_station_name}} :: {{QM.nearest_station_description}} <b>{{QM.cave}}</b></li> + <li><a href="{{QM.get_absolute_url}}">{{QM}}</a> {{QM.nearest_station_name}} :: {{QM.nearest_station_description}} {{QM.location_description}} <b>{{QM.grade}}</b></li> {% endif %} {% endfor %} </ul> @@ -21,8 +27,9 @@ <ul> {% for QM in cave.get_QMs %} {% if QM.ticked_off_by %} - <li><a href="{{QM.get_absolute_url}}">{{QM}}</a> {{QM.nearest_station_name}} :: {{QM.nearest_station_description}} <b>{{QM.cave}}</b></li> + <li><a href="{{QM.get_absolute_url}}">{{QM}}</a> {{QM.nearest_station_name}} :: {{QM.nearest_station_description}} {{QM.location_description}} <b>{{QM.grade}}</b></li> {% endif %} {% endfor %} </ul> {% endif %}</p> +{% 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}} <h3>Location</h3> {{qm.location_description}} +<h3>Grade</h3> +{{qm.grade}} <h3>Creation</h3> Found by <a href="{{qm.found_by.get_absolute_url}}">{{qm.found_by}}</a> on {{qm.found_by.date}}. @@ -176,8 +176,8 @@ trogglepatterns = [ path('dwgdataraw/<path:path>', 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<cave_id>[^/]+)/(?P<year>\d\d\d\d)-(?P<qm_id>\d*)(?P<grade>[ABCDXV]?)?$', qm, name="qm"), # broken.. + re_path(r'^cave/qms/([^/]+)/?$', caveQMs, name="caveQMs"), # Fixed. July 2022 + re_path(r'^cave/qms/(?P<cave_id>[^/]+)/(?P<year>\d\d\d\d)-(?P<qm_id>\d*)(?P<grade>[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. |