<meta http-equiv="refresh" content="[% ctx.authtime %]; url=[% ctx.logout_page %]">
[% END %]
<title>[% l('Catalog - [_1]', ctx.page_title) %]</title>
+ <meta name="viewport" content="format-detection=no,initial-scale=1.0,maximum-scale=1.0,user-scalable=0,width=device-width" />
+ <style type='text/css'>
+ .hidden { visibility: hidden }
+ .results_paginate { margin: 8px }
+ .results_table { width: 100%; border-collapse: collapse;}
+ .results_table td { padding-bottom: 10px; vertical-align: bottom}
+ .results_table tr:nth-child(odd) td { background: #E0E0E0; border:1px solid #333;}
+ .results_table tr:nth-child(even) td { border:1px solid #CCC; border-bottom: none; }
+ .results_paginate_summary { margin-bottom: 10px; }
+ .results_paginate_links { margin-bottom: 10px; padding-bottom: 10px; border-bottom: 2px dashed #333;}
+ .results_pictd { width:55px; border: none;}
+ </style>
</head>
<body>
[% content %]
--- /dev/null
+[% BLOCK results_paginate;
+
+ page = CGI.param('page');
+ page = page.match('^\d+$') ? page : 0; # verify page is a sane value
+ page_count = ctx.page_size == 0 ? 1 : POSIX.ceil(ctx.hit_count / ctx.page_size);
+ ctx.result_start = 1 + ctx.page_size * page;
+ ctx.result_stop = ctx.page_size * (page + 1);
+ IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
+ result_count = ctx.result_start;
+%]
+
+<div class='results_paginate'>
+ <div class='results_paginate_summary'>
+ [% |l(ctx.result_start, ctx.result_stop, ctx.hit_count) %]
+ Results <strong>[_1]</strong> - <strong>[_2]</strong> of <strong>[_3]</strong>
+ [% END %]
+ <span style='padding-left: 6px;'>
+ [% |l(page + 1, page_count) %](page <strong>[_1]</strong> of <strong>[_2]</strong>)[% END %]
+ </span>
+ </div>
+ <div class='results_paginate_links'>
+ <span>
+
+ [% class = '';
+ href = '#';
+ IF page > 0;
+ href = mkurl('', {page => page - 1});
+ ELSE; class = class _ 'invisible'; END;
+ %]
+ <a class='[% class %]' href='[% href %]'
+ title='[% l("Previous page") %]'><span><--</span> [% l('Previous') %] </a>
+
+ <span style='padding-left: 11px; padding-right:11px;'>
+ [% # show links to 4 previous pages, the current page, and 3 more pages.
+ added = 0;
+ pageitr = page - 5;
+ IF page_count > 1; # no need to paginate 1 page
+ WHILE (pageitr = pageitr + 1) < page_count;
+ IF pageitr < 0; NEXT; END;
+ IF pageitr == page; %]
+ <span>[% pageitr + 1%]</span>
+ [% ELSE %]
+ <a href="[% mkurl('', {page => pageitr}) %]">[% pageitr + 1%]</a>
+ [% END;
+ added = added + 1;
+ IF added == 8; LAST; END;
+ END;
+ END;
+ %]
+ </span>
+
+ [% class = '';
+ href = '#';
+ IF (page + 1) < page_count;
+ href = mkurl('', {page => page + 1});
+ ELSE; class = class _ ' invisible'; END;
+ %]
+ <a class='[% class %]' href='[% href %]'
+ title='[% l("Next page") %]'> [% l('Next') %] <span>--></span></a>
+ </span>
+ </div>
+</div>
+[% END %]
-[% PROCESS "opac/parts/header.tt2";
- WRAPPER "beanstalk/base.tt2";
- PROCESS "opac/parts/misc_util.tt2";
-
+[% PROCESS 'opac/parts/header.tt2';
+ WRAPPER 'beanstalk/base.tt2';
+ PROCESS 'opac/parts/misc_util.tt2';
+ PROCESS 'beanstalk/paginate.tt2';
ctx.page_title = l("Search Results: ") _ CGI.param('query') | html;
- page = CGI.param('page');
- page = page.match('^\d+$') ? page : 0; # verify page is a sane value
-
- page_count = ctx.page_size == 0 ? 1 : POSIX.ceil(ctx.hit_count / ctx.page_size);
- ctx.result_start = 1 + ctx.page_size * page;
- ctx.result_stop = ctx.page_size * (page + 1);
- IF ctx.result_stop > ctx.hit_count; ctx.result_stop = ctx.hit_count; END;
- result_count = ctx.result_start;
-
%]
-<table>
+[% PROCESS results_paginate %]
+
+<table class='results_table'>
[% FOR rec IN ctx.records;
attrs = {marc_xml => rec.marc_xml};
- PROCESS get_marc_attrs args=attrs;
- IF CGI.param('detail_record_view');
- attrs.title = attrs.title_extended;
- END
- -%]
+ PROCESS get_marc_attrs args=attrs %]
<tr class="result_table_row">
+ <td class='results_pictd'>
+ [% ident = attrs.isbn_clean || attrs.upc; IF ident; %]
+ <a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"><img alt="[% l('Image') %]"
+ width="55" src='[% ctx.media_prefix %]/opac/extras/ac/jacket/small/[% ident | uri %]' /></a><br />
+ [% END %]
+ </td>
<td>
+ [% title = attrs.title;
+ IF title AND title.length > 60;
+ title = title.substr(60, title.length, '...');
+ END
+ %]
<a href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]"
- [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]
- >[% attrs.title | html %]</a>
+ [% HTML.attributes(title => l('Display record details for "[_1]"', attrs.title)) %]>[% title | html %]</a>
+
+ <div style='padding-left: 15px;'>
+ <div>
+ <a title="[% l("Perform an Author Search") %]"
+ href="[%-
+ authorquery = attrs.author | replace('[,\.:;]', '');
+ mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page'])
+ -%]">[% attrs.author | html %]</a>
+ </div>
+ <div>[% args.phys_desc | html %]</div>
+ </div>
</td>
</tr>
-[% END %]
+ [% END %]
+
</table>
+[% PROCESS results_paginate %]
+
[% END %]