2 arrow_right = '►';
3 arrow_down = '▼';
6 <div id='rdetail_extras_div' style='width: 100%;'>
8 IF ctx.google_books_preview;
9 label = l('Google Preview');
10 name = 'google_preview';
11 href = 'javascript:GBDisplayPreview();';
13 <div id="gbp_extra" class="rdetail_extras hide_me">
14 <div class="rdetail_extras_hr"></div>
15 <div id="gbp_extra_links" class="rdetail_extras_link">
16 <a id='gbp_arrow_link' name='[% name %]' href='[% href %]' class='rdetail_extras_lbl'>[% arrow_right %]</a>
17 <a id='gbp_arrow_down_link' name='[% name %]' href='[% href %]' class='rdetail_extras_lbl hide_me'>[% arrow_down %]</a>
18 <a name='[% name %]_lbl' href='[% href %]' class="rdetail_extras_lbl">[% label %]</a></div>
20 <div id="gbp_extra_container" class='rdetail_extras_div'></div>
23 [% # Hidden extras are not yet implemented. Some may require JS
25 MACRO tab_is_active(tab) BLOCK;
26 exp_name = 'expand_' _ tab;
27 IF ctx.$exp_name OR ctx.expand_all; 1; END;
30 # Let's see if we should hide the content cafe / simple summary content
32 IF attrs.summaries.0; hide_summary = 0; ELSE;
33 # Expose content cafe if it's reasonable to do so.
34 # This approach only works when using embedded content cafe.
35 IF ENV.OILS_CONTENT_CAFE_USER;
36 ident = attrs.isbn_clean || attrs.upc;
37 IF ident; hide_summary = 0; END;
41 # if no added content is available, hide the main tab.
42 # if any content is available, use the first tab as the default display tab.
44 IF !tab_is_active('addedcontent');
46 FOR type IN ctx.added_content.keys;
47 IF ctx.added_content.$type.status != '2'; # not available
50 IF ctx.added_content.$type.status == '1';
51 SET default_ac = type UNLESS default_ac;
57 {name => 'summaryplus', label => l('Summaries & More'), hide => hide_summary},
58 {name => 'annotation', label => l('Annotation'), hide => 1},
59 {name => 'awards', label => l('Awards, Reviews, & Suggested Reads')},
60 {name => 'excerpt', label => l('Excerpt'), hide => 1},
61 {name => 'issues', label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)},
62 {name => 'preview', label => l('Preview'), hide => 1},
63 {name => 'addedcontent', label => l('Additional Content'), hide => hide_ac}, # hide if all content is known to not exist
64 {name => 'cnbrowse', label => l('Shelf Browser')},
65 {name => 'marchtml', label => l('MARC Record')}
68 FOREACH extra IN extras;
69 IF extra.hide; NEXT; END;
72 <div class="rdetail_extras">
73 <div class="rdetail_extras_hr"></div>
74 <div class="rdetail_extras_link">
76 IF tab_is_active(name);
77 href = mkurl('', {}, ['expand', 'ac']);
80 IF name == 'addedcontent' AND default_ac;
81 href = mkurl('', {expand => name, ac => default_ac}) _ '#' _ name;
83 href = mkurl('', {expand => name}) _ '#' _ name;
88 <a name='[% name %]' href='[% href %]' class="rdetail_extras_lbl">[% arrow %] [% extra.label | html %]</a>
91 <div class='rdetail_extras_div'>
92 [% IF tab_is_active(name);
93 IF name == 'marchtml';
96 # Load the template for the selected extra
97 INCLUDE "opac/parts/record/${name}.tt2";