Accommodate multiple 520a's in tt-opac summary display
authorBill Erickson <berick@esilibrary.com>
Wed, 10 Aug 2011 18:16:13 +0000 (14:16 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 10 Aug 2011 18:16:13 +0000 (14:16 -0400)
MARC args.summary is now an array of summary entries.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/templates/default/opac/parts/misc_util.tt2
Open-ILS/web/templates/default/opac/parts/record/extras.tt2
Open-ILS/web/templates/default/opac/parts/record/summaryplus.tt2

index f9ebae3..0a24b28 100644 (file)
@@ -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;
         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;
 
index c53ce31..95333a1 100644 (file)
@@ -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; 
index 6fb3d53..4b7552f 100644 (file)
@@ -1,7 +1,11 @@
 <div class='rdetail_extras_div'> 
     [%  IF attrs.summary %]
     <div class='rdetail-extras-summary'>
-        <strong>[% l('Summary: ') %]</strong>[% attrs.summary %]
+        <strong>[% l('Summary: ') %]</strong>
+        [% FOR sum IN attrs.summary %]
+            [% IF !loop.first; '<br/>'; END %]
+            <span>[% sum %] </span>
+        [% END %]
     </div>
     [% END %]