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'];
15 <div id="search-wrapper">
16 [%# XXX TODO Give searchbar.tt2 more smarts so we can just do:
17 # INCLUDE "opac/parts/searchbar.tt2" %]
19 <span class="search_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/home', {}, depart_list) %]">[% l('Search the Catalog') %]</a></span>
20 <span><a href="[% mkurl(ctx.opac_root _ '/advanced', {}, depart_list) %]"
21 id="home_adv_search_link">[%l('Advanced Search')%]</a></span>
22 <span>[% l('Browse the Catalog') %]</span>
25 <div id="content-wrapper">
26 <div id="main-content">
27 <div id="browse-the-catalog">
28 <div id="browse-controls">
29 <form method="get" onsubmit="$('browse-submit-spinner').className = ''; return true">
30 <input type="hidden" name="blimit"
31 value="[% blimit %]" />
33 [% control_qtype = INCLUDE "opac/parts/qtype_selector.tt2"
34 id="browse-search-class" browse_only=1 plural=1 %]
36 [% control_bterm = BLOCK %]<input type="text" name="bterm" id="browse-term"
37 value="[% CGI.param('bterm') | html %]" />[% END %]
38 [% control_locg = INCLUDE build_org_selector id='browse-context'
40 arialabel=l('Select holding library') %]
41 [% l('Browse for [_1] starting with [_2] in [_3]', control_qtype, control_bterm, control_locg) %]
43 <input type="submit" value="[% l('Go') %]" />
44 <img id="browse-submit-spinner" src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif" class="hidden" style="width: 16px; height: 16px;" alt="" />
48 [% BLOCK browse_pager %]
49 <div class="browse-pager">
50 [% IF ctx.back_pivot %]
51 <a class="opac-button" href="[% mkurl('', {bpivot => ctx.back_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">← [%l ('Back') %]</a>
53 [% IF browse.english_pager; # XXX how to apply i18n here?
54 current_qtype = CGI.param('qtype') || 'title' %]
55 <span class="browse-shortcuts">
56 <a href="[% mkurl('', {qtype => current_qtype, bterm => '0'}, ['bpivot']) %]">0-9</a>
57 [% FOR letter IN ['A'..'Z'] %]
58 <a href="[% mkurl('', {qtype => current_qtype, bterm => letter}, ['bpivot']) %]">[% letter %]</a>
63 [% IF ctx.forward_pivot %]
64 <a class="opac-button" href="[% mkurl('', {bpivot => ctx.forward_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">[%l ('Next') %] →</a>
67 <img id="browse-pager-spinner-[% id %]" src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif" class="hidden" style="width: 16px; height: 16px;" alt="" />
71 [% PROCESS browse_pager id=0 %]
73 <div id="browse-results">
74 [% IF ctx.browse_error %]
75 <span class="browse-error">
76 [% l("An error occurred browsing records. " _
77 "Please try again in a moment or report the issue " _
78 "to library staff.") %]
81 [% IF ctx.browse_leading_article_warning %]
82 <div class="browse-leading-article-warning">
83 [% l("Your browse term seems to begin with an article (a, an, the). You might get better results by omitting the article.") %]
84 [% IF ctx.browse_leading_article_alternative %]
86 [% alternative_link = BLOCK %]
87 <a href="[% mkurl('', {bterm => ctx.browse_leading_article_alternative}, ['bpivot']) %]">[% ctx.browse_leading_article_alternative | html %]</a>
88 [%- END; # alternative_link BLOCK
89 l("Did you mean [_1]?", alternative_link);
95 <ol class="browse-result-list">
96 [% FOR result IN ctx.browse_results %]
97 <li class="browse-result">
98 <span class="browse-result-value[% result.row_number == 0 && !CGI.param('bpivot') ? ' browse-result-best-match' : '' %]">
100 ctx.opac_root _ '/results', {
101 'fi:has_browse_entry' => (result.browse_entry _ ',' _ result.fields)
102 }) %]">[% result.value | html %]</a>
104 <span class="browse-result-sources">([%
105 IF result.accurate == 'f';
108 result.sources %])</span>
109 [% IF result.authorities.size %]
110 <ul class="browse-result-authority-headings">
111 [% FOR a IN result.authorities;
112 PROCESS authority_notes authority=a;
114 # Other than displaying public general
115 # notes, we can go no further sans
117 NEXT UNLESS a.control_set;
119 # get_authority_fields is fast and cache-y.
120 acs = ctx.get_authority_fields(a.control_set);
121 FOR field_group IN a.headings;
122 field_id = field_group.keys.0;
123 field = acs.$field_id;
124 headings = field_group.values.0;
126 # We could display headings without
127 # links here when h.target is
128 # undef, if we wanted to, but note
129 # that h.target_count is only
130 # defined when h.target is.
133 <li><span class="browse-result-authority-field-name">[% field.name %]</span>
134 <a href="[% mkurl(ctx.opac_root _ '/results', {query => 'identifier|authority_id[' _ h.target _ ']'}) %]">[% h.heading | html %]</a>
135 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
149 [% PROCESS browse_pager id=1 %]
152 <div class="common-full-pad"></div>
156 [% BLOCK authority_notes;
157 # Displays public general notes (sometimes called "scope notes" ?)
158 FOR note IN authority.notes %]
159 <div class="browse-public-general-note">
160 <span class="browse-public-general-note-label">
163 <span class="browse-public-general-note-body">
164 [% FOR piece IN note; piece | html; END %]
168 END; # end of BLOCK authority_notes %]