Fix summary display in TPAC; avoid Content Cafe
authorDan Scott <dscott@laurentian.ca>
Fri, 27 Jul 2012 21:24:07 +0000 (17:24 -0400)
committerDan Scott <dscott@laurentian.ca>
Mon, 30 Jul 2012 15:25:27 +0000 (11:25 -0400)
While in misc_util.tt2 we're grabbing args.summary as a single string,
and args.summaries as the list of summaries, this gets complicated
elsewhere in the summaries display chain, where we're checking for the
number of list elements in "summary" (which is now a string), as well as
a confusion of logic where ContentCafe was being displayed whether or
not the environment variable existed.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>

Open-ILS/src/templates/opac/parts/record/extras.tt2
Open-ILS/src/templates/opac/parts/record/summaryplus.tt2

index 276c969..c031bc7 100644 (file)
@@ -10,7 +10,7 @@
 
         # Let's see if we should hide the content cafe / simple summary content
         hide_summary = 1;
-        IF attrs.summary.0; hide_summary = 0; ELSE;
+        IF attrs.summaries.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 7796213..27513be 100644 (file)
@@ -1,19 +1,20 @@
 <div class='rdetail_extras_div'> 
-    [%  IF attrs.summary %]
+    [%- IF attrs.summary %]
     <div class='rdetail-extras-summary'>
         <strong>[% l('Summary: ') %]</strong>
-        [% FOR sum IN attrs.summary %]
+        [% FOR sum IN attrs.summaries %]
             [% IF !loop.first; '<br/>'; END %]
             <span>[% sum | html %] </span>
         [% END %]
     </div>
-    [% END %]
-
+    [%- END %]
+    [%- IF ENV.OILS_CONTENT_CAFE_USER %]
     <!-- Embedded content cafe iframe -->
     [% ident = attrs.isbn_clean || attrs.upc %]
     <iframe width="100%" height="400" frameborder="0" 
         src="[% ctx.proto %]://contentcafe2.btol.com/ContentCafeClient/ContentCafe.aspx?UserID=[%- 
             ENV.OILS_CONTENT_CAFE_USER %]&amp;Password=[% ENV.OILS_CONTENT_CAFE_PASS %]&amp;ItemKey=[% ident | uri %]&amp;Options=Y" >
     </iframe>
+    [%- END %]
 </div>