From c2e0686ef3f1501d4ceafd304d54163a4402ad60 Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Thu, 18 Feb 2021 19:37:35 -0500 Subject: [PATCH] LP1916085 Bootstrap OPAC - Pagination on copy table This adjusts some of the display logic in the Bootstrap OPAC copy table pagination that had been causing the Next / Prev and Show Fewer Copies links to be hidden when they shouldn't be. Signed-off-by: Terran McCanna Signed-off-by: Jason Etheridge --- .../opac/parts/record/copy_table.tt2 | 35 +++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 index 130d8aa028..034760c302 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/copy_table.tt2 @@ -288,12 +288,9 @@ END; # FOREACH bib [%- END; # FOR copy_info %] - [%- IF ctx.copy_offset > 0 AND NOT serial_holdings; - new_offset = ctx.copy_offset - ctx.copy_limit; - IF new_offset < 0; new_offset = 0; END %] - [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings AND (ctx.copy_offset + ctx.copy_limit < total_copies) %] + [% IF ctx.copy_limit < total_copies AND NOT serial_holdings %] - [%- IF ctx.copy_offset > 0 AND NOT serial_holdings; + [%- IF ctx.copy_offset > 0; new_offset = ctx.copy_offset - ctx.copy_limit; IF new_offset < 0; new_offset = 0; END %] @@ -301,31 +298,35 @@ END; # FOREACH bib l('Previous [_1]', ctx.copy_offset - new_offset) %] [%- END %] - [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings AND (ctx.copy_offset + ctx.copy_limit < total_copies) %] + [%- IF copies.size >= ctx.copy_limit AND (ctx.copy_offset + ctx.copy_limit < total_copies) %] [% l('Next [_1]', ctx.copy_limit) %] » [%- END %] - [%- END %] - [%- END %] - [% IF NOT serial_holdings && ctx.copy_limit < total_copies -%] - - - [%- more_copies_limit = 50 %] [%# TODO: config %] - [%- IF ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %] + [% END %] + + [% IF NOT serial_holdings -%] + [%- more_copies_limit = 50 %] [%# TODO: config %] + [%- IF ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %] + + - [%- ELSIF ctx.copy_limit == more_copies_limit %] + + + [%- ELSIF ctx.copy_limit == more_copies_limit %] + + - [%- END %] - - + + [%- END %] + [%- END %] [% END %] -- 2.11.0