[%- # This is the bib and authority combined record browser. PROCESS "opac/parts/header.tt2"; PROCESS "opac/parts/misc_util.tt2"; PROCESS "opac/parts/org_selector.tt2"; WRAPPER "opac/parts/base.tt2"; INCLUDE "opac/parts/topnav.tt2"; ctx.page_title = l("Browse the Catalog"); blimit = CGI.param('blimit') || ctx.opac_hits_per_page || 10; depart_list = ['blimit', 'bterm', 'bpivot']; %]
[%# XXX TODO Give searchbar.tt2 more smarts so we can just do: # INCLUDE "opac/parts/searchbar.tt2" %]
[% control_qtype = INCLUDE "opac/parts/qtype_selector.tt2" id="browse-search-class" browse_only=1 plural=1 %] [% control_bterm = BLOCK %][% END %] [% control_locg = INCLUDE build_org_selector id='browse-context' show_loc_groups=1 arialabel=l('Select holding library') %] [% l('Browse for [_1] starting with [_2] in [_3]', control_qtype, control_bterm, control_locg) %]
[% BLOCK browse_pager %]
[% IF ctx.back_pivot %] ← [%l ('Back') %] [% END %] [% IF ctx.pager_shortcuts; current_qtype = CGI.param('qtype') || 'title' %] [% FOR shortcut IN ctx.pager_shortcuts %] [% shortcut.1 %] [% END %] [% END %] [% IF ctx.forward_pivot %] [%l ('Next') %] → [% END %]
[% END %] [% PROCESS browse_pager id=0 %]
[% IF ctx.browse_error %] [% l("An error occurred browsing records. " _ "Please try again in a moment or report the issue " _ "to library staff.") %] [% ELSE %] [% IF ctx.browse_leading_article_warning %]
[% l("Your browse term seems to begin with an article (a, an, the). You might get better results by omitting the article.") %] [% IF ctx.browse_leading_article_alternative %]

[% alternative_link = BLOCK %] [% ctx.browse_leading_article_alternative | html %] [%- END; # alternative_link BLOCK l("Did you mean [_1]?", alternative_link); END # IF %]

[% END %]
    [% FOR result IN ctx.browse_results %]
  • [% result.value | html %] ([% IF result.accurate == 'f'; l("At least"); " "; END; result.sources %]) [% IF result.authorities.size %]
      [% FOR a IN result.authorities; PROCESS authority_notes authority=a; # Other than displaying public general # notes, we can go no further sans # control_set. NEXT UNLESS a.control_set; # get_authority_fields is fast and cache-y. acs = ctx.get_authority_fields(a.control_set); FOR field_group IN a.headings; field_id = field_group.keys.0; field = acs.$field_id; headings = field_group.values.0; FOR h IN headings; # We could display headings without # links here when h.target is # undef, if we wanted to, but note # that h.target_count is only # defined when h.target is. IF h.target AND h.target_count %]
    • [% field.name %] [% h.heading | html %] ([% h.target_count %])
    • [% END %] [% END %] [% END %] [% END %]
    [% END %]
  • [% END %]
[% END %]
[% PROCESS browse_pager id=1 %]
[% BLOCK authority_notes; # Displays public general notes (sometimes called "scope notes" ?) FOR note IN authority.notes %]
[% l("Note:") %] [% FOR piece IN note; piece | html; END %]
[% END; END; # end of BLOCK authority_notes %] [% END %]