From: Bill Erickson Date: Mon, 21 May 2012 16:17:41 +0000 (-0400) Subject: kpac: added content integration X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d55f538b3d96e23b54cdf071aa9170f80060b3a8;p=evergreen%2Fequinox.git kpac: added content integration Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/templates/kpac/parts/addedcontent.tt2 b/Open-ILS/src/templates/kpac/parts/addedcontent.tt2 new file mode 100644 index 0000000000..6103703984 --- /dev/null +++ b/Open-ILS/src/templates/kpac/parts/addedcontent.tt2 @@ -0,0 +1,55 @@ +
+ +[% + ac_types = { + reviews => l('Reviews'), + anotes => l('Author Notes'), + toc => l('Table of Contents'), + excerpt => l('Excerpt'), + summary => l('Summary') + }; + + selected_type = CGI.param('ac'); + + # For each type of added content, render the link if it's known to have + # content, do not render the link if it's known to not have content. If + # the content status is unknown, render the link, but hide the link via CSS + # if dojo is enabled. If dojo is not enabled, render and display the link. +%] + +
+ [% + all_hidden = 1; + FOR type IN ac_types.keys; + tab_class = 'ac_tab'; + SET tab_class = tab_class _ ' ac_tab_selected' IF type == selected_type; + IF ctx.added_content.$type.status != '2'; # no content + all_hidden = 0; + IF ctx.added_content.$type.status == '3' AND want_dojo; # status unknown + tab_class = tab_class _ ' hidden'; + END %] + + [% END; + END; + %] +
+ +
+
+ [% + IF selected_type; + content = ctx.added_content.$selected_type.content; + '
'; + IF content; + content; + ELSE; + l('No Content Available'); + END; + END; + %] +
+
+ + diff --git a/Open-ILS/src/templates/kpac/record.tt2 b/Open-ILS/src/templates/kpac/record.tt2 index ce175ddf7c..f727b4a599 100644 --- a/Open-ILS/src/templates/kpac/record.tt2 +++ b/Open-ILS/src/templates/kpac/record.tt2 @@ -87,69 +87,7 @@ [% END %] - - - + [% INCLUDE 'kpac/parts/addedcontent.tt2' %] - - [% END %]