changeset 2290:5beaf17c6a1a

Updated Namespace all support for history views.
author Ashutosh Singla <ashu1461@gmail.com>
date Sun, 22 Sep 2013 04:47:03 +0530
parents dc0d79d43bd4
children b02bac100074
files MoinMoin/apps/frontend/views.py
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/frontend/views.py	Sun Sep 22 04:42:25 2013 +0530
+++ b/MoinMoin/apps/frontend/views.py	Sun Sep 22 04:47:03 2013 +0530
@@ -839,7 +839,6 @@
 
     dirs, files = item.get_index(startswith, selected_groups)
     # index = sorted(index, key=lambda e: e.relname.lower())
-
     item_names = item_name.split(u'/')
     return render_template(item.index_template,
                            item_names=item_names,
@@ -1009,12 +1008,13 @@
 def global_history(namespace):
     all_revs = bool(request.values.get('all'))
     idx_name = ALL_REVS if all_revs else LATEST_REVS
-    terms = Term(WIKINAME, app.cfg.interwikiname)
+    terms = [Term(WIKINAME, app.cfg.interwikiname)]
+    fqname = split_fqname(namespace)
     if namespace != NAMESPACE_ALL:
-        terms = And([terms, Term(NAMESPACE, namespace)])
+        terms.append(Term(NAMESPACE, namespace))
     bookmark_time = flaskg.user.bookmark
     if bookmark_time is not None:
-        terms = And([terms, DateRange(MTIME, start=datetime.utcfromtimestamp(bookmark_time), end=None)])
+        terms.append(DateRange(MTIME, start=datetime.utcfromtimestamp(bookmark_time), end=None))
     query = And(terms)
     revs = flaskg.storage.search(query, idx_name=idx_name, sortedby=[MTIME], reverse=True, limit=1000)
     # Group by date
@@ -1041,6 +1041,7 @@
                            history=history,
                            current_timestamp=current_timestamp,
                            bookmark_time=bookmark_time,
+                           fqname=fqname,
     )