mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-21 14:51:51 +00:00
?
This commit is contained in:
parent
5e6aa0a175
commit
3bfb082e83
@ -390,6 +390,7 @@ def cavepage(request, karea=None, subpath=None):
|
||||
|
||||
There are also A LOT OF URLS to e.g. /1623/161/l/rl89a.htm which are IMAGES and real html files
|
||||
in cave descriptions. These need to be handled HERE too (accident of history).
|
||||
|
||||
"""
|
||||
if not subpath or subpath=='/':
|
||||
print(f"{karea=} {subpath=} ")
|
||||
@ -417,17 +418,24 @@ def cavepage(request, karea=None, subpath=None):
|
||||
return redirect(f"/{cave.url}")
|
||||
else:
|
||||
return redirect(f"/caves")
|
||||
|
||||
|
||||
|
||||
# epath = karea + subpath # e.g. 1623 /204
|
||||
# return expo.expopage(request, epath)
|
||||
|
||||
# BUGGER the real problem is the the cave descript has embedded in it images like
|
||||
# src="110/entrance.jpeg and since the cave url is now /1623/110/110.html
|
||||
# the images try to load from /1623/110/110/entrance.jpeg and of course fail.
|
||||
# THIS IS A HORRIBLE HACK
|
||||
if len(parts) == 1: # simple filename, no folders in path, need to insert caveid
|
||||
if len(parts) == 1:
|
||||
# simple filename, no folders in path,
|
||||
# either need to insert caveid OR leave as relative link as we are already "in" /1623/nn/
|
||||
subparts = parts[0].split(".")
|
||||
caveid = subparts[0]
|
||||
caveid = subparts[0] # e.g. 204.htm
|
||||
k2path = karea +"/"+ caveid + subpath
|
||||
return redirect(f"/{k2path}") # infinite loop
|
||||
elif len(parts) >2:
|
||||
# e.g. i/204.jpg, but that's ok as we are already "in" /1623/nn/
|
||||
if parts[0] == parts[1]: # double caveid
|
||||
epath = karea
|
||||
for i in parts[1:]:
|
||||
|
Loading…
Reference in New Issue
Block a user