From a5a3b8626e140b9122befda947968ec3e26dce15 Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 7 Oct 2024 12:33:14 +0200 Subject: [PATCH] Moved navigationbar path adaption to pages --- mycreole | 2 +- pages/context.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mycreole b/mycreole index 68e89f8..e093c48 160000 --- a/mycreole +++ b/mycreole @@ -1 +1 @@ -Subproject commit 68e89f85a1a9ea0cd9140ebe8c31ecd0583b0a3a +Subproject commit e093c48e91aa378ac87bb32e90bc391a81024acb diff --git a/pages/context.py b/pages/context.py index 84cb9db..775c8bb 100644 --- a/pages/context.py +++ b/pages/context.py @@ -41,7 +41,14 @@ def context_adaption(context, request, **kwargs): def navigationbar(context, request, caller_name, **kwargs): 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: bar.append_entry(*navigation_entry_parameters(request, path)) path = os.path.dirname(path)