Sfoglia il codice sorgente

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

make_mycreole_indenpendent_from_patt
Dirk Alders 3 settimane fa
parent
commit
e093c48e91
2 ha cambiato i file con 4 aggiunte e 6 eliminazioni
  1. 3
    0
      README.md
  2. 1
    6
      context.py

+ 3
- 0
README.md Vedi File

@@ -2,6 +2,9 @@
2 2
 
3 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 8
 ## Integration
6 9
 
7 10
 Clone the library in your django application.

+ 1
- 6
context.py Vedi File

@@ -20,15 +20,10 @@ NEW_ATTACHMENT_UID = 'new_attachment'
20 20
 def context_adaption(context, request, title, rel_path, **kwargs):
21 21
     context.set_additional_title(title)
22 22
     add_bar = parameter.get(parameter.MYCREOLE_BAR)
23
-    next = kwargs.get('next')
24 23
     for key in add_bar:
25 24
         method = add_bar[key]
26 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 27
     add_new(request, context[context.ACTIONBAR], rel_path, kwargs.get('next'))
33 28
     for key in kwargs:
34 29
         context[key] = kwargs[key]

Loading…
Annulla
Salva