From: Bill Erickson Date: Mon, 15 Aug 2011 18:56:50 +0000 (-0400) Subject: TTPac: move results pageing chunk to new template X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=60af82af2ce56af6210c5daa9acd116b87395a80;p=contrib%2FConifer.git TTPac: move results pageing chunk to new template table.tt2 and paging are complex enough and will likely result in much local customization. Break them up into 2 page to simplify. 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 new file mode 100644 index 0000000000..521776e5bd --- /dev/null +++ b/Open-ILS/web/templates/default/opac/parts/result/paginate.tt2 @@ -0,0 +1,57 @@ +[% BLOCK results_count_header %] +
+ + + + + + +
[% l('Search Results') %] + [% |l(ctx.result_start, ctx.result_stop, ctx.hit_count) %] + Results [_1] - [_2] of [_3] + [% END %] + + [% |l(page + 1, page_count) %](page [_1] of [_2])[% END %] + + + + + [% class = 'search_page_nav_link'; + href = '#'; + IF page > 0; + href = mkurl('', {page => page - 1}); + ELSE; class = class _ ' invisible'; END; + %] + [% 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; + href = mkurl('', {page => page + 1}); + ELSE; class = class _ ' invisible'; END; + %] + [% l('Next') %] + +
+
+[% END %] + 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 6abafabbe8..955f68ca11 100644 --- a/Open-ILS/web/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/result/table.tt2 @@ -7,64 +7,11 @@ result_count = ctx.result_start; %]
-[% BLOCK results_count_header %] -
- - - - - - -
[% l('Search Results') %] - [% |l(ctx.result_start, ctx.result_stop, ctx.hit_count) %] - Results [_1] - [_2] of [_3] - [% END %] - - [% |l(page + 1, page_count) %](page [_1] of [_2])[% END %] - - - - - [% class = 'search_page_nav_link'; - href = '#'; - IF page > 0; - href = mkurl('', {page => page - 1}); - ELSE; class = class _ ' invisible'; END; - %] - [% 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; - href = mkurl('', {page => page + 1}); - ELSE; class = class _ ' invisible'; END; - %] - [% l('Next') %] - -
-
-[% END %] +[% PROCESS "default/opac/parts/result/paginate.tt2" %] [% ctx.results_count_header = PROCESS results_count_header; ctx.results_count_header %] +
@@ -226,7 +173,7 @@
- +