Moved navigationbar path adaption to pages

This commit is contained in:
Dirk Alders 2024-10-07 12:33:14 +02:00
parent 36071e4de0
commit a5a3b8626e
2 changed files with 9 additions and 2 deletions

@ -1 +1 @@
Subproject commit 68e89f85a1a9ea0cd9140ebe8c31ecd0583b0a3a Subproject commit e093c48e91aa378ac87bb32e90bc391a81024acb

View File

@ -41,7 +41,14 @@ def context_adaption(context, request, **kwargs):
def navigationbar(context, request, caller_name, **kwargs): def navigationbar(context, request, caller_name, **kwargs):
bar = context[context.NAVIGATIONBAR] bar = context[context.NAVIGATIONBAR]
path = kwargs.get("rel_path", "") if caller_name == "mycreole-attachments":
next = kwargs.get("next")
if next.count("/") >= 2:
path = next[next.find("/", 2) + 1:]
else:
path = ""
else:
path = kwargs.get("rel_path", "")
while len(path) > 0 and path != os.path.sep: while len(path) > 0 and path != os.path.sep:
bar.append_entry(*navigation_entry_parameters(request, path)) bar.append_entry(*navigation_entry_parameters(request, path))
path = os.path.dirname(path) path = os.path.dirname(path)