{% extends "base.html" %}
{% load link %}
{% block title %} QM: {{qm|safe}} {% endblock %}
{% block contentheader %}
    <h2>Question marks 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>
    
    <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>.
{% endblock %}
{% block content %}
<hr />
{{cave.slug}} - all <a href="/survexfile/{{cave.kataster_number}}">Survexfiles</a><br />
{{cave.slug}} -  <a href="/survexfile/{{cave.survex_file}}">Primary survexfile</a>
    <h3>Open leads</h3>
    <ul>{% for QM in cave.get_open_QMs %}
        <li><a href="{{QM.get_absolute_url}}">{{QM}}</a>
        {% if QM.nearest_station_name %}&sect;<em><span style="font-family: monospace">{{QM.nearest_station_name|safe}}</span></em>&sect;{% endif %}
{{QM.location_description|safe}} <b>{{QM.grade}}</b> 
        {% if QM.block %} <a href="/survexfile/{{QM.block.survexfile.path}}.svx">{{QM.block}}.svx</a> {{QM.block.date|date:'Y-m-d'}} {% endif %}
        {% if QM.comment %}
        <span style="color:red;">{{QM.comment}}</span>{% endif %}
    {% empty %}
    <li>No open leads. 
    {% endfor %}
    </ul>

&sect; QM.nearest_station_name<br />
&star; QM.resolution_station_name - when ticked.<br />
    <h3>Ticked off</h3>
    <ul>{% for QM in cave.get_ticked_QMs %}
        <li><a href="{{QM.get_absolute_url}}">{{QM}}</a>
        {% if QM.nearest_station_name %}&sect;<em><span style="font-family: monospace">{{QM.nearest_station_name|safe}}</span></em>&sect;{% endif %}
        {% if QM.resolution_station_name %}<b>&star;<em><span style="font-family: monospace">{{QM.resolution_station_name|safe}}</span></em>&star;</b>{% endif %}
        {{QM.location_description|safe}} <b>{{QM.grade}}</b> 


        {% if QM.block %} <a href="/survexfile/{{QM.block.survexfile.path}}.svx">{{QM.block}}.svx</a> {{QM.block.date|date:'Y-m-d'}} {% endif %}
            {% if QM.completion_description %}
            &vellip;<em>{{QM.completion_description|safe}}</em>&vellip;
            {% endif %}   
            {% if QM.page_ref %}&#9737;<em><a href="/{{QM.cave.url_parent}}/{{QM.page_ref}}">{{QM.page_ref}}</a></em>&#9737;{% endif %}
            {% if QM.comment %}
            <span style="color:red;">{{QM.comment}}</span>{% endif %}              
    {% empty %}
    <li>No ticked leads. 
    {% endfor %}
    </ul>
</p>
&sect; QM.nearest_station_name<br />
&star; QM.resolution_station_name - when ticked.<br />
&#9737; QM.page_ref<br />
&vellip; QM.completion_description<br />
&nbsp; <span style="color:red;">QM.comment</span><br />
{% endblock %}