TPac: display table of contents on record details
authorBill Erickson <berick@esilibrary.com>
Fri, 16 Sep 2011 18:00:32 +0000 (14:00 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 16 Sep 2011 17:59:29 +0000 (13:59 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/opac/parts/misc_util.tt2
Open-ILS/src/templates/opac/parts/record/extras.tt2

index 713a0be..38944f6 100644 (file)
@@ -25,6 +25,8 @@
         FOR p IN phys; phys_content.push(p.textContent); END;
         args.phys_desc = phys_content.join("");
 
+        args.contents = xml.findnodes('//*[@tag="505"]').textContent;
+
         # MARC Callnumber
         args.marc_cn = xml.findnodes('//*[@tag="092" or @tag="099"]/*').textContent;
 
index a61fbee..a9e03ad 100644 (file)
@@ -17,7 +17,7 @@
         extras = [
             {name => 'subjects', label => l('Subject')}, 
             {name => 'summaryplus',  label => l('Summaries &amp; More'), hide => hide_summary}, 
-            {name => 'content',  label => l('Contents'), hide => 1}, # ToC
+            {name => 'contents',  label => l('Contents'), hide => !attrs.contents},
             {name => 'authors',  label => l('Authors')}, 
             {name => 'series',   label => l('Series')},
             {name => 'annotation', label => l('Annotation'), hide => 1}, 
@@ -52,6 +52,8 @@
             [%  IF tab_is_active(name);
                     IF name == 'marchtml';
                         ctx.marchtml;
+                    ELSIF name == 'contents';
+                        attrs.contents;
                     ELSE;
                         # Load the template for the selected extra
                         INCLUDE "opac/parts/record/${name}.tt2";