Browse Source

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

make_mycreole_indenpendent_from_patt
Dirk Alders 3 weeks ago
parent
commit
e093c48e91
2 changed files with 4 additions and 6 deletions
  1. 3
    0
      README.md
  2. 1
    6
      context.py

+ 3
- 0
README.md View File

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

+ 1
- 6
context.py View File

20
 def context_adaption(context, request, title, rel_path, **kwargs):
20
 def context_adaption(context, request, title, rel_path, **kwargs):
21
     context.set_additional_title(title)
21
     context.set_additional_title(title)
22
     add_bar = parameter.get(parameter.MYCREOLE_BAR)
22
     add_bar = parameter.get(parameter.MYCREOLE_BAR)
23
-    next = kwargs.get('next')
24
     for key in add_bar:
23
     for key in add_bar:
25
         method = add_bar[key]
24
         method = add_bar[key]
26
         if method is not None:
25
         if method is not None:
27
-            if next.find("/", 2) != -1:
28
-                rp = next[next.find("/", 2) + 1:]
29
-            else:
30
-                rp = None
31
-            method(context, request, caller_name="attachments", rel_path=rp)
26
+            method(context, request, caller_name="mycreole-attachments", **kwargs)
32
     add_new(request, context[context.ACTIONBAR], rel_path, kwargs.get('next'))
27
     add_new(request, context[context.ACTIONBAR], rel_path, kwargs.get('next'))
33
     for key in kwargs:
28
     for key in kwargs:
34
         context[key] = kwargs[key]
29
         context[key] = kwargs[key]

Loading…
Cancel
Save