From 36071e4de0c99d17683361efb2bb3b5c8827f1fc Mon Sep 17 00:00:00 2001 From: Dirk Alders Date: Mon, 7 Oct 2024 00:44:22 +0200 Subject: [PATCH] Minor changes, fixes and todos added --- mycreole | 2 +- pages/access.py | 6 ++++-- pages/context.py | 2 +- pages/page.py | 6 +++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mycreole b/mycreole index 2abea3c..68e89f8 160000 --- a/mycreole +++ b/mycreole @@ -1 +1 @@ -Subproject commit 2abea3c4aec4716a2609828faddcd6b6e4c7728e +Subproject commit 68e89f85a1a9ea0cd9140ebe8c31ecd0583b0a3a diff --git a/pages/access.py b/pages/access.py index 5d9b887..f282bde 100644 --- a/pages/access.py +++ b/pages/access.py @@ -9,8 +9,10 @@ def write_page(request, rel_path): def read_attachment(request, rel_path): - return read_page(request, rel_path) + # TODO: /!\ rel_path is the filsystem rel_path - caused by the flat folder structure /!\ + return True def modify_attachment(request, rel_path): - return write_page(request, rel_path) + # TODO: /!\ rel_path is the filsystem rel_path - caused by the flat folder structure /!\ + return request.user.is_authenticated and request.user.username in ['root', 'dirk'] diff --git a/pages/context.py b/pages/context.py index 173f570..84cb9db 100644 --- a/pages/context.py +++ b/pages/context.py @@ -31,7 +31,6 @@ def context_adaption(context, request, **kwargs): context.set_additional_title(kwargs.pop('title')) except KeyError: pass # no title in kwargs - menubar_users(context[context.MENUBAR], request) menubar(context, request, caller_name, **kwargs) actionbar(context, request, caller_name, **kwargs) navigationbar(context, request, caller_name, **kwargs) @@ -74,6 +73,7 @@ def navigation_entry_parameters(request, path): def menubar(context, request, caller_name, **kwargs): bar = context[context.MENUBAR] + menubar_users(bar, request) add_help_menu(request, bar) finalise_bar(request, bar) diff --git a/pages/page.py b/pages/page.py index 03ac605..dd385ec 100644 --- a/pages/page.py +++ b/pages/page.py @@ -1,5 +1,9 @@ from django.conf import settings +# TODO: PRIO: BugFix if subpages filter is used without parameters +# TODO: PRIO: Add wildcards for subpages filter +# TODO: Add whoosh and search + import fstools from pages import messages import mycreole @@ -69,7 +73,7 @@ class creol_page(object): macros = { "subpages": self.macro_subpages } - return mycreole.render(request, txt, self.attachment_path, "next_anchor", macros=macros) + return mycreole.render(request, txt, self.attachment_path, macros=macros) def macro_subpages(self, *args, **kwargs): def parse_depth(s: str):