[%- # 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']; ctx.metalinks.push(''); MACRO heading_use_label BLOCK; SWITCH use; CASE 'variant'; l('See'); CASE 'broader'; l('Broader term'); CASE 'narrower'; l('Narrower term'); CASE 'other'; l('Related term'); CASE; l('See'); END; END; %]

[% l('Catalog Browse') %]

[%# XXX TODO Give searchbar.tt2 more smarts so we can just do: # INCLUDE "opac/parts/searchbar.tt2" %]
[% 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 %]
  • [% IF result.sources > 0 %] [% result.value | html %] ([% IF result.accurate == 'f'; l("At least"); " "; END; result.sources %]) [% ELSE %] [% result.value | html %] [% END %] [% FOR a IN result.authorities; PROCESS authority_notes authority=a IF !sees.grep(a.id); END %] [% auth_headings_ul_added = 0; %] [% seenit = {}; # for headings we've rendered FOR a IN result.sees; # 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 AND result.list_authorities.grep('^' _ h.target _ '$').size == 0 AND h.main_entry; id = h.target; NEXT IF seenit.$id; seenit.$id = 1; IF !auth_headings_ul_added; # only add a
      if we have at least one
    • (WCAG 2.0) auth_headings_ul_added = 1; %]
        [% END %]
      • [% heading_use_label(use=h.type) %] [% h.heading | html %] ([% h.target_count %])
      • [% END %] [% END %] [% END %] [% END %] [% FOR a IN result.authorities; # 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 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'; id = h.target; NEXT IF seenit.$id; seenit.$id = 1; IF !auth_headings_ul_added; # only add a
          if we have at least one
        • (WCAG 2.0) auth_headings_ul_added = 1; %]
            [% END %]
          • [% heading_use_label(use=h.type) %] [% h.heading | html %] ([% h.target_count %])
          • [% END %] [% END %] [% END %] [% END %] [% IF auth_headings_ul_added %]
          [% 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 %]