2 <div id='rdetail_extras_div' style='width: 100%;'>
4 [% # Hidden extras are not yet implemented. Some may require JS
6 MACRO tab_is_active(tab) BLOCK;
7 exp_name = 'expand_' _ tab;
8 IF ctx.$exp_name OR ctx.expand_all; 1; END;
11 # Let's see if we should hide the content cafe / simple summary content
13 IF attrs.summary.0; hide_summary = 0; ELSE;
14 # Expose content cafe if it's reasonable to do so.
15 # This approach only works when using embedded content cafe.
16 IF ENV.OILS_CONTENT_CAFE_USER;
17 ident = attrs.isbn_clean || attrs.upc;
18 IF ident; hide_summary = 0; END;
22 # if no added content is available, hide the main tab.
23 # if any content is available, use the first tab as the default display tab.
25 IF !tab_is_active('addedcontent');
27 FOR type IN ctx.added_content.keys;
28 IF ctx.added_content.$type.status != '2'; # not available
31 IF ctx.added_content.$type.status == '1';
32 SET default_ac = type UNLESS default_ac;
38 {name => 'summaryplus', label => l('Summaries & More'), hide => hide_summary},
39 {name => 'contents', label => l('Contents'), hide => !attrs.contents},
40 {name => 'annotation', label => l('Annotation'), hide => 1},
41 {name => 'awards', label => l('Awards, Reviews, & Suggested Reads')},
42 {name => 'excerpt', label => l('Excerpt'), hide => 1},
43 {name => 'issues', label => l('Issues Held'), hide => !(ctx.have_holdings_to_show || ctx.have_mfhd_to_show)},
44 {name => 'preview', label => l('Preview'), hide => 1},
45 {name => 'addedcontent', label => l('Additional Content'), hide => hide_ac}, # hide if all content is known to not exist
46 {name => 'cnbrowse', label => l('Shelf Browser')},
47 {name => 'marchtml', label => l('MARC Record')}
50 FOREACH extra IN extras;
51 IF extra.hide; NEXT; END;
54 <div class="rdetail_extras">
55 <div class="rdetail_extras_hr"></div>
56 <div class="rdetail_extras_link">
58 IF tab_is_active(name);
59 href = mkurl('', {}, ['expand', 'ac']);
60 img_url = ctx.media_prefix _ '/images/rdetail_arrow_down.png';
62 IF name == 'addedcontent' AND default_ac;
63 href = mkurl('', {expand => name, ac => default_ac}) _ '#' _ name;
65 href = mkurl('', {expand => name}) _ '#' _ name;
67 img_url = ctx.media_prefix _ '/images/rdetail_arrow.png';
70 <a name='[% name %]' href='[% href %]'><img alt='[% extra.label %]' src='[% img_url %]'/></a>
71 <a name='[% name %]_lbl' href='[% href %]' class="rdetail_extras_lbl">[% extra.label %]</a>
74 <div class='rdetail_extras_div'>
75 [% IF tab_is_active(name);
76 IF name == 'marchtml';
78 ELSIF name == 'contents';
81 # Load the template for the selected extra
82 INCLUDE "opac/parts/record/${name}.tt2";