1 [%- # This is the bib and authority combined record browser.
3 PROCESS "opac/parts/header.tt2";
4 PROCESS "opac/parts/misc_util.tt2";
5 PROCESS "opac/parts/org_selector.tt2";
6 WRAPPER "opac/parts/base.tt2";
7 INCLUDE "opac/parts/topnav.tt2";
9 ctx.page_title = l("Browse the Catalog");
10 blimit = CGI.param('blimit') || ctx.opac_hits_per_page || 10;
12 depart_list = ['blimit', 'bterm', 'bpivot'];
13 ctx.metalinks.push('<meta name="robots" content="noindex,follow">');
14 MACRO heading_use_label BLOCK;
30 <h2 class="sr-only">[% l('Catalog Browse') %]</h2>
31 <div id="search-wrapper">
32 [%# XXX TODO Give searchbar.tt2 more smarts so we can just do:
33 # INCLUDE "opac/parts/searchbar.tt2" %]
35 <span class="search_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/home', {}, depart_list) %]">[% l('Basic Search') %]</a></span>
36 <span class="adv_search_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/advanced', {}, depart_list) %]"
37 id="home_adv_search_link">[%l('Advanced Search')%]</a></span>
39 <span class="browse_the_catalog_lbl mobile_hide">[% l('Browse the Catalog') %]</span>
40 [% IF ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1 %]
41 <span class="search_courses_label"><a href="[% mkurl(ctx.opac_root _ '/course_search') %]">[% l('Search for Courses') %]</a></span>
42 <span class="search_courses_label"><a href="[% mkurl(ctx.opac_root _ '/course_browse') %]">[% l('Browse for Courses') %]</a></span>
45 [% INCLUDE 'opac/parts/cart.tt2' %]
48 <div id="content-wrapper">
49 <div id="main-content">
50 <div id="browse-the-catalog">
51 <div id="browse-controls" class='searchbar'>
52 <form method="get" onsubmit="$('browse-submit-spinner').className = ''; return true">
53 <input type="hidden" name="blimit"
54 value="[% blimit | html %]" />
56 [% control_qtype = INCLUDE "opac/parts/qtype_selector.tt2"
57 id="browse-search-class" browse_only=1 plural=1 %]
59 [% control_bterm = BLOCK %]<input type="text" name="bterm" id="browse-term"
60 aria-label="[% l('Browse term') %]"
61 value="[% CGI.param('bterm') | html %]" />[% END %]
62 [% control_locg = INCLUDE build_org_selector id='browse-context'
64 arialabel=l('Select holding library') %]
65 [% l('Browse for [_1] starting with [_2] in [_3]', control_qtype, control_bterm, control_locg) %]
67 <input id='search-submit-go' type="submit" value="[% l('Browse') %]" alt="[% l('Browse') %]" class="opac-button"/>
68 <img id="browse-submit-spinner"
69 src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif[% ctx.cache_key %]"
70 class="hidden" style="width: 16px; height: 16px;"
71 alt="[% l('Search in progress icon') %]" />
75 [% BLOCK browse_pager %]
76 <div class="browse-pager">
77 [% IF ctx.back_pivot %]
78 <a class="opac-button" href="[% mkurl('', {bpivot => ctx.back_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">← [%l ('Back') %]</a>
80 [% IF ctx.pager_shortcuts;
81 current_qtype = CGI.param('qtype') || 'title' %]
82 <span class="browse-shortcuts">
83 [% FOR shortcut IN ctx.pager_shortcuts %]
84 <a href="[% mkurl('', {qtype => current_qtype, bterm => shortcut.0}, ['bpivot','query']) %]">[% shortcut.1 %]</a>
89 [% IF ctx.forward_pivot %]
90 <a class="opac-button" href="[% mkurl('', {bpivot => ctx.forward_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">[%l ('Next') %] →</a>
93 <img id="browse-pager-spinner-[% id %]"
94 src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif[% ctx.cache_key %]"
95 class="hidden" style="width: 16px; height: 16px;"
96 alt="[% l('Search in progress icon') %]" />
100 [% PROCESS browse_pager id=0 %]
102 <div id="browse-results">
103 [% IF ctx.browse_error %]
104 <span class="browse-error">
105 [% l("An error occurred browsing records. " _
106 "Please try again in a moment or report the issue " _
107 "to library staff.") %]
110 [% IF ctx.browse_leading_article_warning %]
111 <div class="browse-leading-article-warning">
112 [% l("Your browse term seems to begin with an article (a, an, the). You might get better results by omitting the article.") %]
113 [% IF ctx.browse_leading_article_alternative %]
115 [% alternative_link = BLOCK %]
116 <a href="[% mkurl('', {bterm => ctx.browse_leading_article_alternative}, ['bpivot']) %]">[% ctx.browse_leading_article_alternative | html %]</a>
117 [%- END; # alternative_link BLOCK
118 l("Did you mean [_1]?", alternative_link);
123 <ul class="browse-result-list">
124 [% FOR result IN ctx.browse_results %]
125 <li class="browse-result">
126 <span class="browse-result-value[% result.row_number == 0 && !CGI.param('bpivot') ? ' browse-result-best-match' : '' %]">
127 [% IF result.sources > 0 %] <!-- bib-linked browse value -->
129 ctx.opac_root _ '/results', {
130 'fi:has_browse_entry' => (result.browse_entry _ ',' _ result.fields)
131 }) %]">[% result.value | html %]</a>
132 <span class="browse-result-sources">([%
133 IF result.accurate == 'f';
136 result.sources %])</span>
137 [% ELSE %] <!-- only authority links -->
138 [% result.value | html %]
142 [% FOR a IN result.authorities;
143 PROCESS authority_notes authority=a IF !sees.grep(a.id);
145 [% auth_headings_ul_added = 0; %]
146 [% seenit = {}; # for headings we've rendered
147 FOR a IN result.sees;
148 # We can go no further sans control_set.
149 NEXT UNLESS a.control_set;
151 # get_authority_fields is fast and cache-y.
152 acs = ctx.get_authority_fields(a.control_set);
153 FOR field_group IN a.headings;
154 field_id = field_group.keys.0;
155 field = acs.$field_id;
156 headings = field_group.values.0;
158 # We could display headings without
159 # links here when h.target is
160 # undef, if we wanted to, but note
161 # that h.target_count is only
162 # defined when h.target is.
164 IF h.target AND h.target_count AND result.list_authorities.grep('^' _ h.target _ '$').size == 0 AND h.main_entry;
165 id = h.target; NEXT IF seenit.$id; seenit.$id = 1;
166 IF !auth_headings_ul_added;
167 # only add a <ul> if we have at least one <li> (WCAG 2.0)
168 auth_headings_ul_added = 1; %]
169 <ul class="browse-result-authority-headings">
172 <li><span class="browse-result-authority-field-name">[% heading_use_label(use=h.type) %]</span>
173 <a href="[% mkurl(ctx.opac_root _ '/browse', {bterm => h.heading}, ['bpivot']) %]">[% h.heading | html %]</a>
174 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
180 [% FOR a IN result.authorities;
181 # We can go no further sans control_set.
182 NEXT UNLESS a.control_set;
184 # get_authority_fields is fast and cache-y.
185 acs = ctx.get_authority_fields(a.control_set);
186 FOR field_group IN a.headings;
187 field_id = field_group.keys.0;
188 field = acs.$field_id;
189 headings = field_group.values.0;
191 # We could display headings without
192 # links here when h.target is
193 # undef, if we wanted to, but note
194 # that h.target_count is only
195 # defined when h.target is.
197 IF h.target AND h.target_count AND result.list_sees.grep('^' _ h.target _ '$').size == 0 AND !h.main_entry AND ctx.get_cgf('opac.show_related_headings_in_browse').enabled == 't';
198 id = h.target; NEXT IF seenit.$id; seenit.$id = 1;
199 IF !auth_headings_ul_added;
200 # only add a <ul> if we have at least one <li> (WCAG 2.0)
201 auth_headings_ul_added = 1; %]
202 <ul class="browse-result-authority-headings">
204 <li><span class="browse-result-authority-field-name">[% heading_use_label(use=h.type) %]</span>
205 <a href="[% mkurl(ctx.opac_root _ '/results', {query => 'identifier|authority_id[' _ h.target _ ']'}) %]">[% h.heading | html %]</a>
206 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
212 [% IF auth_headings_ul_added %]</ul>[% END %]
219 [% PROCESS browse_pager id=1 %]
222 <div class="common-full-pad"></div>
226 [% BLOCK authority_notes;
227 # Displays public general notes (sometimes called "scope notes" ?)
228 FOR note IN authority.notes %]
229 <div class="browse-public-general-note">
230 <span class="browse-public-general-note-label">
233 <span class="browse-public-general-note-body">
234 [% FOR piece IN note; piece | html; END %]
238 END; # end of BLOCK authority_notes %]