2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-18 10:37:05 +00:00

Added link to parent cave in menu

This commit is contained in:
Martin Green
2022-06-24 19:28:31 +01:00
parent 54f47c58db
commit 7db7c67065
3 changed files with 36 additions and 3 deletions

View File

@@ -174,10 +174,17 @@ def expowebpage(request, expowebpath, path):
menumatch = re.match(r'(.*)<ul id="links">', body, re.DOTALL + re.IGNORECASE)
if menumatch:
has_menu = True
m = re.search(r"(162\d\/[^\/]+)[\/\.]", path, re.DOTALL + re.IGNORECASE)
if m:
path_start, = m.groups()
parent_caves = Cave.objects.filter(url__startswith = path_start)
else:
parent_caves = None
handbook = path.startswith("handbook")
return render(request, 'expopage.html', {'editable': editable, 'path': path, 'title': title,
'body': body, 'homepage': (path == "index.htm"), 'has_menu': has_menu, 'handbook': handbook})
'body': body, 'homepage': (path == "index.htm"), 'has_menu': has_menu, 'handbook': handbook, 'parent_caves': parent_caves})
def mediapage(request, subpath=None, doc_root=None):
'''This is for special prefix paths /photos/ /site_media/, /static/ etc.