changeset 2248:254b7d085447

Namespace support for global tags view.
author Ashutosh Singla <ashu1461@gmail.com>
date Tue, 20 Aug 2013 20:06:12 +0530
parents 3f532c2cac83
children cbac7d3a33c7
files MoinMoin/apps/frontend/views.py
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Tue Aug 20 19:57:45 2013 +0530
+++ b/MoinMoin/apps/frontend/views.py	Tue Aug 20 20:06:12 2013 +0530
@@ -1958,13 +1958,18 @@
         return False
 
 
-@frontend.route('/+tags')
-def global_tags():
+@frontend.route('/+tags', defaults=dict(namespace=NAMESPACE_DEFAULT), methods=['GET'])
+@frontend.route('/<namespace>/+tags')
+def global_tags(namespace):
     """
     show a list or tag cloud of all tags in this wiki
     """
     title_name = _(u'All tags in this wiki')
-    revs = flaskg.storage.documents(wikiname=app.cfg.interwikiname)
+    query = {WIKINAME: app.cfg.interwikiname}
+    if namespace != NAMESPACE_ALL:
+        query[NAMESPACE] = namespace
+
+    revs = flaskg.storage.documents(**query)
     tags_counts = {}
     for rev in revs:
         tags = rev.meta.get(TAGS, [])