]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/extras.tt2
5bf5716a4fe27a4192b7c47e2dc1a5e725022047
[Evergreen.git] / Open-ILS / src / templates / opac / parts / record / extras.tt2
1 <div>
2     <div id='rdetail_extras_div' style='width: 100%;'> 
3
4         [%  # Hidden extras are not yet implemented.  Some may require JS
5
6         # Let's see if we should hide the content cafe / simple summary content
7         hide_summary = 1;
8         IF attrs.summary.0; hide_summary = 0; ELSE;
9             # Expose content cafe if it's reasonable to do so.
10             # This approach only works when using embedded content cafe.
11             IF ENV.OILS_CONTENT_CAFE_USER; 
12                 ident = attrs.isbn_clean || attrs.upc; 
13                 IF ident; hide_summary = 0; END;
14             END;
15         END;
16
17         extras = [
18             {name => 'subjects', label => l('Subject')}, 
19             {name => 'summaryplus',  label => l('Summaries &amp; More'), hide => hide_summary}, 
20             {name => 'contents',  label => l('Contents'), hide => !attrs.contents},
21             {name => 'authors',  label => l('Authors')}, 
22             {name => 'series',   label => l('Series')},
23             {name => 'annotation', label => l('Annotation'), hide => 1}, 
24             {name => 'awards',  label => l('Awards, Reviews, & Suggested Reads')}, 
25             {name => 'excerpt',  label => l('Excerpt'), hide => 1},
26             {name => 'issues',   label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)},
27             {name => 'preview',  label => l('Preview'), hide => 1}, 
28             {name => 'cnbrowse', label => l('Shelf Browser')},
29             {name => 'marchtml', label => l('MARC Record')}
30         ];
31
32         MACRO tab_is_active(tab) BLOCK;
33             exp_name = 'expand_' _ tab;
34             IF ctx.$exp_name OR ctx.expand_all; 1; END;
35         END;
36
37         FOREACH extra IN extras;
38             IF extra.hide; NEXT; END; 
39             name = extra.name;
40         %]
41         <div class="rdetail_extras">
42             <div class="rdetail_extras_hr"></div>
43             <div class="rdetail_extras_link">
44                 [%  
45                     IF tab_is_active(name);
46                         href = mkurl('', {}, ['expand']);
47                         img_url = ctx.media_prefix _ '/images/rdetail_arrow_down.png';
48                     ELSE;
49                         href = mkurl('', {expand => name}) _ '#' _ name; 
50                         img_url = ctx.media_prefix _ '/images/rdetail_arrow.png';
51                     END;
52                 %]
53                 <a name='[% name %]' href='[% href %]'><img alt='[% extra.label %]' src='[% img_url %]'/></a>
54                 <a href='[% href %]' class="rdetail_extras_lbl">[% extra.label %]</a>
55             </div>
56         </div>
57         <div class='rdetail_extras_div'>
58             [%  IF tab_is_active(name);
59                     IF name == 'marchtml';
60                         ctx.marchtml;
61                     ELSIF name == 'contents';
62                         attrs.contents;
63                     ELSE;
64                         # Load the template for the selected extra
65                         INCLUDE "opac/parts/record/${name}.tt2";
66                     END;
67                 END; 
68             %]
69         </div>
70         [% END %]
71     </div>
72 </div>