]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/utils/pagination.py
Finished with node bulk management, although only option for now is to delete nodes.
[osqa.git] / forum / utils / pagination.py
index 5951b3384c22a7d324f88548d89e3df574be33af..ca7c2728b51f4f8e641ca8f9ecdbb6b6b149db9b 100644 (file)
@@ -283,6 +283,9 @@ def _paginated(request, objects, context):
             url_builder = lambda s: mark_safe("%s%s%s=%s" % (base_path, url_joiner, context.SORT, s))
             sorts = [(n, s.label, url_builder(n), strip_tags(s.description)) for n, s in context.sort_methods.items()]
 
+            for name, label, url, descr in sorts:
+                paginator.__dict__['%s_sort_link' % name] = url
+
             return sort_tabs_template.render(template.Context({
                 'current': sort,
                 'sorts': sorts,
@@ -290,8 +293,10 @@ def _paginated(request, objects, context):
             }))
         paginator.sort_tabs = sort_tabs()
         paginator.sort_description = mark_safe(context.sort_methods[sort].description)
+        paginator.current_sort = sort
     else:
         paginator.sort_tabs = paginator.sort_description = ''
+        paginator.current_sort = ''
 
     context.set_preferences(request, session_prefs)
     objects.paginator = paginator