year list for wallets by year

This commit is contained in:
Philip Sargent 2022-09-19 21:54:32 +03:00
parent 2648bada30
commit 13b57d2bb6
2 changed files with 15 additions and 4 deletions

View File

@ -10,7 +10,7 @@ from django.shortcuts import render
from django.http import HttpResponse
from troggle.core.models.survex import Wallet, SingleScan, SurvexBlock
from troggle.core.models.troggle import Person
from troggle.core.models.troggle import Person, Expedition
from troggle.core.models.caves import GetCaveLookup
from troggle.core.views.expo import getmimetype
#from troggle.parsers.people import GetPersonExpeditionNameLookup
@ -161,8 +161,9 @@ def walletslistyear(request, year):
#return render(request, 'errors/generic.html', {'message': 'This page logic not implemented yet'})
manywallets = ticksyearwallet(year)
return render(request, 'yearwallets.html', { 'manywallets':manywallets, 'settings': settings, 'year': year})
expeditions = Expedition.objects.all()
expedition = Expedition.objects.filter(year=year)
return render(request, 'yearwallets.html', { 'manywallets':manywallets, 'settings': settings, 'year': year, 'expeditions': expeditions, 'expedition': expedition})

View File

@ -11,10 +11,20 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
{% include 'wallet_new.html' %}
<p>See also wallets
<ul>
<ul style="width: 78%">
<li>per cave, e.g. <a href="/cave/scans/1623-161">1623/161</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 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>other years:
{% for otherexpedition in expeditions %}
{% if otherexpedition == expedition %}
| <b>{{otherexpedition.year}}</b>
{% else %}
| <a <a href="/wallets/year/{{ otherexpedition.year }}">{{otherexpedition.year}}</a>
{% endif %}
{% endfor %}
</ul>
{% include 'wallet_table.html' %}