From a3d44706598482088c42b02fe449da25475e29fe Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 25 May 2012 09:47:02 -0400 Subject: [PATCH] kpac : added content Integrate the added content support from tpac and clean up the old added content stub code. Signed-off-by: Bill Erickson Signed-off-by: Mike Rylander --- Open-ILS/src/templates/kpac/parts/addedcontent.tt2 | 54 ++++++++++++++++++ Open-ILS/src/templates/kpac/record.tt2 | 64 +--------------------- Open-ILS/web/css/skin/default/kpac/style.css | 23 +++----- 3 files changed, 62 insertions(+), 79 deletions(-) create mode 100644 Open-ILS/src/templates/kpac/parts/addedcontent.tt2 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..bcea6c610e --- /dev/null +++ b/Open-ILS/src/templates/kpac/parts/addedcontent.tt2 @@ -0,0 +1,54 @@ + +
+[%- + # NOTE: enabling all of these types may result in the tabs occupying + # too much horizontal space to fit within the fixed-width box. + + ac_types = { + reviews => l('Reviews'), + anotes => l('Author Notes'), + toc => l('Table of Contents'), + excerpt => l('Excerpt'), + summary => l('Smmary') + }; + + 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 = ''; + SET 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 %] + [% ac_types.$type %] + [% 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 %] diff --git a/Open-ILS/web/css/skin/default/kpac/style.css b/Open-ILS/web/css/skin/default/kpac/style.css index ba050cea92..f937fa21e2 100755 --- a/Open-ILS/web/css/skin/default/kpac/style.css +++ b/Open-ILS/web/css/skin/default/kpac/style.css @@ -620,8 +620,7 @@ input[type=text], input[type=password], textarea { background:#e3e3e3; } -.item_detail_extras_tabs a, -.item_detail_extras_tabs div.selected { +.item_detail_extras_tabs a { display:block; float:left; padding:14px 35px; @@ -631,8 +630,8 @@ input[type=text], input[type=password], textarea { margin-right:10px; } -.item_detail_extras_tabs a.selected, -.item_detail_extras_tabs div.selected { +.item_detail_extras_tabs a.ac_tab_selected, +.item_detail_extras_tabs div.ac_tab_selected { background:white; color:#424242; } @@ -1019,16 +1018,8 @@ div.hr { visibility : hidden; } - - - - - - - - - - - - +.hidden { + visibility : hidden; + display : none; +} -- 2.11.0