From: Dan Scott Date: Wed, 12 Sep 2012 15:50:03 +0000 (-0400) Subject: TPAC: Display full publication info X-Git-Url: http://git.equinoxoli.org/?p=transitory.git;a=commitdiff_plain;h=a259f3edafa118f7cd55d4997138e7da6f668db3 TPAC: Display full publication info In both the results table and record summary, we were failing to display the place of publication - which is critical information for people trying to track down the right edition or constructing a bibliography. Grab the place of publication, and then reconstruct 260abc (avoiding another XPath iteration and giving ourselves the ability to enhance the schema.org microdata at the same time). Signed-off-by: Dan Scott Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2 index 1a393c7..67805ac 100644 --- a/Open-ILS/src/templates/opac/parts/misc_util.tt2 +++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2 @@ -47,6 +47,12 @@ FOR sub IN titsubs; titsubs_content.push(sub.textContent); END; args.title_extended = titsubs_content.join(" "); + args.pubplaces = []; + FOR sub IN xml.findnodes('//*[@tag="260"]/*[@code="a"]'); + args.pubplaces.push(sub.textContent); + END; + args.pubplace = (args.pubplaces.size) ? args.pubplaces.0 : ''; + args.publishers = []; FOR sub IN xml.findnodes('//*[@tag="260"]/*[@code="b"]'); args.publishers.push(sub.textContent); @@ -59,6 +65,9 @@ END; args.pubdate = (args.pubdates.size) ? args.pubdates.0 : ''; + # Full publisher info + args.pubinfo = "$args.pubplace $args.publisher $args.pubdate"; + args.summaries = []; FOR sub IN xml.findnodes('//*[@tag="520"]/*[@code="a"]'); args.summaries.push(sub.textContent); diff --git a/Open-ILS/src/templates/opac/parts/record/summary.tt2 b/Open-ILS/src/templates/opac/parts/record/summary.tt2 index 868a7dd..b750df6 100644 --- a/Open-ILS/src/templates/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates/opac/parts/record/summary.tt2 @@ -151,12 +151,15 @@ IF num_uris > 0; [%- IF attrs.publisher %]
  • [% l("Publisher:") %] - [% - attrs.publisher | html; - %] - [% IF attrs.pubdate; %] - - [% END; %] + + [%- IF attrs.pubplace; %] + [% attrs.pubplace | html; %] + [%- END; %] + [% attrs.publisher | html; %] + + [%- IF attrs.pubdate; %] + + [%- END; %]
  • [%- END %] diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2 index bc52adb..b7e526f 100644 --- a/Open-ILS/src/templates/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/table.tt2 @@ -62,8 +62,6 @@ authorquery = attrs.author | replace('[,\.:;]', ''); mkurl(ctx.opac_root _ '/results', {qtype => 'author', query => authorquery}, ['page']) -%]">[% attrs.author | html %] -    - [% attrs.pubdate | html %] @@ -79,12 +77,12 @@ [% IF CGI.param('detail_record_view') %] - [% IF attrs.publisher %] + [% IF attrs.pubinfo %] - + [% END %] [% IF attrs.isbns.size > 0 %]
    [% l('Publisher:') %] [% attrs.publisher | html %][% attrs.pubinfo | html %]