2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-01-18 16:52:51 +00:00

Initial add of On This Day links to svx file page

This commit is contained in:
2023-02-26 22:13:37 +00:00
parent 394d94d5d6
commit 6de4fa66a2
9 changed files with 104 additions and 55 deletions

View File

@@ -71,46 +71,6 @@
</div>
<span style="font-family: monospace; font-size: 150%; ">
{% if svxothers %}<u>Survex files</u> on this date:<br>
<span style="font-size: 70%; ">
{% for item in svxothers %}
{% if item.isSurvexBlock %}&nbsp;&nbsp;&nbsp;&nbsp;<a href="/survexfile/{{item.survexfile.path}}">{{item.survexfile.path|safe}}</a><br/>{% endif %}
{% empty %}
<em>None found for this date.</em><br>
{% endfor %}
</span>
{% else %}
<em>No survex files found for this date.</em><br>
{% endif %}
{% if wallets %}<u>Wallets</u> on this date:<br>
<span style="font-size: 70%; ">
{% for item in wallets %}
&nbsp;&nbsp;&nbsp;&nbsp;<a href="/survey_scans/{{item.walletname|urlencode}}/">{{item.walletname|safe}}</a>
{% if item.name %}
{{item.name|safe}} <br/>
{% else %}
{{item.get_fnames|safe}}
<br/>
{% endif %}
{% empty %}
<em>None found for this date.</em><br>
{% endfor %}
</span>
{% else %}
<em>No wallets files found for this date.</em><br>
{% endif %}
{% if trips %}<u>All logbook trips</u> on this date:<br>
<span style="font-size: 70%; ">
{% for item in trips %}
{% if item.isLogbookEntry %}&nbsp;&nbsp;&nbsp;&nbsp;<a href="{{item.get_absolute_url}}">{{item.title|safe}}</a><br/>{% endif %}
{% empty %}
<em>None found for this date, but there should be..</em><br>
{% endfor %}
</span>
{% else %}
<em>Hmm...</em><br>
{% endif %}
{% include 'onthisdate.html' %}
</span>
{% endblock %}

42
templates/onthisdate.html Normal file
View File

@@ -0,0 +1,42 @@
<!-- this is an INCLUDED template onthisdate.html-->
{% if svxothers %}<u>Survex files</u> on this date:<br>
<span style="font-size: 70%; ">
{% for item in svxothers %}
{% if item.isSurvexBlock %}&nbsp;&nbsp;&nbsp;&nbsp;<a href="/survexfile/{{item.survexfile.path}}">{{item.survexfile.path|safe}}</a><br/>{% endif %}
{% empty %}
<em>None found for this date.</em><br>
{% endfor %}
</span>
{% else %}
<em>No survex files found for this date.</em><br>
{% endif %}
{% if wallets %}<u>Wallets</u> on this date:<br>
<span style="font-size: 70%; ">
{% for item in wallets %}
&nbsp;&nbsp;&nbsp;&nbsp;<a href="/survey_scans/{{item.walletname|urlencode}}/">{{item.walletname|safe}}</a>
{% if item.name %}
{{item.name|safe}} <br/>
{% else %}
{{item.get_fnames|safe}}
<br/>
{% endif %}
{% empty %}
<em>None found for this date.</em><br>
{% endfor %}
</span>
{% else %}
<em>No wallets files found for this date.</em><br>
{% endif %}
{% if trips %}<u>All logbook trips</u> on this date:<br>
<span style="font-size: 70%; ">
{% for item in trips %}
{% if item.isLogbookEntry %}&nbsp;&nbsp;&nbsp;&nbsp;<a href="{{item.get_absolute_url}}">{{item.title|safe}}</a><br/>{% endif %}
{% empty %}
<em>None found for this date, but there should be..</em><br>
{% endfor %}
</span>
{% else %}
<em>Hmm...</em><br>
{% endif %}

View File

@@ -80,6 +80,17 @@ LOGMESSAGES
-->
{% endif %}
</div>
<span style="font-family: monospace; font-size: 130%; ">
{% for sb in svxblocks %}
<details {% if forloop.first %} open{% endif %}><summary><b>{{sb.date|date:"Y-m-d"}}</b> {{sb.title}} '{{sb.name}}'</summary>
List of Logbook entries, wallets and other survex files on {{sb.date|date:"Y-m-d"}}.
<br />
[Work in progress, Feb. 2023...]<br />
{% include 'onthisdate.html' %}
</details>
{% empty %}
Cannot find any survex blocks in this survex file. <br />
Report this to a nerd if you think this is incorrect.
{% endfor %}
</span>
{% endblock %}

View File

@@ -1,4 +1,4 @@
<!-- this is an INCLUDED template wallet_table.html-->
<table width=95%>
<tr><th>Wallet</th><th width=15%>Wallet Date</th><th>Cave</th><th>Wallet Name</th><th>Survex survey length</th>

View File

@@ -246,7 +246,7 @@
{% for item in svxothers %}
{% if item.isSurvexBlock %}&nbsp;&nbsp;&nbsp;&nbsp;<a href="/survexfile/{{item.survexfile.path}}">{{item.survexfile.path|safe}}</a><br/>{% endif %}
{% empty %}
<em>None found for this date, bit there should be..</em><br>
<em>None found for this date, but there should be..</em><br>
{% endfor %}
</span>
{% else %}