]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/addedcontent.tt2
TPAC added content integration
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / record / addedcontent.tt2
1 <div class='rdetail_extras_div'> 
2
3 [% 
4     ac_types = {
5         reviews => l('Reviews'),
6         anotes  => l('Author Notes'),
7         toc     => l('Table of Contents'),
8         excerpt => l('Excerpt'),
9         summary => l('Summary')
10     };
11
12     selected_type = CGI.param('ac');
13     
14     # For each type of added content, render the link if it's known to have
15     # content, do not render the link if it's known to not have content.  If 
16     # the content status is unknown, render the link, but hide the link via CSS
17     # if dojo is enabled.  If dojo is not enabled, render and display the link.
18 %]
19
20     <div id='ac_tab_wrapper'>
21         [% FOR type IN ac_types.keys;
22             tab_class = 'ac_tab';
23             IF ctx.added_content.$type.status != '2'; # no content
24                 IF ctx.added_content.$type.status == '3' AND want_dojo; # status unknown
25                     tab_class = tab_class _ ' hidden';
26                 END %]
27             <div class="[% tab_class %]" id="ac:[% type %]">
28                 <a href="[% mkurl('', {ac => type}) _ '#addedcontent' %]">[% ac_types.$type %]</a>
29             </div>
30             [% END;
31         END %]
32     </div>
33
34     <div id='ac_content'>
35         <hr/>
36         [% 
37             IF selected_type; 
38                 content = ctx.added_content.$selected_type.content;
39                 IF content;
40                     content;
41                 ELSE;
42                     l('No Content Available');
43                 END;
44             END;
45         %]
46     </div>
47 </div>
48
49