1 [%- # This is the bib and authority combined record browser.
4 PROCESS "opac/parts/header.tt2";
5 PROCESS "opac/parts/misc_util.tt2";
6 PROCESS "opac/parts/org_selector.tt2";
7 WRAPPER "opac/parts/base.tt2";
8 INCLUDE "opac/parts/topnav.tt2";
10 ctx.page_title = l("Browse the Catalog");
12 blimit = CGI.param('blimit') || ctx.opac_hits_per_page || 10;
14 depart_list = ['blimit', 'bterm', 'bpivot'];
15 ctx.metalinks.push('<meta name="robots" content="noindex,follow">');
16 MACRO heading_use_label BLOCK;
32 <h2 class="sr-only">[% l('Catalog Browse') %]</h2>
34 <div id="content-wrapper" class="my-5">
35 <div id="main-content" class="container mx-auto w-75">
36 <div id="browse-the-catalog">
37 <div id="browse-controls" class='row text-center'>
38 <form method="get" onsubmit="$('browse-submit-spinner').className = ''; return true" class="mx-auto">
39 <input type="hidden" name="blimit"
40 value="[% blimit %]" />
42 [% control_qtype = INCLUDE "opac/parts/qtype_selector.tt2"
43 id="browse-search-class" browse_only=1 plural=1 %]
45 [% control_bterm = BLOCK %]<input type="text" name="bterm" id="browse-term"
46 aria-label="[% l('Browse term') %]"
47 value="[% CGI.param('bterm') | html %]" class="form-control" />[% END %]
48 [% control_locg = INCLUDE build_org_selector id='browse-context'
50 arialabel=l('Select holding library') %]
51 [% l('Browse for [_1] starting with [_2] in [_3]', control_qtype, control_bterm, control_locg) %]
53 <input id='search-submit-go' type="submit" value="[% l('Browse') %]" alt="[% l('Browse') %]" class="btn btn-confirm my-2"/>
54 <img id="browse-submit-spinner"
55 src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif[% ctx.cache_key %]"
56 class="hidden" style="width: 16px; height: 16px;"
57 alt="[% l('Search in progress icon') %]" />
60 <div class="row text-center my-5 border-top border-bottom">
61 [% BLOCK browse_pager %]
62 <div class="browse-pager col-12">
64 [% IF ctx.back_pivot %]
65 <a class="btn btn-outline-primary btn-sm" href="[% mkurl('', {bpivot => ctx.back_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">← [%l ('Back') %]</a>
67 [% IF ctx.pager_shortcuts;
68 current_qtype = CGI.param('qtype') || 'title' %]
69 <span class="browse-shortcuts">
70 [% FOR shortcut IN ctx.pager_shortcuts %]
71 <a href="[% mkurl('', {qtype => current_qtype, bterm => shortcut.0}, ['bpivot','query']) %]">[% shortcut.1 %]</a>
75 <img id="browse-pager-spinner-[% id %]"
76 src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif[% ctx.cache_key %]"
77 class="hidden" style="width: 16px; height: 16px;"
78 alt="[% l('Search in progress icon') %]" />
79 [% IF ctx.forward_pivot %]
80 <a class="btn btn-outline-primary btn-sm" href="[% mkurl('', {bpivot => ctx.forward_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">[%l ('Next') %] →</a>
88 [% PROCESS browse_pager id=0 %]
90 <div id="browse-results" class="col-12">
91 [% IF ctx.browse_error %]
92 <span class="browse-error">
93 [% l("An error occurred browsing records. " _
94 "Please try again in a moment or report the issue " _
95 "to library staff.") %]
98 [% IF ctx.browse_leading_article_warning %]
99 <div class="browse-leading-article-warning">
100 [% l("Your browse term seems to begin with an article (a, an, the). You might get better results by omitting the article.") %]
101 [% IF ctx.browse_leading_article_alternative %]
103 [% alternative_link = BLOCK %]
104 <a href="[% mkurl('', {bterm => ctx.browse_leading_article_alternative}, ['bpivot']) %]">[% ctx.browse_leading_article_alternative | html %]</a>
105 [%- END; # alternative_link BLOCK
106 l("Did you mean [_1]?", alternative_link);
111 <ul class="browse-result-list">
112 [% FOR result IN ctx.browse_results %]
113 <li class="browse-result">
114 <span class="browse-result-value[% result.row_number == 0 && !CGI.param('bpivot') ? ' browse-result-best-match' : '' %]">
115 [% IF result.sources > 0 %] <!-- bib-linked browse value -->
117 ctx.opac_root _ '/results', {
118 'fi:has_browse_entry' => (result.browse_entry _ ',' _ result.fields)
119 }) %]">[% result.value | html %]</a>
120 <span class="browse-result-sources">([%
121 IF result.accurate == 'f';
124 result.sources %])</span>
125 [% ELSE %] <!-- only authority links -->
126 [% result.value | html %]
130 [% FOR a IN result.authorities;
131 PROCESS authority_notes authority=a IF !sees.grep(a.id);
133 [% auth_headings_ul_added = 0; %]
134 [% seenit = {}; # for headings we've rendered
135 FOR a IN result.sees;
136 # We can go no further sans control_set.
137 NEXT UNLESS a.control_set;
139 # get_authority_fields is fast and cache-y.
140 acs = ctx.get_authority_fields(a.control_set);
141 FOR field_group IN a.headings;
142 field_id = field_group.keys.0;
143 field = acs.$field_id;
144 headings = field_group.values.0;
146 # We could display headings without
147 # links here when h.target is
148 # undef, if we wanted to, but note
149 # that h.target_count is only
150 # defined when h.target is.
152 IF h.target AND h.target_count AND result.list_authorities.grep('^' _ h.target _ '$').size == 0 AND h.main_entry;
153 id = h.target; NEXT IF seenit.$id; seenit.$id = 1;
154 IF !auth_headings_ul_added;
155 # only add a <ul> if we have at least one <li> (WCAG 2.0)
156 auth_headings_ul_added = 1; %]
157 <ul class="browse-result-authority-headings">
160 <li><span class="browse-result-authority-field-name">[% heading_use_label(use=h.type) %]</span>
161 <a href="[% mkurl(ctx.opac_root _ '/browse', {bterm => h.heading}, ['bpivot']) %]">[% h.heading | html %]</a>
162 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
168 [% FOR a IN result.authorities;
169 # We can go no further sans control_set.
170 NEXT UNLESS a.control_set;
172 # get_authority_fields is fast and cache-y.
173 acs = ctx.get_authority_fields(a.control_set);
174 FOR field_group IN a.headings;
175 field_id = field_group.keys.0;
176 field = acs.$field_id;
177 headings = field_group.values.0;
179 # We could display headings without
180 # links here when h.target is
181 # undef, if we wanted to, but note
182 # that h.target_count is only
183 # defined when h.target is.
185 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';
186 id = h.target; NEXT IF seenit.$id; seenit.$id = 1;
187 IF !auth_headings_ul_added;
188 # only add a <ul> if we have at least one <li> (WCAG 2.0)
189 auth_headings_ul_added = 1; %]
190 <ul class="browse-result-authority-headings">
192 <li><span class="browse-result-authority-field-name">[% heading_use_label(use=h.type) %]</span>
193 <a href="[% mkurl(ctx.opac_root _ '/results', {query => 'identifier|authority_id[' _ h.target _ ']'}) %]">[% h.heading | html %]</a>
194 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
200 [% IF auth_headings_ul_added %]</ul>[% END %]
207 [% PROCESS browse_pager id=1 %]
210 <div class="common-full-pad"></div>
214 [% BLOCK authority_notes;
215 # Displays public general notes (sometimes called "scope notes" ?)
216 FOR note IN authority.notes %]
217 <div class="browse-public-general-note">
218 <span class="browse-public-general-note-label">
221 <span class="browse-public-general-note-body">
222 [% FOR piece IN note; piece | html; END %]
226 END; # end of BLOCK authority_notes %]