diff --git a/AIPscan/Reporter/helpers.py b/AIPscan/Reporter/helpers.py index 17c38048..4fa1bb36 100644 --- a/AIPscan/Reporter/helpers.py +++ b/AIPscan/Reporter/helpers.py @@ -145,3 +145,13 @@ def get_premis_xml_lines(file_object): premis_xml_lines = file_object.premis_object.split("\n") return premis_xml_lines + + +def calculate_paging_window(page, pagination): + first_item = ((page - 1) * pagination.per_page) + 1 + last_item = page * pagination.per_page + + if last_item > pagination.total: + last_item = pagination.total + + return first_item, last_item diff --git a/AIPscan/Reporter/templates/aips.html b/AIPscan/Reporter/templates/aips.html index c456f527..34a49684 100644 --- a/AIPscan/Reporter/templates/aips.html +++ b/AIPscan/Reporter/templates/aips.html @@ -2,7 +2,7 @@ {% block content %} -