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 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>
22 <span class="browse_the_catalog_lbl">[% 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 ctx.pager_shortcuts;
54 current_qtype = CGI.param('qtype') || 'title' %]
55 <span class="browse-shortcuts">
56 [% FOR shortcut IN ctx.pager_shortcuts %]
57 <a href="[% mkurl('', {qtype => current_qtype, bterm => shortcut.0}, ['bpivot','query']) %]">[% shortcut.1 %]</a>
62 [% IF ctx.forward_pivot %]
63 <a class="opac-button" href="[% mkurl('', {bpivot => ctx.forward_pivot}) %]" onclick="$('browse-pager-spinner-[% id %]').className = '';">[%l ('Next') %] →</a>
66 <img id="browse-pager-spinner-[% id %]" src="[% ctx.media_prefix %]/opac/images/progressbar_green.gif" class="hidden" style="width: 16px; height: 16px;" alt="" />
70 [% PROCESS browse_pager id=0 %]
72 <div id="browse-results">
73 [% IF ctx.browse_error %]
74 <span class="browse-error">
75 [% l("An error occurred browsing records. " _
76 "Please try again in a moment or report the issue " _
77 "to library staff.") %]
80 [% IF ctx.browse_leading_article_warning %]
81 <div class="browse-leading-article-warning">
82 [% l("Your browse term seems to begin with an article (a, an, the). You might get better results by omitting the article.") %]
83 [% IF ctx.browse_leading_article_alternative %]
85 [% alternative_link = BLOCK %]
86 <a href="[% mkurl('', {bterm => ctx.browse_leading_article_alternative}, ['bpivot']) %]">[% ctx.browse_leading_article_alternative | html %]</a>
87 [%- END; # alternative_link BLOCK
88 l("Did you mean [_1]?", alternative_link);
94 <ul class="browse-result-list">
95 [% FOR result IN ctx.browse_results %]
96 <li class="browse-result">
97 <span class="browse-result-value[% result.row_number == 0 && !CGI.param('bpivot') ? ' browse-result-best-match' : '' %]">
99 ctx.opac_root _ '/results', {
100 'fi:has_browse_entry' => (result.browse_entry _ ',' _ result.fields)
101 }) %]">[% result.value | html %]</a>
103 <span class="browse-result-sources">([%
104 IF result.accurate == 'f';
107 result.sources %])</span>
108 [% IF result.authorities.size %]
109 <ul class="browse-result-authority-headings">
110 [% FOR a IN result.authorities;
111 PROCESS authority_notes authority=a;
113 # Other than displaying public general
114 # notes, we can go no further sans
116 NEXT UNLESS a.control_set;
118 # get_authority_fields is fast and cache-y.
119 acs = ctx.get_authority_fields(a.control_set);
120 FOR field_group IN a.headings;
121 field_id = field_group.keys.0;
122 field = acs.$field_id;
123 headings = field_group.values.0;
125 # We could display headings without
126 # links here when h.target is
127 # undef, if we wanted to, but note
128 # that h.target_count is only
129 # defined when h.target is.
131 IF h.target AND h.target_count %]
132 <li><span class="browse-result-authority-field-name">[% field.name %]</span>
133 <a href="[% mkurl(ctx.opac_root _ '/results', {query => 'identifier|authority_id[' _ h.target _ ']'}) %]">[% h.heading | html %]</a>
134 <span class="browse-result-authority-bib-links">([% h.target_count %])</span>
148 [% PROCESS browse_pager id=1 %]
151 <div class="common-full-pad"></div>
155 [% BLOCK authority_notes;
156 # Displays public general notes (sometimes called "scope notes" ?)
157 FOR note IN authority.notes %]
158 <div class="browse-public-general-note">
159 <span class="browse-public-general-note-label">
162 <span class="browse-public-general-note-body">
163 [% FOR piece IN note; piece | html; END %]
167 END; # end of BLOCK authority_notes %]