diff MoinMoin/themes/__init__.py @ 1315:005e12de8b6a namespaces

interwiki and namespaces related url generation and split adapted to namespaces. Proper documentation still missing.
author Bruno Martin <bruno.martin@hacklab.com.br>
date Tue, 20 Mar 2012 20:59:55 -0300
parents d2704c2a8d39
children ff503e7ea7a0
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Sun Mar 04 19:24:28 2012 +0100
+++ b/MoinMoin/themes/__init__.py	Tue Mar 20 20:59:55 2012 -0300
@@ -106,9 +106,9 @@
         breadcrumbs = []
         trail = user.get_trail()
         for interwiki_item_name in trail:
-            wiki_name, item_name = split_interwiki(interwiki_item_name)
+            wiki_name, namespace, item_name = split_interwiki(interwiki_item_name)
             err = not is_known_wiki(wiki_name)
-            href = url_for_item(item_name, wiki_name=wiki_name)
+            href = url_for_item(item_name, namespace=namespace, wiki_name=wiki_name)
             if is_local_wiki(wiki_name):
                 exists = self.storage.has_item(item_name)
                 wiki_name = ''  # means "this wiki" for the theme code
@@ -195,10 +195,10 @@
         if target.startswith("wiki:"):
             target = target[5:]
 
-        wiki_name, item_name = split_interwiki(target)
+        wiki_name, namespace, item_name = split_interwiki(target)
         if wiki_name == 'Self':
             wiki_name = ''
-        href = url_for_item(item_name, wiki_name=wiki_name)
+        href = url_for_item(item_name, namespace=namespace, wiki_name=wiki_name)
         if not title:
             title = item_name
         return href, title, wiki_name