From ebfdc6c34c96fee911d6c9402394e638293137c5 Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Sat, 2 Aug 2025 21:26:38 +0200 Subject: [PATCH] add 2 years before caves to recent page --- core/views/caves.py | 8 ++++++++ templates/caveindex.html | 7 +++++++ 2 files changed, 15 insertions(+) diff --git a/core/views/caves.py b/core/views/caves.py index cc0d72801..2dca8b7ec 100644 --- a/core/views/caves.py +++ b/core/views/caves.py @@ -272,6 +272,13 @@ def caves_recent(request): caves_previous_year.append(c) caves_previous_year.sort(key=caveKey) + caves_previous2_year = [] + for c in allcaves: + previous_year = str(int(current_expo()) - 3) + if c.unofficial_number.startswith(previous_year): + caves_previous2_year.append(c) + caves_previous2_year.sort(key=caveKey) + return render( request, "caveindex.html", @@ -283,6 +290,7 @@ def caves_recent(request): "caves_this_year": caves_this_year, "caves_last_year": caves_last_year, "caves_previous_year": caves_previous_year, + "caves_previous2_year": caves_previous2_year, "cavepage": True, "year": current_expo()}, ) diff --git a/templates/caveindex.html b/templates/caveindex.html index b8abd5087..945fc83c6 100644 --- a/templates/caveindex.html +++ b/templates/caveindex.html @@ -52,6 +52,13 @@ See Undropped Caves for all unexplored c {% include 'cavelist_columns.html' %} {% endfor %} + +

The year before's caves

+
+{% for cave in caves_previous2_year %} + {% include 'cavelist_columns.html' %} +{% endfor %} +

See All Caves for all the caves in areas 1623, 1626, 1624, 1627