LP#1507845: Improve search engine optimization
[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 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                     -%]
26                     <a class='[% class %]' href='[% href %]' 
27                         title='[% l("Previous page") %]'><span class="nav_arrow_fix">&#9668;</span> [% l('Previous') %] </a>
28                     [%- END;
29
30                         # show links to 4 previous pages, the current page, and 3 more pages.
31                         added = 0;
32                         pageitr = page - 5; 
33                         IF page_count > 1; # no need to paginate 1 page
34                     -%]
35                     <span class='results-paginator-list'>
36                     [%-
37                                 WHILE (pageitr = pageitr + 1) < page_count;
38                                     IF pageitr < 0; NEXT; END;
39                                     IF pageitr == page; %]
40                                         <span class='results-paginator-selected'>[% pageitr + 1%]</span>
41                                     [% ELSE %]
42                                         <a href="[% mkurl('', {page => pageitr}) %]">[% pageitr + 1%]</a>
43                                 [%  END;
44                                     added = added + 1;
45                                     IF added == 8; LAST; END;
46                                 END;
47                     -%]
48                     </span>
49                     [%- END;
50
51                         class = 'search_page_nav_link';
52                         href = '#';
53                         IF (page + 1) < page_count;
54                             href = mkurl('', {page => page + 1});
55                     -%]
56                     <a class='[% class %]' href='[% href %]' 
57                         title='[% l("Next page") %]'> [% l('Next') %] <span class="nav_arrow_fix">&#9658;</span></a>
58                     [%- END; -%]
59                 </span>
60     </span>
61 </div>
62 [% END %]
63