2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 07:11:52 +00:00

Tidy HTML output

This commit is contained in:
Philip Sargent 2022-07-05 17:02:43 +03:00
parent c9a33a4010
commit 9d4a97fc19
5 changed files with 17 additions and 7 deletions

View File

@ -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.

View File

@ -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> |

View File

@ -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 %}

View File

@ -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}}.

View File

@ -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.