summaryrefslogtreecommitdiffstats
path: root/core/views/survex.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views/survex.py')
-rw-r--r--core/views/survex.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/views/survex.py b/core/views/survex.py
index 0437d12..b24b51b 100644
--- a/core/views/survex.py
+++ b/core/views/survex.py
@@ -20,7 +20,7 @@ from troggle.core.models.logbooks import LogbookEntry
from troggle.core.models.caves import Cave, GetCaveLookup
from troggle.core.models.survex import SurvexFile, SurvexBlock #, SurvexDirectory
from troggle.core.models.wallets import Wallet
-from troggle.core.utils import only_commit
+from troggle.core.utils import only_commit, current_expo
from troggle.parsers.survex import parse_one_file
"""Everything that views survexfiles
@@ -389,6 +389,7 @@ def svx(request, survex_file):
events = events_on_dates(svxblocks)
vmap = {
+ "year": current_expo(),
"settings": settings,
"warning": warning,
"has_3d": has_3d,
@@ -640,7 +641,8 @@ def survexcaveslist(request):
"settings": settings,
"onefilecaves": onefilecaves,
"multifilecaves": multifilecaves,
- "subdircaves": subdircaves,
+ "subdircaves": subdircaves,
+ "year": current_expo(),
},
)
@@ -654,7 +656,7 @@ def survexdir(request):
f.pathbad = True
if Path(settings.SURVEX_DATA, f"{f.path}.svx").is_file():
f.pathbad = False
- return render(request, "survexdir.html", {"survexfiles": survexfiles, "caves": caves})
+ return render(request, "survexdir.html", {"survexfiles": survexfiles, "caves": caves, "year": current_expo()})
def get_primaries(cave):
sds = []
@@ -674,7 +676,7 @@ def survexcavesingle(request, cave_shortname):
cave = Gcavelookup[cave_shortname]
# print(f"survexcavesingle {cave_shortname=} => {cave=}")
cave.sds = get_primaries(cave)
- return render(request, "svxcaves.html", {"settings": settings, "caves": [cave]})
+ return render(request, "svxcaves.html", {"settings": settings, "caves": [cave], "year": current_expo()})
else:
caves = Cave.objects.filter(kataster_number=cave_shortname)
if len(caves) > 0:
@@ -682,9 +684,9 @@ def survexcavesingle(request, cave_shortname):
for cave in caves:
cave.sds = get_primaries(cave)
# print(f"many {cave=} => {cave.sds=}")
- return render(request, "svxcaves.html", {"settings": settings, "caves": caves})
+ return render(request, "svxcaves.html", {"settings": settings, "caves": caves, "year": current_expo()})
else:
- return render(request, "errors/svxcaves404.html", {"settings": settings, "cave": cave_shortname})
+ return render(request, "errors/svxcaves404.html", {"settings": settings, "cave": cave_shortname, "year": current_expo()})
def check_cave_registered(areacode, survex_cave):
"""Checks whether a cave has been properly registered when it is found in the Loser repo