diff options
-rw-r--r-- | core/views/scans.py | 3 | ||||
-rw-r--r-- | templates/manywallets.html | 10 |
2 files changed, 10 insertions, 3 deletions
diff --git a/core/views/scans.py b/core/views/scans.py index af26c47..9fd58d6 100644 --- a/core/views/scans.py +++ b/core/views/scans.py @@ -269,5 +269,6 @@ def allscans(request): ''' manywallets = Wallet.objects.all() # NB all of them # manywallets = Wallet.objects.all().prefetch_related('singlescan') fails as the link is defined on 'singlescan' not on 'wallet' - return render(request, 'manywallets.html', { 'manywallets':manywallets, 'settings': settings }) + expeditions = Expedition.objects.all() + return render(request, 'manywallets.html', { 'manywallets':manywallets, 'settings': settings, 'expeditions': expeditions }) diff --git a/templates/manywallets.html b/templates/manywallets.html index 6f08def..bfb2575 100644 --- a/templates/manywallets.html +++ b/templates/manywallets.html @@ -13,10 +13,16 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c otherwise they come from *ref statements in survex files as of the most recent data import. <p>See also wallets <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 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 %} + {% if otherexpedition == expedition %} + | <b>{{otherexpedition.year}}</b> + {% else %} + | <a <a href="/wallets/year/{{ otherexpedition.year }}">{{otherexpedition.year}}</a> + {% endif %} +{% endfor %}</ul> <!-- This should all be restructured to use .prefetch_related() and .select_related() see https://docs.djangoproject.com/en/3.2/ref/models/querysets/#prefetch-related |