mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-21 23:01:52 +00:00
QM check-box report for open leads
This commit is contained in:
parent
2541766dd5
commit
d3d983eedb
@ -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})
|
||||
|
||||
|
64
templates/cave_open_qms.html
Normal file
64
templates/cave_open_qms.html
Normal file
@ -0,0 +1,64 @@
|
||||
{% extends "base.html" %}
|
||||
{% load link %}
|
||||
{% block title %} QM: {{qm|safe}} {% endblock %}
|
||||
{% block contentheader %}
|
||||
<h2>Open Leads for <a href="/{{cave.url}}">{{cave.kataster_number}} {% if cave.official_name %}- {{cave.official_name|safe}}{% endif %}</a>{% if cave.unofficial_number %} - ({{cave.unofficial_number|safe}}){% endif %}</h2>
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
{{cave.slug}} - <a href="/cave/qms/{{cave.slug}}">All QMs</a><br />
|
||||
{{cave.slug}} - all <a href="/survexfile/{{cave.kataster_number}}">Survexfiles</a><br />
|
||||
{{cave.slug}} - <a href="/survexfile/{{cave.survex_file}}">Primary survexfile</a><br />
|
||||
<br />
|
||||
§ QM.nearest_station_name<br />
|
||||
☉ QM.page_ref<br />
|
||||
<span style="color:red;">QM.comment</span><br />
|
||||
|
||||
<style>
|
||||
li::marker {
|
||||
font-size: 200%;
|
||||
display: flex;
|
||||
}
|
||||
li {
|
||||
|
||||
}
|
||||
</style>
|
||||
<ul style="padding-left: 1em; font-size: 130%;list-style-type: '⬜ ' ">{% for QM in cave.get_open_QMs %}
|
||||
{% ifchanged QM.block %}
|
||||
<div style="text-align:center"><hr /><a href="/survexfile/{{QM.block.survexfile.path}}.svx">{{QM.block}}.svx</a></div><br />{% endifchanged %}
|
||||
<li> <b>{{QM.grade}}</b> <a href="{{QM.get_absolute_url}}">{{QM}}</a>
|
||||
{% if QM.nearest_station_name %}§<em><span style="font-family: monospace">{{QM.nearest_station_name|safe}}</span></em>§{% endif %}<br />
|
||||
{{QM.location_description|safe}}<br />
|
||||
|
||||
{% if QM.block %}{{QM.block.date|date:'Y-m-d'}} {% endif %}
|
||||
{% if QM.comment %}
|
||||
<span style="color:red;">{{QM.comment}}</span>{% endif %}<br /><br />
|
||||
{% empty %}
|
||||
<li>No open leads.
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
|
||||
<hr />
|
||||
<p>Note that QMs loaded for 1623-161, 1623-204 and 1623-234 are imported from CSV files .
|
||||
|
||||
<ul>
|
||||
<li><a href="{% url 'caveQMs' '1623-161' %}">1623-161 QMs</a> Maybe OUT OF DATE. See <a href="/1623/161/qmdone.htm">the manually curated list <b>instead</b></a>
|
||||
<li><a href="{% url 'caveQMs' '1623-204' %}">1623-204 QMs</a> Maybe OUT OF DATE. See <a href=" /1623/204/qm.html">the manually curated list <b>instead</b></a>
|
||||
<li><a href="{% url 'caveQMs' '1623-234' %}">1623-234 QMs</a>
|
||||
</ul>
|
||||
<p>QMs are also loaded directly from the survex files, e.g. see
|
||||
<ul>
|
||||
<li><a href="{% url 'caveQMs' '1623-264' %}">1623-264 QMs</a> Balkon
|
||||
<li><a href="{% url 'caveQMs' '1623-258' %}">1623-258 QMs</a> Tunnocks
|
||||
<li><a href="{% url 'caveQMs' '1623-290' %}">1623-290 QMs</a> Fischgesicht
|
||||
<li><a href="{% url 'caveQMs' '1623-291' %}">1623-291 QMs</a> Happy Butterfly
|
||||
<li><a href="{% url 'caveQMs' '1626-359' %}">1626-359 QMs</a> Homecoming
|
||||
</ul>
|
||||
|
||||
<p>For how to set up your own QMs, see <a href="/handbook/survey/qmentry.html">Adding QMs </a>.
|
||||
<p>For full explanation of the current status of the QM system(s), see <a href="/handbook/troggle/scriptsqms.html">scriptsqms page</a>.
|
||||
<hr />
|
||||
{% endblock %}
|
1
urls.py
1
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<cave_id>[^/]+)/(?P<year>\d\d\d\d)-(?P<qm_id>\d*)(?P<grade>[ABCDXV\?]?)-?(?P<blockname>[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.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user