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

Making page templates autoadjust to the current year

This commit is contained in:
Philip Sargent 2022-10-15 21:28:56 +03:00
parent 55ac98ebe1
commit 830150ade6
4 changed files with 22 additions and 7 deletions

View File

@ -152,8 +152,8 @@ def walletslistperson(request, first_name, last_name):
return render(request, 'errors/generic.html', {'message': f'Unrecognised name of a expo person: "{first_name} {last_name}"'}) return render(request, 'errors/generic.html', {'message': f'Unrecognised name of a expo person: "{first_name} {last_name}"'})
manywallets = tickspersonwallet(p) manywallets = tickspersonwallet(p)
expeditions = Expedition.objects.all()
return render(request, 'personwallets.html', { 'manywallets':manywallets, 'settings': settings, 'person': p}) return render(request, 'personwallets.html', { 'manywallets':manywallets, 'settings': settings, 'person': p, 'expeditions': expeditions})
def walletslistyear(request, year): def walletslistyear(request, year):
@ -223,7 +223,8 @@ def cavewallets(request, caveid):
fillblankothers(w) fillblankothers(w)
w.ticks = w.get_ticks() # the complaints in colour form, from the json file on disc w.ticks = w.get_ticks() # the complaints in colour form, from the json file on disc
fixsurvextick(w, w.ticks) fixsurvextick(w, w.ticks)
return render(request, 'cavewallets.html', { 'manywallets':manywallets, 'settings': settings, 'cave': cave}) expeditions = Expedition.objects.all()
return render(request, 'cavewallets.html', { 'manywallets':manywallets, 'settings': settings, 'cave': cave, 'expeditions': expeditions})
def oldwallet(request, path): def oldwallet(request, path):

View File

@ -15,9 +15,11 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
<p>This lists all the files in a wallet, some of which may not be for this specific cave. <p>This lists all the files in a wallet, some of which may not be for this specific cave.
<p>See also wallets <p>See also wallets
<ul> <ul>
<li>per year, e.g. <a href="/wallets/year/2018">2018</a>, <a href="/wallets/year/2019">2019</a>, <a href="/wallets/year/2022">2022</a>
<li>per person, e.g. <a href="/wallets/person/Wookey">Wookey</a>, <a href="/wallets/person/ChrisDensham">Chris Densham</a>, <a href="/wallets/person/BeckaLawson">Becka</a> <li>per person, e.g. <a href="/wallets/person/Wookey">Wookey</a>, <a href="/wallets/person/ChrisDensham">Chris Densham</a>, <a href="/wallets/person/BeckaLawson">Becka</a>
</ul> <li>per year:
{% for otherexpedition in expeditions %}
| <a <a href="/wallets/year/{{ otherexpedition.year }}">{{otherexpedition.year}}</a>
{% endfor %}</ul></ul>
{% include 'wallet_table.html' %} {% include 'wallet_table.html' %}
<br /> <br />
<table width=95%> <table width=95%>

View File

@ -13,9 +13,11 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
<p>See also wallets <p>See also wallets
<ul> <ul>
<li>per year, e.g. <a href="/wallets/year/2018">2018</a>, <a href="/wallets/year/2019">2019</a>, <a href="/wallets/year/2022">2022</a>
<li>per cave, e.g. <a href="/cave/scans/1623-161">1623-161</a>, <a href="/cave/scans/1626-359">1626-359</a>, <a href="/cave/scans/1623-290">1623-290</a>, <a href="/cave/scans/1623-291">1623-291</a>, <a href="/cave/scans/1623-264">1623-264</a> <li>per cave, e.g. <a href="/cave/scans/1623-161">1623-161</a>, <a href="/cave/scans/1626-359">1626-359</a>, <a href="/cave/scans/1623-290">1623-290</a>, <a href="/cave/scans/1623-291">1623-291</a>, <a href="/cave/scans/1623-264">1623-264</a>
</ul> <li>per year:
{% for otherexpedition in expeditions %}
| <a <a href="/wallets/year/{{ otherexpedition.year }}">{{otherexpedition.year}}</a>
{% endfor %}</ul>
{% include 'wallet_table.html' %} {% include 'wallet_table.html' %}
<br /> <br />

View File

@ -49,6 +49,16 @@
<td style="padding:1px; background-color:{{wallet.ticks.T}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.T}}">&nbsp;</td>
<td style="padding:1px; background-color:{{wallet.ticks.W}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.W}}">&nbsp;</td>
</tr> </tr>
{% empty %} <h2>No Wallets for this year</h2>
<b>Before 1998</b> we used a survey book system, not wallets. But 1983 has some scraps recreated as wallets.
<p>That is probably why you cannot see anything here. Look at the complete list of scanned files instead,
at <a href="/survey_scans/">Scans</a> (it is slow, so be patient).
It lists things like "1984AndysNotebook" instead of a wallet identifier, but if you click on
<a href="/survey_scans/1984AndysNotebook/">"1984AndysNotebook"</a> you
will see some of the the notes and sketches scanned from it.
<p>Or look at all the scanned files,
their wallet names and the drawings that were created using them at <a href="/dwgfiles/">Drawings</a>
which is probably more useful.
{% endfor %} {% endfor %}
</table> </table>
<p>Note that names in italics are copied from the related survex file block name. <p>Note that names in italics are copied from the related survex file block name.