]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac-new/parts/record/addedcontent.tt2
LP#1778972: OPAC Redesign
[Evergreen.git] / Open-ILS / src / templates / opac-new / 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     [% 
22         all_hidden = 1;
23         FOR type IN ac_types.keys;
24             tab_class = 'ac_tab';
25             SET tab_class = tab_class _ ' ac_tab_selected' IF type == selected_type; 
26             IF ctx.added_content.$type.status != '2'; # no content
27                 all_hidden = 0;
28                 IF ctx.added_content.$type.status == '3' AND want_dojo; # status unknown
29                     tab_class = tab_class _ ' hidden';
30                 END %]
31             <div class="[% tab_class %]" id="ac:[% type %]">
32                 <a href="[% mkurl('', {ac => type}) _ '#addedcontent' %]" rel="nofollow" vocab="">[% ac_types.$type %]</a>
33             </div>
34             [% END;
35         END;
36     %]
37     </div>
38
39     <div id='ac_content'>
40         [% 
41             IF selected_type; 
42                 content = ctx.added_content.$selected_type.content;
43                 IF content;
44                     content;
45                 ELSE;
46                     l('No Content Available');
47                 END;
48             ELSIF all_hidden;
49                 l('No Content Available');
50             END;
51         %]
52     </div>
53 </div>
54
55