From d9d36ec6b8ab9f5bfffaad4babc6025f93508aca Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 15 Aug 2011 14:42:45 -0400 Subject: [PATCH] TTpac: show page range in results paging display Signed-off-by: Bill Erickson --- Open-ILS/web/css/skin/default/opac/style.css | 2 ++ .../templates/default/opac/parts/result/table.tt2 | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/css/skin/default/opac/style.css b/Open-ILS/web/css/skin/default/opac/style.css index a58c132de6..b1665072a8 100644 --- a/Open-ILS/web/css/skin/default/opac/style.css +++ b/Open-ILS/web/css/skin/default/opac/style.css @@ -1020,3 +1020,5 @@ a.dash-link:hover { text-decoration: underline !important; } padding-bottom: 1ex; } .cn_browse_item { padding: 2ex; } + +.results-paginator-selected { color: red; } diff --git a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 index 78e606e38e..6abafabbe8 100644 --- a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 @@ -22,6 +22,7 @@ + [% class = 'search_page_nav_link'; href = '#'; IF page > 0; @@ -30,10 +31,24 @@ %] [% l('Previous') %] - - + + + [% # 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; + END; + %] + [% class = 'search_page_nav_link'; href = '#'; IF (page + 1) < page_count; -- 2.11.0