diff --git a/core/views/caves.py b/core/views/caves.py
index df6d4fc..67d0b23 100644
--- a/core/views/caves.py
+++ b/core/views/caves.py
@@ -205,8 +205,48 @@ def getnotablecaves():
print(notablecaves)
return notablecaves
-
def caveindex(request):
+ caves1623 = list(Cave.objects.filter(areacode="1623"))
+ caves1626 = list(Cave.objects.filter(areacode="1626"))
+ caves1623.sort(key=caveKey)
+ caves1626.sort(key=caveKey)
+
+ allcaves = caves1623 + caves1626
+ caves_this_year = []
+ for c in allcaves:
+ if c.unofficial_number.startswith(current_expo()):
+ caves_this_year.append(c)
+ caves_this_year.sort(key=caveKey)
+
+ caves_last_year = []
+ for c in allcaves:
+ last_year = str(int(current_expo()) - 1)
+ if c.unofficial_number.startswith(last_year):
+ caves_last_year.append(c)
+ caves_this_year.sort(key=caveKey)
+
+ caves_previous_year = []
+ for c in allcaves:
+ previous_year = str(int(current_expo()) - 2)
+ if c.unofficial_number.startswith(previous_year):
+ caves_previous_year.append(c)
+ caves_previous_year.sort(key=caveKey)
+
+ return render(
+ request,
+ "caveindex.html",
+ {"caves1623": caves1623,
+ "caves1626": caves1626,
+ "caves1627": "",
+ "caves1624": "",
+ "notablecaves": getnotablecaves(),
+ "caves_this_year": caves_this_year,
+ "caves_last_year": caves_last_year,
+ "caves_previous_year": caves_previous_year,
+ "cavepage": True, "year": current_expo()},
+ )
+
+def cavesall(request):
"""Should use Django order-by for lazy sorting, not here. But only after we have a proper slug system in place for Caves
"""
# allcaves = Cave.objects.all()
@@ -230,23 +270,15 @@ def caveindex(request):
caves_this_year.append(c)
caves_this_year.sort(key=caveKey)
- caves_last_year = []
- for c in allcaves:
- last_year = str(int(current_expo()) - 1)
- if c.unofficial_number.startswith(last_year):
- caves_last_year.append(c)
- caves_this_year.sort(key=caveKey)
-
return render(
request,
- "caveindex.html",
+ "cavesallindex.html",
{"caves1623": caves1623,
"caves1626": caves1626,
"caves1627": caves1627,
"caves1624": caves1624,
"notablecaves": getnotablecaves(),
"caves_this_year": caves_this_year,
- "caves_last_year": caves_last_year,
"cavepage": True, "year": current_expo()},
)
diff --git a/templates/cave_red_star.html b/templates/cave_red_star.html
new file mode 100644
index 0000000..ce0ec80
--- /dev/null
+++ b/templates/cave_red_star.html
@@ -0,0 +1,5 @@
+Red star * against a name indicates that no survex file is explicitly associated with the cave
+Blue star * against a name indicates that no survex file is explicitly associated with the cave but it is marked as 'fully explored'
+Blue triangle ▼ against a name indicates that the cave is 'pending' creation properly.
+Orange triangle ▲ against a name indicates that the cave has no Entrance (and is not 'pending').
+Black triangle ▲ against a name indicates that the cave has an Entrance, but no entrances have valid located survey stations.
\ No newline at end of file
diff --git a/templates/caveindex.html b/templates/caveindex.html
index 2b8288b..d912385 100644
--- a/templates/caveindex.html
+++ b/templates/caveindex.html
@@ -1,10 +1,10 @@
{% extends "cavebase.html" %}
-{% block title %}Cave Index{% endblock %}
+{% block title %}Recent Caves Index{% endblock %}
{% block content %}
-
+See All Caves for all the caves in areas 1623, 1626, 1624, 1627
New Cave
@@ -51,59 +49,16 @@ Black triangle ▲ against a name indicat
-
- New Cave
- Cave Number Index - kept updated
-
- New Cave
- Cave Number Index - kept updated
-
- New Cave
- Cave Number Index - kept updated
-
+See All Caves for all the caves in areas 1623, 1626, 1624, 1627
New Cave
diff --git a/templates/cavesallindex.html b/templates/cavesallindex.html
new file mode 100644
index 0000000..05d62b4
--- /dev/null
+++ b/templates/cavesallindex.html
@@ -0,0 +1,110 @@
+{% extends "cavebase.html" %}
+
+{% block title %}Cave Index{% endblock %}
+
+{% block content %}
+
+
Go to Recent Caves for a shorter list of recent caves. + +
+ New Cave
+ Cave Number Index - kept updated
+
+ New Cave
+ Cave Number Index - kept updated
+
+ New Cave
+ Cave Number Index - kept updated
+
+ New Cave
+ Cave Number Index - kept updated
+