From: Bill Erickson <berick@esilibrary.com>
Date: Fri, 16 Sep 2011 18:00:32 +0000 (-0400)
Subject: TPac: display table of contents on record details
X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=48ab6c5f669c2e6862446fe6a6694b2b822b60a4;p=evergreen%2Fmasslnc.git

TPac: display table of contents on record details

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
---

diff --git a/Open-ILS/src/templates/opac/parts/misc_util.tt2 b/Open-ILS/src/templates/opac/parts/misc_util.tt2
index 713a0be235..38944f6122 100644
--- a/Open-ILS/src/templates/opac/parts/misc_util.tt2
+++ b/Open-ILS/src/templates/opac/parts/misc_util.tt2
@@ -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;
 
diff --git a/Open-ILS/src/templates/opac/parts/record/extras.tt2 b/Open-ILS/src/templates/opac/parts/record/extras.tt2
index a61fbeec8b..a9e03ad0ea 100644
--- a/Open-ILS/src/templates/opac/parts/record/extras.tt2
+++ b/Open-ILS/src/templates/opac/parts/record/extras.tt2
@@ -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";