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 [% FOREACH facets_loo IN facets_loop %]
43 [% IF facets_loo.facets.size > 0 %]
44 <li id="[% facets_loo.type_id | html %]">
45 [% SWITCH facets_loo.label %]
47 <h3 id="facet-authors">Authors</h3>
49 <h3 id="facet-titles">Titles</h3>
51 <h3 id="facet-topics">Topics</h3>
53 <h3 id="facet-places">Places</h3>
55 <h3 id="facet-series">Series</h3>
56 [% CASE 'ItemTypes' %]
57 <h3 id="facet-itemtypes">Item types</h3>
58 [% CASE 'Home libraries' %]
59 <h3 id="facet-home-libraries">Home libraries</h3>
60 [% CASE 'Holding libraries' %]
61 <h3 id="facet-holding-libraries">Holding libraries</h3>
63 <h3 id="facet-locations">Locations</h3>
64 [% CASE 'Collections' %]
65 <h3 id="facet-collections">Collections</h3>
66 [% CASE 'Languages' %]
67 <h3 id="facet-languages">Languages</h3>
69 <h3 id="facet-[% facets_loo.type_link_value | html %]">[% facets_loo.label | html %]</h3>
72 [% SET url = "/cgi-bin/koha/opac-search.pl?" _ query_cgi _ limit_cgi %]
74 [% url = BLOCK %][% url | $raw %][% "&sort_by=" _ sort_by | url %][% END %]
76 [% IF ( results_per_page ) %]
77 [% url = BLOCK %][% url | $raw %][% "&count=" _ results_per_page | url %][% END %]
79 [% FOREACH facet IN facets_loo.facets %]
80 [% IF facets_loo.label == 'Collections' %][% SET facet.facet_label_value = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => facet.facet_label_value, opac =>1 ) || facet.facet_label_value %][% END %]
81 [% IF facets_loo.label == 'Language' %][% SET facet.facet_label_value = Languages.GetByISOCode(lang,facet.facet_label_value) || facet.facet_label_value %][% END %]
82 [% IF loop.count > 5 && !facet.active %]
83 <li class="collapsible-facet" style="display:none">
88 [% local_url = BLOCK %][% url | $raw %][% "&nolimit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %]
89 <span class="facet-label">[% facet.facet_label_value | html %]</span>
90 [% IF ( displayFacetCount ) %]
91 <span class="facet-count-selected">([% facet.facet_count | html %])</span>
93 [<a href="[% local_url | $raw %]" title="Remove facet [% facet.facet_label_value | html %]">x</a>]
95 [% local_url = BLOCK %][% url | $raw %][% "&limit=" _ facet.type_link_value _ ":" _ facet.facet_link_value | url %][% END %]
96 <span class="facet-label"><a href="[% local_url | $raw %]" title="[% facet.facet_title_value | html %]">[% facet.facet_label_value | html %]</a></span>
97 [% IF ( displayFacetCount ) %]
98 <span class="facet-count"> ([% facet.facet_count | html %])</span>
103 [% IF facets_loo.facets.size > 5 %]
104 <li class="moretoggle">
105 [% SET aria_label = t("Show more") %]
106 [% SWITCH facets_loo.label %]
108 [% aria_label = t("Show more authors") %]
110 [% aria_label = t("Show more titles") %]
112 [% aria_label = t("Show more topics") %]
114 [% aria_label = t("Show more places") %]
116 [% aria_label = t("Show more series") %]
117 [% CASE 'ItemTypes' %]
118 [% aria_label = t("Show more item types") %]
119 [% CASE 'Home libraries' %]
120 [% aria_label = t("Show more home libraries") %]
121 [% CASE 'Holding libraries' %]
122 [% aria_label = t("Show more holding libraries") %]
123 [% CASE 'Location' %]
124 [% aria_label = t("Show more home locations") %]
125 [% CASE 'Collections' %]
126 [% aria_label = t("Show more home collections") %]
127 [% CASE 'Languages' %]
128 [% aria_label = t("Show more home languages") %]
131 <a href="#" aria-label="[% aria_label | html | trim %]"><strong>Show more</strong></a>
133 <li class="moretoggle" style="display:none">
134 [% SET aria_label = t("Show more") %]
135 [% SWITCH facets_loo.label %]
137 [% aria_label = t("Show fewer authors") %]
139 [% aria_label = t("Show fewer titles") %]
141 [% aria_label = t("Show fewer topics") %]
143 [% aria_label = t("Show fewer places") %]
145 [% aria_label = t("Show fewer series") %]
146 [% CASE 'ItemTypes' %]
147 [% aria_label = t("Show fewer item types") %]
148 [% CASE 'Home libraries' %]
149 [% aria_label = t("Show fewer home libraries") %]
150 [% CASE 'Holding libraries' %]
151 [% aria_label = t("Show fewer holding libraries") %]
152 [% CASE 'Location' %]
153 [% aria_label = t("Show fewer home locations") %]
154 [% CASE 'Collections' %]
155 [% aria_label = t("Show fewer home collections") %]
156 [% CASE 'Languages' %]
157 [% aria_label = t("Show fewer home languages") %]
161 <a href="#" aria-label="[% aria_label | html | trim %]"><strong>Show less</strong></a>
167 [% END # / IF facets_loo.facets.size > 0 %]
168 [% END # / FOREACH facets_loo %]
170 </div> <!-- / #search-facets -->
172 [% IF ( OPACResultsSidebar ) %]
173 <div id="opacresultssidebar">
174 [% PROCESS koha_news_block news => OPACResultsSidebar %]
177 [% END # / IF opacfacets && facets_loop %]