]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/kpac/parts/addedcontent.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen
[working/Evergreen.git] / Open-ILS / src / templates / kpac / parts / addedcontent.tt2
1 <a name='addedcontent'></a> <!-- for page focus -->
2 <div class='item_detail_extras_tabs'>
3 [%-
4     # NOTE: enabling all of these types may result in the tabs occupying 
5     # too much horizontal space to fit within the fixed-width box.
6
7     ac_types = {
8         reviews => l('Reviews'),
9         anotes  => l('Author Notes'),
10         toc     => l('Table of Contents'),
11         excerpt => l('Excerpt'),
12         summary => l('Smmary')
13     };
14
15     selected_type = CGI.param('ac');
16     
17     # For each type of added content, render the link if it's known to have
18     # content, do not render the link if it's known to not have content.  If 
19     # the content status is unknown, render the link, but hide the link via CSS
20     # if dojo is enabled.  If dojo is not enabled, render and display the link.
21
22     all_hidden = 1;
23     FOR type IN ac_types.keys;
24         tab_class = '';
25         SET tab_class = 'ac_tab_selected' IF type == selected_type; 
26         '<!-- status = ' _ type _ ' : ' _ ctx.added_content.$type.status _ '-->';
27         IF ctx.added_content.$type.status != '2'; # no content
28             all_hidden = 0;
29             IF ctx.added_content.$type.status == '3' AND want_dojo; # status unknown
30                 tab_class = tab_class _ ' hidden';
31             END %]
32             <a class="[% tab_class %]" id="ac:[% type %]" href="[% mkurl('', {ac => type}) _ '#addedcontent' %]">[% ac_types.$type %]</a>
33         [% END;
34     END %]
35
36     <div class="clear">&nbsp;</div>
37 </div>
38
39 <div style='width:98%; padding:5px;'> 
40     <div id='ac_content'>
41         [% 
42             IF selected_type; 
43                 content = ctx.added_content.$selected_type.content;
44                 IF content;
45                     content;
46                 ELSE;
47                     l('No Content Available');
48                 END;
49             END;
50         %]
51     </div>
52 </div>
53
54