From 315f5188ed208aa14559aec27980eddf4b49e823 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 10 Aug 2011 14:16:13 -0400 Subject: [PATCH] Accommodate multiple 520a's in tt-opac summary display MARC args.summary is now an array of summary entries. Signed-off-by: Bill Erickson --- Open-ILS/web/templates/default/opac/parts/misc_util.tt2 | 7 ++++++- .../web/templates/default/opac/parts/record/extras.tt2 | 2 +- .../templates/default/opac/parts/record/summaryplus.tt2 | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Open-ILS/web/templates/default/opac/parts/misc_util.tt2 b/Open-ILS/web/templates/default/opac/parts/misc_util.tt2 index f9ebae38b2..0a24b28e88 100644 --- a/Open-ILS/web/templates/default/opac/parts/misc_util.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/misc_util.tt2 @@ -10,7 +10,6 @@ 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; @@ -21,6 +20,12 @@ FOR p IN phys; phys_content.push(p.textContent); END; args.phys_desc = phys_content.join(""); + # capture all of the 520a's + args.summary = []; + FOR s IN xml.findnodes('//*[@tag="520"]/*[@code="a"]'); + args.summary.push(s.textContent); + END; + # MARC Callnumber args.marc_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent; diff --git a/Open-ILS/web/templates/default/opac/parts/record/extras.tt2 b/Open-ILS/web/templates/default/opac/parts/record/extras.tt2 index c53ce31668..95333a1762 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/extras.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/extras.tt2 @@ -5,7 +5,7 @@ # 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; diff --git a/Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2 b/Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2 index 6fb3d53d19..4b7552fbe0 100644 --- a/Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2 +++ b/Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2 @@ -1,7 +1,11 @@
[% IF attrs.summary %]
- [% l('Summary: ') %][% attrs.summary %] + [% l('Summary: ') %] + [% FOR sum IN attrs.summary %] + [% IF !loop.first; '
'; END %] + [% sum %] + [% END %]
[% END %] -- 2.43.2