From: Bill Erickson Date: Tue, 16 Aug 2011 12:24:38 +0000 (-0400) Subject: TTPac: Hide pagination for 1-page hits X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bf6ebc61b5573667d6e8c42d5362c710732bc66d;p=contrib%2FConifer.git TTPac: Hide pagination for 1-page hits Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/web/templates/default/opac/parts/result/paginate.tt2 b/Open-ILS/web/templates/default/opac/parts/result/paginate.tt2 index 521776e5bd..6582c01bb8 100644 --- a/Open-ILS/web/templates/default/opac/parts/result/paginate.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/result/paginate.tt2 @@ -27,15 +27,17 @@ [% # show links to 4 previous pages, the current page, and 3 more pages. added = 0; pageitr = page - 5; - WHILE (pageitr = pageitr + 1) < page_count; - IF pageitr < 0; NEXT; END; - IF pageitr == page; %] - [% pageitr + 1%] - [% ELSE %] - [% pageitr + 1%] - [% END; - added = added + 1; - IF added == 8; LAST; END; + IF page_count > 1; # no need to paginate 1 page + WHILE (pageitr = pageitr + 1) < page_count; + IF pageitr < 0; NEXT; END; + IF pageitr == page; %] + [% pageitr + 1%] + [% ELSE %] + [% pageitr + 1%] + [% END; + added = added + 1; + IF added == 8; LAST; END; + END; END; %]