comparison libervia/server/pages.py @ 1302:04e7dd6b6f4d

pages (blog, tickets, merge-requests): updated code to handle new serialisation, following backend changes
author Goffi <goffi@goffi.org>
date Thu, 16 Jul 2020 09:08:47 +0200
parents 44da7b118b02
children 70e3341d25bf
comparison
equal deleted inserted replaced
1301:ff44f822bfdd 1302:04e7dd6b6f4d
952 @param pubsub_data(dict): pubsub metadata parsed with 952 @param pubsub_data(dict): pubsub metadata parsed with
953 data_objects.parsePubSubMetadata 953 data_objects.parsePubSubMetadata
954 """ 954 """
955 template_data = request.template_data 955 template_data = request.template_data
956 try: 956 try:
957 last_id = pubsub_data["rsm_last"] 957 rsm = pubsub_data["rsm"]
958 last_id = rsm["last"]
958 except KeyError: 959 except KeyError:
959 # no pagination available 960 # no pagination available
960 return 961 return
961 962
962 if pubsub_data.get("rsm_index", 1) > 0: 963 if rsm.get("index", 1) > 0:
963 # We only show previous button if it's not the first page already. 964 # We only show previous button if it's not the first page already.
964 # If we have no index, we default to display the button anyway 965 # If we have no index, we default to display the button anyway
965 # as we can't know if we are on the first page or not. 966 # as we can't know if we are on the first page or not.
966 first_id = pubsub_data["rsm_first"] 967 first_id = rsm["first"]
967 template_data['previous_page_url'] = self.getParamURL(request, 968 template_data['previous_page_url'] = self.getParamURL(request,
968 before=first_id) 969 before=first_id)
969 if not pubsub_data["complete"]: 970 if not pubsub_data["complete"]:
970 # we also show the page next button if complete is None because we 971 # we also show the page next button if complete is None because we
971 # can't know where we are in the feed in this case. 972 # can't know where we are in the feed in this case.