From: Bill Erickson Date: Thu, 11 Aug 2011 21:48:00 +0000 (-0400) Subject: Merge esi/template-toolkit-opac and repaired some conflicts X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=78ef0457cf7c21a148b590291484fb16340bb408;p=evergreen%2Fjoelewis.git Merge esi/template-toolkit-opac and repaired some conflicts Signed-off-by: Bill Erickson --- 78ef0457cf7c21a148b590291484fb16340bb408 diff --cc Open-ILS/src/templates/default/opac/parts/header.tt2 index f43d115a94,0000000000..66e47ac7c0 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/header.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/header.tt2 @@@ -1,23 -1,0 +1,69 @@@ +[%- USE money = format(l('$%.2f')); + USE date; + USE CGI = CGI_utf8; + USE POSIX; + SET DATE_FORMAT = l('%m/%d/%Y'); + + # Don't wrap in l() here; do that where this format string is actually used. + SET HUMAN_NAME_FORMAT = '[_1] [_2] [_3] [_4] [_5]'; + - # x and y are artifacts of using tags instead of - # true submit buttons, and their values are never used. page is used, but - # currently none of the use cases for rendering the query_string back - # into page output call for propagating the value of the page variable. ++ is_advanced = CGI.param("_adv").size; ++ is_special = CGI.param("_special").size; + - query_string = CGI.query_string | - replace(';x=\d+','') | replace(';y=\d+','') | replace(';page=\d*', '') | - replace(';', '&') | replace('&', '&'); ++ # ----------------------------------------------------------------------------- ++ # mkurl( destination_page, params_to_set, params_to_clear ) ++ # ++ # Current page, updated params: ++ # mkurl('', {foo => 'bar', boo => 'baz'}); ++ # ++ # New page, one param is a list: ++ # mkurl('http://flarg.baz/squz', {foo => 'bar', boo => ['baz', 'faz']}); ++ # ++ # New page, clear all existing params before applying new ones: ++ # mkurl('/fuz/buster', {foo => 'bar', boo => 'baz'}, 1); ++ # ++ # Current page, clear 'some_param' from the existing params: ++ # mkurl('', {foo => 'bar', boo => 'baz'}, ['some_param']); ++ MACRO mkurl(page, params, clear_params) BLOCK; + - propagator = '?' _ query_string; ++ # clone the query string to avoid clobberation ++ cgi = CGI.new(CGI.query_string); + - is_advanced = CGI.param("_adv").size; - is_special = CGI.param("_special").size; ++ # remove requested params ++ IF clear_params.0; # array ++ FOR p IN clear_params; cgi.delete(p); END; ++ ELSIF clear_params; ++ cgi.delete_all(); ++ END; ++ ++ # x and y are artifacts of using tags ++ # instead of true submit buttons, and their values are never used. ++ cgi.delete('x', 'y'); ++ ++ # apply user params ++ FOR k IN params.keys; ++ encoded = []; ++ list = params.$k.0 ? params.$k : [params.$k]; ++ # CGI croaks on already-decoded strings. force-encode to be safe. ++ FOR p IN list; encoded.push(ctx.encode_utf8(p)); END; ++ foo = cgi.param("-name", k, "-values", encoded); ++ END; ++ ++ # for url brevity, remove any params that have no value ++ FOR p IN cgi.param; ++ val = cgi.param(p); ++ IF val == ''; cgi.delete(p); END; ++ END; ++ ++ IF page; ++ IF cgi.query_string; ++ page _ '?' _ cgi.query_string; ++ ELSE; ++ page; ++ END; ++ ELSE; ++ # staying on the current page ++ cgi.url("-path" => 1, "-query" => 1); ++ END; ++ END; +%] diff --cc Open-ILS/src/templates/default/opac/parts/misc_util.tt2 index 8bbc57ce87,0000000000..457361e6f7 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/misc_util.tt2 @@@ -1,156 -1,0 +1,159 @@@ +[% + # Extract MARC fields from XML + # get_marc_attrs( { marc_xml => doc } ) + BLOCK get_marc_attrs; + xml = args.marc_xml; - args.isbn = xml.findnodes('//*[@tag="020"]/*[@code="a"]').shift.textContent; ++ args.isbns = []; ++ FOR isbn IN xml.findnodes('//*[@tag="020"]/*[@code="a"]'); ++ args.isbns.push(isbn.textContent); ++ END; + args.upc = xml.findnodes('//*[@tag="024"]/*[@code="a"]').textContent; + args.issn = xml.findnodes('//*[@tag="022"]/*[@code="a"]').textContent; + args.title = xml.findnodes('//*[@tag="245"]/*[@code="a"]').textContent; + args.author = xml.findnodes('//*[@tag="100"]/*[@code="a"]').textContent; + args.publisher = xml.findnodes('//*[@tag="260"]/*[@code="b"]').textContent; + args.pubdate = xml.findnodes('//*[@tag="260"]/*[@code="c"]').textContent; + args.summary = xml.findnodes('//*[@tag="520"]/*[@code="a"]').textContent; + args.edition = xml.findnodes('//*[@tag="250"]/*[@code="a"]').textContent || + xml.findnodes('//*[@tag="534"]/*[@code="b"]').textContent || + xml.findnodes('//*[@tag="775"]/*[@code="b"]').textContent; + phys = xml.findnodes( + '//*[@tag="300"]/*[@code="a" or @code="b" or @code="c" or @code="e"]' + ); + phys_content = []; + FOR p IN phys; phys_content.push(p.textContent); END; + args.phys_desc = phys_content.join(""); + + # MARC Callnumber + args.marc_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent; + + # clean up the ISBN - args.isbn_clean = args.isbn.replace('\ .*', ''); ++ args.isbn_clean = args.isbn.0.replace('\ .*', ''); + + args.holdings = []; + args.uris = []; + args.issns = []; + + # we use $9 of ISBN and ISSN as a flag for e-version + sfx_isbn = xml.findnodes('//*[@tag="020"]/*[@code="9"]'); + IF sfx_isbn; + IF sfx_isbn.textContent == "SFX"; + my_parent = sfx_isbn.parentNode(); + sfx_isbn = my_parent.findnodes('./*[@code="a"]'); + sfx_isbn.replace('-', ''); + args.resolver_isbn = sfx_isbn.replace('\ .*', ''); + END; + END; + + sfx_issn = xml.findnodes('//*[@tag="022"]/*[@code="9"]'); + IF sfx_issn; + IF sfx_issn.textContent == "SFX"; + my_parent = sfx_issn.parentNode(); + sfx_issn = my_parent.findnodes('./*[@code="a"]'); + args.issns.push( + sfx_issn.textContent.replace('[^\d\-X]', '') + ); + END; + END; + + # we snag all issns if no SFX available + IF args.issns.size == 0; + FOR rawissn IN xml.findnodes('//*[@tag="022"]/*[@code="a"]'); + args.issns.push( + rawissn.textContent.replace('[^\d\-X]', '') + ); + END; + END; + + FOR volume IN xml.findnodes('//*[local-name()="volumes"]/*[local-name()="volume"]'); + + # Check volume visibility - could push this into XPath + vol.label = volume.getAttribute('label'); + vol.id = volume.getAttribute('id'); + NEXT IF volume.getAttribute('opac_visible') == 'false'; + NEXT IF volume.getAttribute('deleted') == 'true'; + + IF vol.label == '##URI##'; + FOR uri IN volume.findnodes('./*[local-name()="uris"]/*[local-name()="uri"]'); + res.href = uri.getAttribute('href'); + res.link = uri.getAttribute('label'); + res.note = uri.getAttribute('use_restriction'); + args.uris.push(res); + END; + NEXT; + ELSE; + copies = volume.findnodes('./*[local-name()="copies"]/*[local-name()="copy"]'); + FOR copy IN copies; + # Check copy visibility + cp.deleted = copy.getAttribute('deleted'); + cp.visible = copy.getAttribute('opac_visible'); + NEXT IF (cp.deleted == 'true' OR cp.visible == 'false'); + + # Iterate through all of the children to determine visibility + FOR node IN cp.childNodes; + NEXT IF cp.visible == 'false'; + vis = node.getAttribute('opac_visible'); + del = node.getAttribute('deleted'); + IF vis == 'false' or del == 'true'; + cp.visible = 'false'; + END; + END; + + NEXT IF cp.visible == 'false'; + + loc = copy.findnodes('./*[local-name()="location"]'); + circlib = copy.findnodes('./*[local-name()="circlib"]'); + status = copy.findnodes('./*[local-name()="status"]'); + + holding = { + label => vol.label, + location => loc.textContent, + library => circlib.textContent, + status => status.textContent + barcode => copy.getAttribute('barcode') + }; + args.holdings.push(holding); + END; + END; + END; + + # Extract the copy count summary + count_type = (ctx.is_staff) ? 'staff' : 'public'; + xpath = '//*[local-name()="counts"]/*[local-name()="count"][@type="' _ count_type _ '"]'; + FOR node IN xml.findnodes(xpath); + args.copy_counts = {}; + FOR attr IN ['count', 'available', 'unshadow', 'transcendant']; + args.copy_counts.$attr = node.getAttribute(attr); + END; + END; + + # "mattype" == "custom marc format specifier" + FOR icon_style IN ['mattype', 'item_type']; + node = xml.findnodes( + '//*[local-name()="attributes"]/*[local-name()="field"][@name="' _ icon_style _ '"]'); + IF node AND node.textContent; + args.format_label = node.getAttribute('coded-value') + args.format_icon = ctx.media_prefix _ '/images/format_icons/' _ icon_style _ '/' _ node.textContent _ '.png'; + LAST; + END; + END; + END; + + BLOCK get_hold_status; + IF hold.hold.status == 4; + l("Available"); + IF ahr.shelf_expire_time; + l('
Expires [_1]', + date.format(ctx.parse_datetime(ahr.shelf_expire_time), DATE_FORMAT)); + END; + ELSIF hold.hold.estimated_wait AND hold.hold.estimated_wait > 0; + # estimated wait is delivered as seconds. + SET hwait = POSIX.ceil(hold.hold.estimated_wait / 86400); + l("Estimated wait: [quant,_1,day,days]", hwait); + ELSIF hold.hold.status == 3; + l("In Transit"); + ELSIF hold.hold.status < 3; + l("Waiting for copy"); + END; + END; +%] diff --cc Open-ILS/src/templates/default/opac/parts/record/cnbrowse.tt2 index d44c38d1ef,0000000000..83621b1d82 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/record/cnbrowse.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/record/cnbrowse.tt2 @@@ -1,60 -1,0 +1,58 @@@ - [%- IF ctx.page == "record"; - prev_next_root = "/record/" _ ctx.bre_id _ extras_propagator; - ELSE; - cn = CGI.param('cn') | uri; - prev_next_root = "/cnbrowse?cn=" _ cn; - END -%] ++[% cnoffset = CGI.param('cnoffset') || 0; %] ++ +
+
+
+ [% l("You are now browsing") %] + [% ctx.browsing_ou.name %] +
+ + + + + + + + + + [% tr_open = 0; FOR cn IN ctx.browsed_call_numbers %] + [%- IF loop.index % 3 == 0; tr_open = 1 %] + + [% END -%] + + [% IF loop.index % 3 == 2; tr_open = 0 %] + + [% END %] + [% END; IF tr_open %][% END %] + +
- [% - l("<< Previous Page") - %] ++ [% l("<< Previous Page") %] + [% l("Shelf Browser") %] - [% - l("Next Page >>") - %] ++ [% l("Next Page >>") %] +
+ [% rec_attrs = {marc_xml => cn.record.marc}; + PROCESS get_marc_attrs args=rec_attrs; + ident = rec_attrs.isbn_clean || rec_attrs.upc; + IF ident %] - + [% END %] +
[% cn.label %]
+ + [% IF rec_attrs.author %]
+ [% rec_attrs.author %] ++ href="[%- ++ authorquery = rec_attrs.author | replace('[,\.:;]', ''); ++ mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, 1) ++ -%]">[% rec_attrs.author | html_entity %] +
[% END %] +
[% cn.owning_lib.name %]
+
+
+
diff --cc Open-ILS/src/templates/default/opac/parts/record/extras.tt2 index c53ce31668,0000000000..a800317f70 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/record/extras.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/record/extras.tt2 @@@ -1,75 -1,0 +1,65 @@@ +
+
+ + [% # Hidden extras are not yet implemented. Some may require JS + + # Let's see if we should hide the content cafe / simple summary content + hide_summary = 1; - IF attrs.summary; hide_summary = 0; ELSE; ++ IF attrs.summary.0; hide_summary = 0; ELSE; + # Expose content cafe if it's reasonable to do so. + # This approach only works when using embedded content cafe. + IF ENV.OILS_CONTENT_CAFE_USER; + ident = attrs.isbn_clean || attrs.upc; + IF ident; hide_summary = 0; END; + END; + END; + + extras = [ + {name => 'summaryplus', label => l('Summaries & More'), hide => hide_summary}, + {name => 'content', label => l('Contents'), hide => 1}, # ToC + {name => 'authors', label => l('Authors')}, - {name => 'series', label => l('Series'), hide => 1}, ++ {name => 'series', label => l('Series')}, + {name => 'subjects', label => l('Subject')}, + {name => 'annotation', label => l('Annotation'), hide => 1}, + {name => 'awards', label => l('Awards, Reviews, & Suggested Reads')}, + {name => 'excerpt', label => l('Excerpt'), hide => 1}, + {name => 'issues', label => l('Issues Held'), hide => !ctx.have_holdings_to_show}, + {name => 'preview', label => l('Preview'), hide => 1}, + {name => 'cnbrowse', label => l('Shelf Browser')}, + {name => 'copyinfo', label => l('Copy Summary'), hide => 1}, + {name => 'marchtml', label => l('MARC Record')} + ]; + + FOREACH extra IN extras; + IF extra.hide; NEXT; END; + name = extra.name; + %] +
+
+ +
+
+ [% exp_name = 'expand_' _ name; - IF ctx.$exp_name; ++ IF ctx.$exp_name OR ctx.expand_all; + IF name == 'marchtml'; + ctx.marchtml; + ELSE; + # Load the template for the selected extra + INCLUDE "default/opac/parts/record/${name}.tt2"; + END; + END; + %] +
+ [% END %] +
+ +
diff --cc Open-ILS/src/templates/default/opac/parts/record/subjects.tt2 index 7819187e8b,0000000000..3d022313fb mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/record/subjects.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/record/subjects.tt2 @@@ -1,67 -1,0 +1,70 @@@ +[% + subjects = [ + { ++ label => l('Subject: '), ++ xpath => '//*[@tag="600" or @tag="610" or @tag="611" or @tag="630" or @tag="650" or @tag="651"]' ++ }, { + label => l('Genre: '), + xpath => '//*[@tag="655"]|//*[@tag="659"]' + }, { + label => l('Topic Heading: '), + xpath => '//*[@tag="690"]' + }, { + label => l('Geographic Setting: '), + xpath => '//*[@tag="691"]' + }, { + label => l('Biographical Subject: '), + xpath => '//*[@tag="692"]' + }, { + label => l('Character Attributes: '), + xpath => '//*[@tag="693"]' + }, { + label => l('Setting: '), + xpath => '//*[@tag="698"]' + }, { + label => l('Time Period: '), + xpath => '//*[@tag="699"]' + } + ]; + + BLOCK render_subject; + loc = CGI.param('loc') | uri; + xpath = xpath || '//*[starts-with(@tag,"6")]'; + FOR node IN ctx.marc_xml.findnodes(xpath); + all_terms = []; + FOR subfield IN node.childNodes; + NEXT UNLESS subfield.nodeName == "subfield"; + code = subfield.getAttribute('code'); + NEXT UNLESS code.match('[a-z]'); + IF code.match('[vxyz]'); " — "; END; + # at this point, we actually have a partial term to use. + single_term = subfield.textContent | html; + all_terms.push(subfield.textContent); + total_term = all_terms.join(" ").replace('\s+$', '') | uri; + '' _ single_term _ ''; + END; + IF all_terms.size; "
"; END; + END; + END +%] + +
+ + [% any_subjects = 0; + FOREACH subj IN subjects; + content = PROCESS render_subject(xpath=subj.xpath); + IF content.match('\S'); + any_subjects = 1; %] + + + + + [% END; %] + [% END; %] + [% IF any_subjects == 0 %] + + [% END; %] +
+ [% subj.label %] +
[% content %]
[% l('No Subjects') %]
+
diff --cc Open-ILS/src/templates/default/opac/parts/record/summary.tt2 index d97f0fdc12,0000000000..53c22d2e95 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/record/summary.tt2 @@@ -1,288 -1,0 +1,270 @@@ +[% PROCESS "default/opac/parts/misc_util.tt2"; + USE ResolverResolver; + ctx.page_title = attrs.title | html_entity +%] + + + +[% IF ctx.refworks.enable == 'true' %] + [% INCLUDE 'default/opac/parts/record/refworks.tt2' %] +[% END %] + + + + + + + + + + + +
+ [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] + [% l('Image of item') %] + [% END %] +
+
+ + + + + +
- [% attrs.title %]
++ [% attrs.title_extended | html_entity %]
+ [% IF attrs.author %] + [% l("Author") %]: + [% attrs.author %] ++ href="[%- ++ authorquery = attrs.author | replace('[,\.:;]', ''); ++ mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}) ++ -%]">[% attrs.author | html_entity %] + [% END %] +
+
+
+ +
+ [% + operation = ctx.mylist.grep(ctx.bre_id).size ? "delete" : "add"; + label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); + %] + + + [% label %] + +
+
+
+ [% IF attrs.format_icon %] + [% attrs.format_label %] + [% END %] +
+
+
+
+ + + ++ - + + + + [% IF openurl.enabled == 'true'; + FOR issn IN args.issns; + sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl); + FOR res IN sfx; + %] + + + + + [% END %] + [% END %] + [% END %] + + ++ ++ + + + + + + + + +
- [% IF attrs.isbn %][% l("ISBN") %][% END %] ++ [% IF attrs.isbns.0 %][% l("ISBN") %][% END %] ++ ++ [% FOR isbn IN attrs.isbns %][% IF !loop.first; %]
[% END; isbn; END %] +
[% attrs.isbn %] + [% IF attrs.phys_desc %][% l("Physical Description") %][% END %] + [% attrs.phys_desc %]
+ + [% res.public_name %] + [% res.target_coverage %]
++ [% IF attrs.marc_cn; l("Call Number"); END %] ++ [% attrs.marc_cn %] + [% IF attrs.edition; l("Edition"); END %] + [% attrs.edition %]
+ [% IF attrs.publisher; l("Publisher"); END %] + [% attrs.publisher %] + [% IF attrs.pubdate; l("Publication Date"); END %] + [% attrs.pubdate %]
+ + +
+
+ [% l("[quant,_1,Hold,Holds] with [quant,_2,total copy,total copies]", + ctx.record_hold_count, ctx.copy_summary.0.count) %] +
+
[% l('[quant,_1,Copy,Copies] available', ctx.copy_summary.0.available) %]
+
+ +
+
+
+ +[% FOR uri IN args.uris %] +
+ [% uri.link %][% ' - ' _ uri.note IF uri.note %] +
+[% END %] + +
+ + + + + + + + + [% IF ctx.is_staff %] + + + + [% END %] + + + + + + [% last_cn = 0; + FOR copy_info IN ctx.copies; + NEXT IF copy_info.call_number_label == '##URI##' %] + + + + + + [% IF ctx.is_staff %] + + + + [% END %] + + + + [% END %] + + [% IF ctx.copy_offset > 0; + new_offset = ctx.copy_offset - ctx.copy_limit; + IF new_offset < 0; new_offset = 0; END %] + + [% END %] + [% IF ctx.copies.size >= ctx.copy_limit %] + + [% END %] + ++ ++ ++ ++ ++ ++ ++ + +
[% l("Location") %][% l("Call Number") %][% l("Barcode") %][% l("Shelving Location") %][% l("Age Hold Protection") %][% l("Create Date") %][% l("Holdable?") %][% l("Status") %][% l("Due Date") %]
[% + # XXX KCLS-specific kludging + org_name = ctx.get_aou(copy_info.circ_lib).name; + dir = org_name | lower | replace('[^\w]', '') | + replace('.+320th', '320th'); %] + [% org_name %] + [% copy_info.call_number_label %][% copy_info.barcode %][% copy_info.copy_location %] + [% copy_info.age_protect ? + ctx.get_crahp(copy_info.age_protect).name : l('None') %] + [% date.format( + ctx.parse_datetime(copy_info.create_date), + DATE_FORMAT + ) %][% # Show copy/volume hold links to staff (without + # checking whether they have permissions to do those). + overall_holdable = (copy_info.holdable == 't' AND + copy_info.location_holdable == 't' AND + copy_info.status_holdable == 't'); + IF overall_holdable; + l("Place on"); %] - [% l("copy") %] ++ [% l("copy") %] + [% IF copy_info.call_number != last_cn; + last_cn = copy_info.call_number; + l(" / "); %] - [% l("volume") %] ++ [% l("volume") %] + [% END; + ELSE; + l("No"); + END %][% copy_info.copy_status %][% + IF copy_info.due_date; + date.format( + ctx.parse_datetime(copy_info.due_date), + DATE_FORMAT + ); + ELSE; + '-'; + END %]
- « [% - l('Previous [_1]', ctx.copy_offset - new_offset) - %] ++ « [% ++ l('Previous [_1]', ctx.copy_offset - new_offset) %] + - [% - l('Next [_1]', ctx.copy_limit) - %] » ++ [% ++ l('Next [_1]', ctx.copy_limit) %] » +
++ [% more_copies_limit = 50 %] [%# TODO: config %] ++ [% IF ctx.copy_limit != more_copies_limit AND ctx.copies.size >= ctx.copy_limit %] ++ ++ [% ELSIF ctx.copy_limit == more_copies_limit %] ++ ++ [% END %] ++
++ [% IF CGI.param('expand') == 'all' %] ++ ++ [% l('Collapse all tabs') %] ++ [% ELSE %] ++ ++ [% l('Expand all tabs') %] ++ [% END %] ++
+ - - - - + + + - -
- - - - - - - - - - - - - -
- - - - - - -
-
- [% l("Title") %]: -
-
- [% l('Place Hold') %] - [% l('Reviews and More') %] - [% l('Add to My List') %] -
-
-
-
- - diff --cc Open-ILS/src/templates/default/opac/parts/record/summaryplus.tt2 index 6fb3d53d19,0000000000..4b7552fbe0 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/record/summaryplus.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/record/summaryplus.tt2 @@@ -1,15 -1,0 +1,19 @@@ +
+ [% IF attrs.summary %] +
- [% l('Summary: ') %][% attrs.summary %] ++ [% l('Summary: ') %] ++ [% FOR sum IN attrs.summary %] ++ [% IF !loop.first; '
'; END %] ++ [% sum %] ++ [% END %] +
+ [% END %] + + + [% ident = attrs.isbn_clean || attrs.upc %] + +
+ diff --cc Open-ILS/src/templates/default/opac/parts/result/table.tt2 index 4c8898fad9,0000000000..0d20b9aa12 mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/default/opac/parts/result/table.tt2 @@@ -1,282 -1,0 +1,275 @@@ +[% PROCESS "default/opac/parts/misc_util.tt2"; + + USE ResolverResolver; + + 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; +%] + +
+[% 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 = propagator _ '&page=' _ (page - 1); ++ href = mkurl('', {page => page - 1}); + ELSE; class = class _ ' invisible'; END; + %] + [% l('Previous') %] + + + + [% class = 'search_page_nav_link'; + href = '#'; + IF (page + 1) < page_count; - href = propagator _ '&page=' _ (page + 1); ++ href = mkurl('', {page => page + 1}); + ELSE; class = class _ ' invisible'; END; + %] + [% l('Next') %] + +
+
+[% END %] +[% ctx.results_count_header = PROCESS results_count_header; + ctx.results_count_header %] +
+ + + + + + +
+
SIDEBAR TODO +
+
+ + + [% FOR rec IN ctx.records; + attrs = {marc_xml => rec.marc_xml}; + PROCESS get_marc_attrs args=attrs %] + + + + [% END %] + +
+ + + + + + + + + + + + + + + +
[% + result_count; result_count = result_count + 1 + %]. + [% ident = attrs.isbn_clean || attrs.upc; IF ident; %] - [% l('Image of item') %][% l('Image of item') %]
+ [% END %] +
+
+ [% attrs.title %] ++ href="[% mkurl(ctx.opac_root _ '/record/' _ rec.id) %]" ++ class='search_link'>[% attrs.title | html_entity%] +
+
+
+ [% attrs.author %] ++ href="[%- ++ authorquery = attrs.author | replace('[,\.:;]', ''); ++ mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}) ++ -%]">[% attrs.author | html_entity %] +    + [% attrs.pubdate %] +
+ + [% IF attrs.publisher %] + + + + + [% END %] - [% IF attrs.isbn %] ++ [% IF attrs.isbn.0 %] + + - ++ + + [% END %] + [% IF openurl.enabled == 'true'; + FOR issn IN args.issns; + sfx = ResolverResolver.resolve_issn(issn, openurl.baseurl); + FOR res IN sfx; + %] + + + + + [% END %] + [% END %] + [% END %] + + [% IF attrs.edition %] + + + + + [% END %] + [% IF attrs.phys_desc %] + + + + + [% END %] + [% FOR uri IN args.uris %] + + + + + [% END %] + [% IF args.holdings.size > 0 %] + + + + [% END %] +
+ [% l('Publisher:') %] + [% attrs.publisher; %]
+ [% l('ISBN:') %] + [% attrs.isbn %][% attrs.isbns.0 %]
+ + [% res.public_name %] + [% res.target_coverage %]
+ [% l('Edition:') %] + [% attrs.edition %]
+ [% l('Phys. Desc.:') %] + + [% args.phys_desc %] +
+ [% l('Electronic resource') %] + [% uri.link %][% ' - ' _ uri.note IF uri.note %]
+ + + + + + + + + [% FOR copy IN args.holdings %] + + + + + + + [% END %] + +
[% l('Library') %][% l('Shelving location') %][% l('Call number') %][% l('Status') %]
[% copy.library %][% copy.location %][% copy.label %][% copy.status %]
+
+
+ [% l('[_1] of [quant,_2,copy,copies] available', + attrs.copy_counts.available, attrs.copy_counts.count) # XXX s/count/nshadow/ ? + #rec.copy_counts.available, rec.copy_counts.visible) + %] +
+
+
+ + + | + | + + + +
+
+ + [% IF attrs.format_icon %] + [% attrs.format_label %] + [% END %] + + + + + + + [% l("Browse in Google Books Search") %] + + + +
+
+ +
+ [% + operation = ctx.mylist.grep(rec.id).size ? "delete" : "add"; + label = (operation == "add") ? l("Add to my list") : l("Remove from my list"); + %] - ++ + + [% label %] + +
- +
+
+
+ + +
+ +
+
+
+
+
+ [% ctx.results_count_header %] - +
diff --cc Open-ILS/src/templates/default/vandelay/inc/import_errors.tt2 index 5554f0006c,0000000000..588260e86f mode 100644,000000..100644 --- a/Open-ILS/src/templates/default/vandelay/inc/import_errors.tt2 +++ b/Open-ILS/src/templates/default/vandelay/inc/import_errors.tt2 @@@ -1,77 -1,0 +1,81 @@@ + +
+ +
+ +
+ +
+ +
+ +
+
+ +
+