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('Basic Search') %]</a></span>
20 <span class="adv_search_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/advanced', {}, depart_list) %]"
21 id="home_adv_search_link">[%l('Advanced Search')%]</a></span>
23 <span class="browse_the_catalog_lbl mobile_hide">[% l('Browse the Catalog') %]</span>
26 <div id="content-wrapper">
27 <div id="main-content">
28 <div id="browse-the-catalog">
29 <div id="browse-controls" class='searchbar'>
30 <form method="get" onsubmit="$('browse-submit-spinner').className = ''; return true">
31 <input type="hidden" name="blimit"
32 value="[% blimit %]" />
34 [% control_qtype = INCLUDE "opac/parts/qtype_selector.tt2"
35 id="browse-search-class" browse_only=1 plural=1 %]
37 [% control_bterm = BLOCK %]<input type="text" name="bterm" id="browse-term"
38 value="[% CGI.param('bterm') | html %]" />[% END %]
39 [% control_locg = INCLUDE build_org_selector id='browse-context'
41 arialabel=l('Select holding library') %]
42 [% l('Browse for [_1] starting with [_2] in [_3]', control_qtype, control_bterm, control_locg) %]
44 <input id='search-submit-go' type="submit" value="[% l('Browse') %]" alt="[% l('Browse') %]" class="opac-button"/>
45 <img id="browse-submit-spinner" src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif" class="hidden" style="width: 16px; height: 16px;" alt="" />
49 [% BLOCK browse_pager %]
50 <div class="browse-pager">
51 [% IF ctx.back_pivot %]
52 <a class="opac-button" href="[% mkurl('', {bpivot => ctx.back_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">← [%l ('Back') %]</a>
54 [% IF ctx.pager_shortcuts;
55 current_qtype = CGI.param('qtype') || 'title' %]
56 <span class="browse-shortcuts">
57 [% FOR shortcut IN ctx.pager_shortcuts %]
58 <a href="[% mkurl('', {qtype => current_qtype, bterm => shortcut.0}, ['bpivot','query']) %]">[% shortcut.1 %]</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 <ul 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.
132 IF h.target AND h.target_count %]
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 %]