2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 12:51:11 +00:00

add 2 years before caves to recent page

This commit is contained in:
2025-08-02 21:26:38 +02:00
parent ae88d279cb
commit ebfdc6c34c
2 changed files with 15 additions and 0 deletions

View File

@@ -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()},
)