]> git.evergreen-ils.org Git - Evergreen.git/blob - Open-ILS/src/templates/opac/parts/record/extras.tt2
Remove "Expand all extras" as there are fewer extras to expand
[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 => 'summaryplus',  label => l('Summaries &amp; More'), hide => hide_summary}, 
19             {name => 'contents',  label => l('Contents'), hide => !attrs.contents},
20             {name => 'annotation', label => l('Annotation'), hide => 1}, 
21             {name => 'awards',  label => l('Awards, Reviews, & Suggested Reads')}, 
22             {name => 'excerpt',  label => l('Excerpt'), hide => 1},
23             {name => 'issues',   label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)},
24             {name => 'preview',  label => l('Preview'), hide => 1}, 
25             {name => 'cnbrowse', label => l('Shelf Browser')},
26             {name => 'marchtml', label => l('MARC Record')}
27         ];
28
29         MACRO tab_is_active(tab) BLOCK;
30             exp_name = 'expand_' _ tab;
31             IF ctx.$exp_name OR ctx.expand_all; 1; END;
32         END;
33
34         FOREACH extra IN extras;
35             IF extra.hide; NEXT; END; 
36             name = extra.name;
37         %]
38         <div class="rdetail_extras">
39             <div class="rdetail_extras_hr"></div>
40             <div class="rdetail_extras_link">
41                 [%  
42                     IF tab_is_active(name);
43                         href = mkurl('', {}, ['expand']);
44                         img_url = ctx.media_prefix _ '/images/rdetail_arrow_down.png';
45                     ELSE;
46                         href = mkurl('', {expand => name}) _ '#' _ name; 
47                         img_url = ctx.media_prefix _ '/images/rdetail_arrow.png';
48                     END;
49                 %]
50                 <a name='[% name %]' href='[% href %]'><img alt='[% extra.label %]' src='[% img_url %]'/></a>
51                 <a href='[% href %]' class="rdetail_extras_lbl">[% extra.label %]</a>
52             </div>
53         </div>
54         <div class='rdetail_extras_div'>
55             [%  IF tab_is_active(name);
56                     IF name == 'marchtml';
57                         ctx.marchtml;
58                     ELSIF name == 'contents';
59                         attrs.contents;
60                     ELSE;
61                         # Load the template for the selected extra
62                         INCLUDE "opac/parts/record/${name}.tt2";
63                     END;
64                 END; 
65             %]
66         </div>
67         [% END %]
68     </div>
69 </div>