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 [% INCLUDE 'opac/parts/cart.tt2' %]
43 <div id="content-wrapper">
44 <div id="main-content">
45 <div id="browse-the-catalog">
46 <div id="browse-controls" class='searchbar'>
47 <form method="get" onsubmit="$('browse-submit-spinner').className = ''; return true">
48 <input type="hidden" name="blimit"
49 value="[% blimit %]" />
51 [% control_qtype = INCLUDE "opac/parts/qtype_selector.tt2"
52 id="browse-search-class" browse_only=1 plural=1 %]
54 [% control_bterm = BLOCK %]<input type="text" name="bterm" id="browse-term"
55 value="[% CGI.param('bterm') | html %]" />[% END %]
56 [% control_locg = INCLUDE build_org_selector id='browse-context'
58 arialabel=l('Select holding library') %]
59 [% l('Browse for [_1] starting with [_2] in [_3]', control_qtype, control_bterm, control_locg) %]
61 <input id='search-submit-go' type="submit" value="[% l('Browse') %]" alt="[% l('Browse') %]" class="opac-button"/>
62 <img id="browse-submit-spinner"
63 src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif[% ctx.cache_key %]"
64 class="hidden" style="width: 16px; height: 16px;"
65 alt="[% l('Search in progress icon') %]" />
69 [% BLOCK browse_pager %]
70 <div class="browse-pager">
71 [% IF ctx.back_pivot %]
72 <a class="opac-button" href="[% mkurl('', {bpivot => ctx.back_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">← [%l ('Back') %]</a>
74 [% IF ctx.pager_shortcuts;
75 current_qtype = CGI.param('qtype') || 'title' %]
76 <span class="browse-shortcuts">
77 [% FOR shortcut IN ctx.pager_shortcuts %]
78 <a href="[% mkurl('', {qtype => current_qtype, bterm => shortcut.0}, ['bpivot','query']) %]">[% shortcut.1 %]</a>
83 [% IF ctx.forward_pivot %]
84 <a class="opac-button" href="[% mkurl('', {bpivot => ctx.forward_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">[%l ('Next') %] →</a>
87 <img id="browse-pager-spinner-[% id %]"
88 src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif[% ctx.cache_key %]"
89 class="hidden" style="width: 16px; height: 16px;"
90 alt="[% l('Search in progress icon') %]" />
94 [% PROCESS browse_pager id=0 %]
96 <div id="browse-results">
97 [% IF ctx.browse_error %]
98 <span class="browse-error">
99 [% l("An error occurred browsing records. " _
100 "Please try again in a moment or report the issue " _
101 "to library staff.") %]
104 [% IF ctx.browse_leading_article_warning %]
105 <div class="browse-leading-article-warning">
106 [% l("Your browse term seems to begin with an article (a, an, the). You might get better results by omitting the article.") %]
107 [% IF ctx.browse_leading_article_alternative %]
109 [% alternative_link = BLOCK %]
110 <a href="[% mkurl('', {bterm => ctx.browse_leading_article_alternative}, ['bpivot']) %]">[% ctx.browse_leading_article_alternative | html %]</a>
111 [%- END; # alternative_link BLOCK
112 l("Did you mean [_1]?", alternative_link);
117 <ul class="browse-result-list">
118 [% FOR result IN ctx.browse_results %]
119 <li class="browse-result">
120 <span class="browse-result-value[% result.row_number == 0 && !CGI.param('bpivot') ? ' browse-result-best-match' : '' %]">
121 [% IF result.sources > 0 %] <!-- bib-linked browse value -->
123 ctx.opac_root _ '/results', {
124 'fi:has_browse_entry' => (result.browse_entry _ ',' _ result.fields)
125 }) %]">[% result.value | html %]</a>
126 <span class="browse-result-sources">([%
127 IF result.accurate == 'f';
130 result.sources %])</span>
131 [% ELSE %] <!-- only authority links -->
132 [% result.value | html %]
136 [% FOR a IN result.authorities;
137 PROCESS authority_notes authority=a IF !sees.grep(a.id);
139 [% auth_headings_ul_added = 0; %]
140 [% seenit = {}; # for headings we've rendered
141 FOR a IN result.sees;
142 # We can go no further sans control_set.
143 NEXT UNLESS a.control_set;
145 # get_authority_fields is fast and cache-y.
146 acs = ctx.get_authority_fields(a.control_set);
147 FOR field_group IN a.headings;
148 field_id = field_group.keys.0;
149 field = acs.$field_id;
150 headings = field_group.values.0;
152 # We could display headings without
153 # links here when h.target is
154 # undef, if we wanted to, but note
155 # that h.target_count is only
156 # defined when h.target is.
158 IF h.target AND h.target_count AND result.list_authorities.grep('^' _ h.target _ '$').size == 0 AND h.main_entry;
159 id = h.target; NEXT IF seenit.$id; seenit.$id = 1;
160 IF !auth_headings_ul_added;
161 # only add a <ul> if we have at least one <li> (WCAG 2.0)
162 auth_headings_ul_added = 1; %]
163 <ul class="browse-result-authority-headings">
166 <li><span class="browse-result-authority-field-name">[% heading_use_label(use=h.type) %]</span>
167 <a href="[% mkurl(ctx.opac_root _ '/browse', {bterm => h.heading}, ['bpivot']) %]">[% h.heading | html %]</a>
168 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
174 [% FOR a IN result.authorities;
175 # We can go no further sans control_set.
176 NEXT UNLESS a.control_set;
178 # get_authority_fields is fast and cache-y.
179 acs = ctx.get_authority_fields(a.control_set);
180 FOR field_group IN a.headings;
181 field_id = field_group.keys.0;
182 field = acs.$field_id;
183 headings = field_group.values.0;
185 # We could display headings without
186 # links here when h.target is
187 # undef, if we wanted to, but note
188 # that h.target_count is only
189 # defined when h.target is.
191 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';
192 id = h.target; NEXT IF seenit.$id; seenit.$id = 1;
193 IF !auth_headings_ul_added;
194 # only add a <ul> if we have at least one <li> (WCAG 2.0)
195 auth_headings_ul_added = 1; %]
196 <ul class="browse-result-authority-headings">
198 <li><span class="browse-result-authority-field-name">[% heading_use_label(use=h.type) %]</span>
199 <a href="[% mkurl(ctx.opac_root _ '/results', {query => 'identifier|authority_id[' _ h.target _ ']'}) %]">[% h.heading | html %]</a>
200 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
206 [% IF auth_headings_ul_added %]</ul>[% END %]
213 [% PROCESS browse_pager id=1 %]
216 <div class="common-full-pad"></div>
220 [% BLOCK authority_notes;
221 # Displays public general notes (sometimes called "scope notes" ?)
222 FOR note IN authority.notes %]
223 <div class="browse-public-general-note">
224 <span class="browse-public-general-note-label">
227 <span class="browse-public-general-note-body">
228 [% FOR piece IN note; piece | html; END %]
232 END; # end of BLOCK authority_notes %]