2 [% USE AuthorisedValues %]
4 [% PROCESS 'i18n.inc' %]
5 [% USE AdditionalContents %]
6 [% SET OPACResultsSidebar = AdditionalContents.get( location => "OPACResultsSidebar", lang => lang, library => logged_in_user.branchcode || default_branch ) %]
7 [% IF ( opacfacets && facets_loop && total ) %]
8 <div id="search-facets">
9 <h2><a href="#" class="menu-collapse-toggle">Refine your search</a></h2>
10 <ul class="menu-collapse">
11 [% IF Koha.Preference("SavedSearchFilters") && search_filters.size > 0 %]
12 <li id="search-filters">
13 <h3 id="filter_facets">Custom search filters</h3>
15 [% SET base_url = "/cgi-bin/koha/opac-search.pl?" _ query_cgi _ limit_cgi %]
16 [% FOREACH search_filter IN search_filters %]
17 [% SET search_filter_id = search_filter.id | uri %]
19 [% IF active_filters.${search_filter.id} %]
20 <span class="filter_label">[% search_filter.name | html %]<a href="[% base_url _ '&nolimit=search_filter:' _ search_filter_id | $raw %]">[x]</a></span>
22 <span class="filter_label"><a href="[% base_url _ '&limit=search_filter:' _ search_filter_id | $raw %]">[% search_filter.name | html %]</a></span>
29 <li id="availability_facet"><h3 id="facet-availability">Availability</h3>
32 [% IF ( available ) %]
33 <strong>Showing only records with available items</strong></li><li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi_not_availablity | $raw %][% IF ( sort_by ) %]&sort_by=[% sort_by |uri %][% END %]">Show all records</a>
35 <a href="/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %][% IF ( sort_by ) %]&sort_by=[% sort_by |uri %][% END %]&limit=available">Limit to records with available items</a>
39 [% IF ( related ) %] <li>(related searches: [% FOREACH relate IN related %][% relate.related_search | html %][% END %])</li>[% END %]
42 [% SET more_less_labels = {} %]
43 [% more_less_labels.Authors = { more = t("Show more authors"), less = t("Show fewer authors") } %]
44 [% more_less_labels.Titles = { more = t("Show more titles"), less = t("Show fewer titles") } %]
45 [% more_less_labels.Topics = { more = t("Show more topics"), less = t("Show fewer topics") } %]
46 [% more_less_labels.Places = { more = t("Show more places"), less = t("Show fewer places") } %]
47 [% more_less_labels.Series = { more = t("Show more series"), less = t("Show fewer series") } %]
48 [% more_less_labels.ItemTypes = { more = t("Show more item types"), less = t("Show fewer item types") } %]
49 [% more_less_labels.CollectionCodes = { more = t("Show more collections"), less = t("Show fewer collections") } %]
50 [% more_less_labels.Language = { more = t("Show more languages"), less = t("Show fewer languages") } %]
51 [% more_less_labels.HomeLibrary = { more = t("Show more home libraries"), less = t("Show fewer home libraries") } %]
52 [% more_less_labels.HoldingLibrary = { more = t("Show more holding libraries"), less = t("Show fewer holding libraries") } %]
53 [% more_less_labels.Location = { more = t("Show more locations"), less = t("Show fewer locations") } %]
54 [% FOREACH facets_loo IN facets_loop %]
55 [% IF facets_loo.facets.size > 0 %]
56 <li id="[% facets_loo.type_id | html %]">
57 [% SWITCH facets_loo.label %]
59 <h3 id="facet-authors">Authors</h3>
61 <h3 id="facet-titles">Titles</h3>
63 <h3 id="facet-topics">Topics</h3>
65 <h3 id="facet-places">Places</h3>
67 <h3 id="facet-series">Series</h3>
68 [% CASE 'ItemTypes' %]
69 <h3 id="facet-itemtypes">Item types</h3>
70 [% CASE 'homelibrary' %]
71 <h3 id="facet-home-libraries">Home libraries</h3>
72 [% CASE 'HoldingLibrary' %]
73 <h3 id="facet-holding-libraries">Holding libraries</h3>
75 <h3 id="facet-locations">Locations</h3>
76 [% CASE 'CollectionCodes' %]
77 <h3 id="facet-collections">Collections</h3>
78 [% CASE 'Languages' %]
79 <h3 id="facet-languages">Languages</h3>
81 <h3 id="facet-[% facets_loo.type_link_value | html %]">[% facets_loo.label | html %]</h3>
84 [% SET url = "/cgi-bin/koha/opac-search.pl?" _ query_cgi _ limit_cgi %]
86 [% url = BLOCK %][% url | $raw %][% "&sort_by=" _ sort_by | url %][% END %]
88 [% IF ( results_per_page ) %]
89 [% url = BLOCK %][% url | $raw %][% "&count=" _ results_per_page | url %][% END %]
91 [% FOREACH facet IN facets_loo.facets %]
92 [% IF facets_loo.type_label_CollectionCodes %][% SET facet.facet_label_value = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => facet.facet_label_value, opac =>1 ) || facet.facet_label_value %][% END %]
93 [% IF facets_loo.type_label_Language %][% SET facet.facet_label_value = Languages.GetByISOCode(lang,facet.facet_label_value) || facet.facet_label_value %][% END %]
94 [% IF loop.count > 5 && !facet.active %]
95 <li class="collapsible-facet" style="display:none">
100 [% local_url = BLOCK %][% url | $raw %][% "&nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %]
101 <span class="facet-label">[% facet.facet_label_value | html %]</span>
102 [% IF ( displayFacetCount ) %]
103 <span class="facet-count-selected">([% facet.facet_count | html %])</span>
105 [<a href="[% local_url | $raw %]" title="Remove facet [% facet.facet_label_value | html %]">x</a>]
107 [% local_url = BLOCK %][% url | $raw %][% "&limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %]
108 <span class="facet-label"><a href="[% local_url | $raw %]" title="[% facet.facet_title_value | html %]">[% facet.facet_label_value | html %]</a></span>
109 [% IF ( displayFacetCount ) %]
110 <span class="facet-count"> ([% facet.facet_count | html %])</span>
115 [% IF facets_loo.facets.size > 5 %]
116 <li class="moretoggle">
117 [% FOR label IN more_less_labels.keys %]
118 [% IF facets_loo.item('type_label_' _ label) %]
119 <a href="#" aria-label="[% more_less_labels.item(label).more || t('Show more') | html | trim %]"><strong>Show more</strong></a>
123 <li class="moretoggle" style="display:none">
124 [% FOR label IN more_less_labels.keys %]
125 [% IF facets_loo.item('type_label_' _ label) %]
126 <a href="#" aria-label="[% more_less_labels.item(label).less || t('Show less') | html | trim %]"><strong>Show less</strong></a>
133 [% END # / IF facets_loo.facets.size > 0 %]
134 [% END # / FOREACH facets_loo %]
136 </div> <!-- / #search-facets -->
138 [% IF ( OPACResultsSidebar ) %]
139 <div id="opacresultssidebar">
140 [% PROCESS koha_news_block news => OPACResultsSidebar %]
143 [% END # / IF opacfacets && facets_loop %]