From c70bde9b34bf0f844c6fa6c8d0d5878dfcd43baf Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Thu, 25 Aug 2022 17:44:13 +0000 Subject: [PATCH] LP1422927 Opac hold history pagination Fixes the hold history pagination in both the TPac and the Bootstrap opac. To test: 1. Login as a patron and enable the hold history preference. The default number of items on each page is 15, so place at least 16 holds for this patron. (The limit can be overridden in the url with the &limit switch). 2. View the hold history and notice that all items are displaying on all pages. 3. Apply the patch 4. The results are now paginated with 15 items per page. Signed-off-by: Garry Collum Signed-off-by: Terran McCanna Signed-off-by: Michele Morgan --- Open-ILS/src/templates-bootstrap/opac/myopac/hold_history.tt2 | 7 ++++++- Open-ILS/src/templates/opac/myopac/hold_history.tt2 | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/hold_history.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/hold_history.tt2 index ff0b543b7e..fdd6947429 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/hold_history.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/hold_history.tt2 @@ -47,6 +47,11 @@ [% l('No holds found.') %] [% ELSE %] + [% hold_items = ctx.holds; + hi = offset + limit - 1; + hi = hi > hold_items.max ? hold_items.max : hi; + hold_items = hold_items.slice(offset, hi); + %] @@ -59,7 +64,7 @@ - [% FOR hold IN ctx.holds; + [% FOR hold IN hold_items; attrs = {marc_xml => hold.marc_xml}; PROCESS get_marc_attrs args=attrs; ahr = hold.hold.hold %] diff --git a/Open-ILS/src/templates/opac/myopac/hold_history.tt2 b/Open-ILS/src/templates/opac/myopac/hold_history.tt2 index cf8af4c798..8b4bfa28eb 100644 --- a/Open-ILS/src/templates/opac/myopac/hold_history.tt2 +++ b/Open-ILS/src/templates/opac/myopac/hold_history.tt2 @@ -70,6 +70,11 @@ [% l('No holds found.') %] [% ELSE %] + [% hold_items = ctx.holds; + hi = offset + limit - 1; + hi = hi > hold_items.max ? hold_items.max : hi; + hold_items = hold_items.slice(offset, hi); + %]
@@ -81,7 +86,7 @@ - [% FOR hold IN ctx.holds; + [% FOR hold IN hold_items; attrs = {marc_xml => hold.marc_xml}; PROCESS get_marc_attrs args=attrs; ahr = hold.hold.hold %] -- 2.11.0