Added kwargs to extern navigation method, instead of passing a modified rel_path

This commit is contained in:
Dirk Alders 2024-10-07 12:31:17 +02:00
父節點 68e89f85a1
當前提交 e093c48e91
共有 2 個文件被更改,包括 4 次插入6 次删除

查看文件

@ -2,6 +2,9 @@
With the django library mycreole, you are abel to use the creole language to create html output in your django application. With the django library mycreole, you are abel to use the creole language to create html output in your django application.
## Requirements
You need to ensure that python-mycreole is available in your python environment.
## Integration ## Integration
Clone the library in your django application. Clone the library in your django application.

查看文件

@ -20,15 +20,10 @@ NEW_ATTACHMENT_UID = 'new_attachment'
def context_adaption(context, request, title, rel_path, **kwargs): def context_adaption(context, request, title, rel_path, **kwargs):
context.set_additional_title(title) context.set_additional_title(title)
add_bar = parameter.get(parameter.MYCREOLE_BAR) add_bar = parameter.get(parameter.MYCREOLE_BAR)
next = kwargs.get('next')
for key in add_bar: for key in add_bar:
method = add_bar[key] method = add_bar[key]
if method is not None: if method is not None:
if next.find("/", 2) != -1: method(context, request, caller_name="mycreole-attachments", **kwargs)
rp = next[next.find("/", 2) + 1:]
else:
rp = None
method(context, request, caller_name="attachments", rel_path=rp)
add_new(request, context[context.ACTIONBAR], rel_path, kwargs.get('next')) add_new(request, context[context.ACTIONBAR], rel_path, kwargs.get('next'))
for key in kwargs: for key in kwargs:
context[key] = kwargs[key] context[key] = kwargs[key]