LP#1424815: 'Read more' accordion in record view
[evergreen-equinox.git] / Open-ILS / src / templates / opac / parts / record / summary.tt2
index be248ab..d3aed58 100644 (file)
@@ -3,6 +3,7 @@
     ctx.page_title = attrs.title | html
     ctx.metalinks.push('<meta property="og:image" content="' _ ctx.media_prefix _ '/opac/extras/ac/jacket/large/r/' _ ctx.bre_id _ '" />');
 %]
+
 <!-- ****************** rdetail_summary.xml ***************************** -->
 <abbr class="unapi-id" title='tag:[% ctx.hostname %],[% date.format(date.now, '%Y') %]:biblio-record_entry/[% ctx.bre_id %]'></abbr>
 
@@ -11,7 +12,7 @@
 [%-# This holds the record summary information %]
 <div id="rdetail_summary_header">
     <div id='rdetail_title_div'>
-        <h1 id='rdetail_title' property="name">[% IF attrs.hl.title; attrs.hl.title; ELSE; attrs.title_extended | html; END %]</h1>
+        <h1 id='rdetail_title' property="name">[% IF attrs.hl.title; accordion(attrs.hl.title); ELSE; accordion(attrs.title_extended); END %]</h1>
         [%-
             FOR link880 IN attrs.graphic_titles;
                 FOR alt IN link880.graphic;
@@ -19,7 +20,7 @@
                     IF alt.dir;
                         ' dir="' _ alt.dir _ '"';
                     END;
-                    '>'; alt.value | html; '</h2>';
+                    '>'; accordion(alt.value); '</h2>';
                 END;
             END;
         -%]
@@ -359,22 +360,25 @@ END;
     [%- IF attrs.hl.physical_description.size %]
     <li id='rdetail_phys_desc'>
         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
-        <span class='rdetail_value' highlighted='true'>[% attrs.hl.physical_description.join('<br/>') %]</span>
+        <span class='rdetail_value' highlighted='true'>
+        [% FOREACH desc IN attrs.hl.physical_description %]
+            <span>[% accordion(desc) %]</span><br/>
+        [% END %]</span>
     </li>
     [%- ELSIF attrs.phys_desc %]
     <li id='rdetail_phys_desc'>
         <strong class='rdetail_label'>[% l("Physical Description:") %]</strong>
-        <span class='rdetail_value'>[% attrs.phys_desc | html %]</span>
+        <span class='rdetail_value'>[% accordion(attrs.phys_desc) %]</span>
     </li>
     [%- END %]
     [%- IF attrs.hl.edition %]
     <li id='rdetail_edition'>
         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
-        <span class='rdetail_value' highlighted='true'>[% attrs.hl.edition %]</span>
+        <span class='rdetail_value' highlighted='true'>[% accordion(attrs.hl.edition) %]</span>
     [%- ELSIF attrs.edition %]
     <li id='rdetail_edition'>
         <strong class='rdetail_label'>[% l("Edition:") %]</strong>
-        <span class='rdetail_value'>[% attrs.edition | html %]</span>
+        <span class='rdetail_value'>[% accordion(attrs.edition) %]</span>
         [%-
         FOR entry IN attrs.graphic_editions;
             FOR alt IN entry.graphic;
@@ -384,7 +388,7 @@ END;
                 END;
         -%]
         <div class="graphic880 rdetail_value"[% diratt %]>
-            [% alt.value | html %]
+            [% accordion(alt.value); %]
         </div>
         [%-
             END;
@@ -395,19 +399,20 @@ END;
     [%- IF attrs.hl.publisher %]
     <li id='rdetail_publisher'>
         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
-        <span class='rdetail_value' highlighted='true'>[% attrs.hl.publisher %]</span>
+        <span class='rdetail_value' highlighted='true'>[% accordion(attrs.hl.publisher) %]</span>
     </li>
     [%- ELSIF attrs.publisher %]
     <li id='rdetail_publisher'>
         <strong class='rdetail_label'>[% l("Publisher:") %]</strong>
         <span class='rdetail_value' property="publisher" typeof="Organization">
+        [% pubstr = '' %]
         [%- IF attrs.pubplace; %]
-            <span property="location">[% attrs.pubplace | html; %]</span>
+            <span property="location">[% attrs.pubplace %]</span>
         [%- END; %]
-            <span property="name">[% attrs.publisher | html; %]</span>
+            <span property="name">[% attrs.publisher %]</span>
         </span>
         [%- IF attrs.pubdate; %]
-            <span property="datePublished">[% attrs.pubdate | html; %]</span>
+            <span property="datePublished">[% attrs.pubdate %]</span>
         [%- END; %]
         [%-
         IF attrs.graphic_pubinfos.size > 0;
@@ -419,7 +424,7 @@ END;
                     END;
         -%]
         <div class="graphic880"[% diratt %]>
-            [% alt.value | html %]
+            [% accordion(alt.value) %]
         </div>
         [%-
                 END;
@@ -433,11 +438,11 @@ END;
             <strong class='rdetail_label'>[% l("Producer:") %]</strong>
             <span class='rdetail_value'>
             [%- IF attrs.prodplace; %]
-                <span>[% attrs.prodplace | html; %]</span>
+                <span>[% accordion(attrs.prodplace) %]</span>
             [%- END; %]
-                <span>[% attrs.producer | html; %]</span>
+                <span>[% accordion(attrs.producer) %]</span>
             [%- IF attrs.proddate; %]
-                <span>[% attrs.proddate | html; %]</span>
+                <span>[% accordion(attrs.proddate) %]</span>
             [%- END; %]
             </span>
         </li>
@@ -447,11 +452,11 @@ END;
             <strong class='rdetail_label'>[% l("Distributor:") %]</strong>
             <span class='rdetail_value'>
             [%- IF attrs.distplace; %]
-                <span>[% attrs.distplace | html; %]</span>
+                <span>[% accordion(attrs.distplace) %]</span>
             [%- END; %]
-                <span>[% attrs.distributor | html; %]</span>
+                <span>[% accordion(attrs.distributor) %]</span>
             [%- IF attrs.distdate; %]
-                <span>[% attrs.distdate | html; %]</span>
+                <span>[% accordion(attrs.distdate) %]</span>
             [%- END; %]
             </span>
         </li>
@@ -461,11 +466,11 @@ END;
             <strong class='rdetail_label'>[% l("Manufacturer:") %]</strong>
             <span class='rdetail_value' property="manufacturer" typeof="Organization">
             [%- IF attrs.manplace; %]
-                <span property="location">[% attrs.manplace | html; %]</span>
+                <span property="location">[% accordion(attrs.manplace) %]</span>
             [%- END; %]
-                <span property="name">[% attrs.manufacturer | html; %]</span>
+                <span property="name">[% accordion(attrs.manufacturer) %]</span>
             [%- IF attrs.mandate; %]
-                <span>[% attrs.mandate | html; %]</span>
+                <span>[% accordion(attrs.mandate) %]</span>
             [%- END; %]
             </span>
         </li>
@@ -473,7 +478,7 @@ END;
     [%- IF attrs.copyright %]
     <li id='rdetail_copyright'>
         <strong class='rdetail_label'>[% l("Copyright:") %]</strong>
-        <span class='rdetail_value'>[% attrs.copyright | html_entity; %]
+        <span class='rdetail_value'>[% accordion(attrs.copyright) %]
         [%-# Provide the 4-digit year, cleansed of '@' and other junk %]
         [%- IF attrs.copyrightYear -%]
             <meta property='copyrightYear' content='[% attrs.copyrightYear | html; %]'>