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 %} -
AIPs ({{ aips|length }})
+
AIPs ({{ paging.items|length }})
{% if storage_services %} @@ -42,9 +42,9 @@ - {% if aips %} + {% if paging.items %} - +
@@ -54,19 +54,17 @@ - - {% if aips %} - {% for aip in aips %} - - - - - - - - - {% endfor %} - {% endif %} + + {% for aip in paging.items %} + + + + + + + + + {% endfor %}
Transfer namePreservation copies Action
{{ aip.transfer_name }}{{ aip.uuid }}{{ aip.create_date }}{{ aip.original_file_count }}{{ aip.preservation_file_count }}
{{ aip.transfer_name }}{{ aip.uuid }}{{ aip.create_date }}{{ aip.original_file_count }}{{ aip.preservation_file_count }}
{% else %} @@ -85,6 +83,29 @@ {% endif %} +{% if paging.total %} + +
+
+
+
Showing {{ first_item }} to {{ last_item }} of {{ paging.total }} entries
+
+
+ +
+
+
+ +{% endif %} +