changeset 1142:003597f895a0

pages (tickets): use the new getPubsubExtra and setPagination methods to handle pagination
author Goffi <goffi@goffi.org>
date Fri, 11 Jan 2019 21:47:10 +0100
parents 02fc28aac2b6
children 7bd47d32da87
files libervia/pages/tickets/page_meta.py
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libervia/pages/tickets/page_meta.py	Fri Jan 11 21:45:59 2019 +0100
+++ b/libervia/pages/tickets/page_meta.py	Fri Jan 11 21:47:10 2019 +0100
@@ -37,20 +37,22 @@
 
     self.checkCache(request, C.CACHE_PUBSUB, service=service, node=node, short="tickets")
 
-    tickets = yield self.host.bridgeCall(
+    extra = self.getPubsubExtra(request)
+    extra[u"labels_as_list"] = C.BOOL_TRUE
+
+    tickets, metadata = yield self.host.bridgeCall(
         "ticketsGet",
         service.full() if service else u"",
         node,
         C.NO_LIMIT,
         [],
         "",
-        {
-            "labels_as_list": C.BOOL_TRUE,
-            C.KEY_ORDER_BY: C.ORDER_BY_CREATION,
-        },
+        extra,
         profile,
     )
-    template_data[u"tickets"] = [template_xmlui.create(self.host, x) for x in tickets[0]]
+    template_data[u"tickets"] = [template_xmlui.create(self.host, x) for x in tickets]
     template_data[u"on_ticket_click"] = data_objects.OnClick(
         url=self.getSubPageURL(request, u"tickets_view") + u"/{item.id}"
     )
+    metadata = data_objects.parsePubSubMetadata(metadata, tickets)
+    self.setPagination(request, metadata)