2 arrow_right = '►';
3 arrow_down = '▼';
6 <div id='rdetail_extras_div' class="card-columns row" style='width: 100%;'>
8 IF ctx.google_books_preview;
9 label = l('Google Preview');
10 name = 'google_preview';
12 <div id="gbp_extra" class="card">
13 <div id="gbp_extra_links" class="card-header">
14 <a id='gbp_arrow_link' name='[% name %]' class='rdetail_extras_lbl'>[% arrow_right %]</a>
15 <a id='gbp_arrow_down_link' name='[% name %]' class='rdetail_extras_lbl'>[% arrow_down %]</a>
16 <a name='[% name %]_lbl' class="rdetail_extras_lbl">[% label %]</a></div>
18 <div id="gbp_extra_container" class='card-body'></div>
21 [% # Hidden extras are not yet implemented. Some may require JS
23 MACRO tab_is_active(tab) BLOCK;
24 exp_name = 'expand_' _ tab;
25 IF ctx.$exp_name OR ctx.expand_all; 1; END;
28 # Let's see if we should hide the content cafe / simple summary content
30 IF attrs.summaries.0; hide_summary = 0; ELSE;
31 # Expose content cafe if it's reasonable to do so.
32 # This approach only works when using embedded content cafe.
33 IF ENV.OILS_CONTENT_CAFE_USER;
34 ident = attrs.isbn_clean || attrs.upc;
35 IF ident; hide_summary = 0; END;
39 # if no added content is available, hide the main tab.
40 # if any content is available, use the first tab as the default display tab.
42 IF !tab_is_active('addedcontent');
44 FOR type IN ctx.added_content.keys;
45 IF ctx.added_content.$type.status != '2'; # not available
48 IF ctx.added_content.$type.status == '1';
49 SET default_ac = type UNLESS default_ac;
55 {name => 'summaryplus', label => l('Summaries & More'), hide => hide_summary},
56 {name => 'annotation', label => l('Annotation'), hide => 1},
57 {name => 'awards', label => l('Awards, Reviews, & Suggested Reads')},
58 {name => 'excerpt', label => l('Excerpt'), hide => 1},
59 {name => 'issues', label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)},
60 {name => 'preview', label => l('Preview'), hide => 1},
61 {name => 'addedcontent', label => l('Additional Content'), hide => hide_ac}, # hide if all content is known to not exist
62 {name => 'cnbrowse', label => l('Shelf Browser')},
63 {name => 'marchtml', label => l('MARC Record')}
66 FOREACH extra IN extras;
67 IF extra.hide; NEXT; END;
70 <div class="card border-secondary col-12 p-0">
72 IF tab_is_active(name);
73 href = mkurl('', {}, ['expand', 'ac']);
76 IF name == 'addedcontent' AND default_ac;
77 href = mkurl('', {expand => name, ac => default_ac}) _ '#' _ name;
79 href = mkurl('', {expand => name}) _ '#' _ name;
84 <a id='[% name %]' href='[% href %]' class="text-white" rel="nofollow" vocab="" style="text-decoration:none;">
85 <div class="card-header extra_header">
87 <span>[% arrow %] [% extra.label | html %]</span>
90 [% IF tab_is_active(name); %]
91 <div class='card-body'>
93 [% IF name == 'marchtml';
96 # Load the template for the selected extra
97 INCLUDE "opac/parts/record/${name}.tt2";