066cd8c3e78c4a7ac6851ef68b12046390969e61
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / result / paginate.tt2
1 [% BLOCK results_count_header %]
2 <div class="results_header_nav1">
3     <span class="h1">[% ctx.bookbag ? l('List Contents') : l('Search Results') %]</span>
4     <span nowrap="nowrap" class="result_number">
5                 [%~ |l('<span class="result_count_number">' _ ctx.result_start _'</span>',
6                 '<span class="result_count_number">' _ ctx.result_stop _ '</span>',
7                 '<span class="result_count_number">' _ ctx.hit_count _ '</span>')  ~%]
8                 Results [_1] - [_2] of about [_3]
9                 [%~ END %]
10                 <span style='padding-left: 6px;'>
11                     [%~ |l('<span class="result_count_number">' _ (page + 1) _ '</span>',
12                     '<span class="result_count_number">' _ page_count _ '</span>') ~%]
13                     (page [_1] of [_2])
14                     [%~ END %]
15                 </span>
16     </span>
17     [%- INCLUDE "opac/parts/pref_lib_display.tt2" %]
18     <span>
19                 <span class='start_end_links_span'>
20
21                     [%  class = 'search_page_nav_link';
22                         href = '#';
23                         IF page > 0;
24                             href = mkurl('', {page => page - 1});
25                         ELSE; class = class _ ' invisible'; END;
26                     %]
27                     <a class='[% class %]' href='[% href %]' 
28                         title='[% l("Previous page") %]'><span class="nav_arrow_fix">&#9668;</span> [% l('Previous') %] </a>
29
30                     <span style='padding-left: 11px; padding-right:11px;'>
31                         [%  # show links to 4 previous pages, the current page, and 3 more pages.
32                             added = 0;
33                             pageitr = page - 5; 
34                             IF page_count > 1; # no need to paginate 1 page
35                                 WHILE (pageitr = pageitr + 1) < page_count;
36                                     IF pageitr < 0; NEXT; END;
37                                     IF pageitr == page; %]
38                                         <span class='results-paginator-selected'>[% pageitr + 1%]</span>
39                                     [% ELSE %]
40                                         <a href="[% mkurl('', {page => pageitr}) %]">[% pageitr + 1%]</a>
41                                 [%  END;
42                                     added = added + 1;
43                                     IF added == 8; LAST; END;
44                                 END;
45                             END;
46                         %]
47                     </span>
48
49                     [%  class = 'search_page_nav_link';
50                         href = '#';
51                         IF (page + 1) < page_count;
52                             href = mkurl('', {page => page + 1});
53                         ELSE; class = class _ ' invisible'; END;
54                     %]
55                     <a class='[% class %]' href='[% href %]' 
56                         title='[% l("Next page") %]'> [% l('Next') %] <span class="nav_arrow_fix">&#9658;</span></a>
57                 </span>
58     </span>
59 </div>
60 [% END %]
61