From 48ab6c5f669c2e6862446fe6a6694b2b822b60a4 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 16 Sep 2011 14:00:32 -0400 Subject: [PATCH] TPac: display table of contents on record details Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/src/templates/opac/parts/misc_util.tt2 | 2 ++ Open-ILS/src/templates/opac/parts/record/extras.tt2 | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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 & 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"; -- 2.43.2