diff MoinMoin/themes/__init__.py @ 2679:e130fc605c63

Solves issue #394 Displayed Namespaces in User tab instead of dropdown in the modernized theme and used div instead of span in the same to avoid HTML validation error as a span should not contain a ul
author Ajitesh Gupta <ajgupta93@gmail.com>
date Fri, 25 Jul 2014 19:39:17 +0530
parents c040fb080073
children 5a6660508036
line wrap: on
line diff
--- a/MoinMoin/themes/__init__.py	Sat Jul 19 17:22:05 2014 +0200
+++ b/MoinMoin/themes/__init__.py	Fri Jul 25 19:39:17 2014 +0530
@@ -462,16 +462,17 @@
         fqnames.remove(fqname)
         return fqnames or []
 
-    def get_namespaces(self, ns):
+    def get_namespaces(self, ns=None):
         """
         Return the list of tuples (composite name, namespace) referring to namespaces other
         than the current namespace.
         """
-        ns = u'' if ns.value == '~' else ns.value
+        if ns is not None and ns.value == '~':
+            ns = u''
         namespace_root_mapping = []
         for namespace, _ in app.cfg.namespace_mapping:
             namespace = namespace.rstrip('/')
-            if namespace != ns:
+            if ns is None or namespace != ns:
                 fq_namespace = CompositeName(namespace, NAME_EXACT, u'')
                 namespace_root_mapping.append((namespace or '~', fq_namespace.get_root_fqname()))
         return namespace_root_mapping