1 <div class="facet_box_wrapper">
3 <div id="sidebar_search_options">
4 <form action="[% ctx.opac_root %]/results" method="get">
5 <div id="hidden_search_bar">
6 [% INCLUDE "opac/parts/searchbar.tt2" took_care_of_form=1 %]
8 <h3 class="sr-only">[% l('Additional search filters and navigation') %]</h3>
9 <h4>Search Result Options</h4>
10 <div class="almost-content-wrapper">
12 [%# hide the header bar when displaying metarecord constituents
13 instead of skipping it altogether to allow the search form
14 variables to propagate %]
16 mr_attrs = {marc_xml => ctx.metarecord_master.marc_xml};
17 PROCESS get_marc_attrs args=mr_attrs %]
18 <div class="results_header_lbl">
19 [% l('Viewing Results for Grouped Record: [_1]',
20 mr_attrs.title) | html %]
22 [% IF CGI.param('query') %]
24 <a href="[% mkurl(ctx.opac_root _ '/results', {}, ['metarecord','page']); %]">
25 [% l('◄ Return to Grouped Search Results') %]
31 <div [%- IF ctx.metarecord %]class="hidden"[% END -%]>
33 <div id="results_header_sort" class="results_header_btns">
34 <label class="sr-only" for="opac.result.sort">[% l('Sort by') %]</label>
35 [% INCLUDE "opac/parts/filtersort.tt2" value=CGI.param('sort') submit_on_change=1 %]
37 <div id="results_another_search" class="results_header_btns">
38 <a href="[% mkurl(ctx.opac_root _ '/home', {$loc_name => loc_value, 'detail_record_view' => show_detail_view}, 1) %]">[% l('Another Search') %]</a>
40 <div id="refine_hits" class="results_header_btns result_block_visible">
41 <a onclick="getFacety();">[% l('Refine these results') %]</a>
43 <div id="return_to_hits" class="results_header_btns">
44 <a onclick="getResulty();">[% l('Back to results') %]</a>
47 [% IF ctx.mylist.size %]
48 <div class="results_header_btns">
50 <a href="[% mkurl(ctx.opac_root _ '/myopac/lists') %]">[% l('View My List') %]</a>
52 <a href="[% mkurl(ctx.opac_root _ '/mylist') %]">[% l('View My List') %]</a>
58 [%- IF show_more_details.default != 'hide' -%]
59 <div class='results_header_sel' id='simple-detail-view-links'>
60 [% IF show_detail_view %]
61 <a href="[% mkurl('', {detail_record_view => 0}) %]">[% l('Show Fewer Details') %]</a> [% ELSE %]
62 <a href="[% mkurl('', {detail_record_view => 1}) %]">[% l('Show More Details') %]</a>
67 <div id="results_check_options">
68 <label id="results_limit_to_available" class="results_header_lbl" for="limit_to_available">
69 <input type="checkbox" id="limit_to_available" name="modifier" value="available"
70 onchange="search_modifier_onchange('available', this, true)"
71 [% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %] />
72 [% l('Limit to Available Items') %]
75 [% IF NOT metarecords.disabled %]
76 <label id="results_metabib_search_modifier" class="results_header_lbl" for="metabib_search_modifier">
77 <input type="checkbox" id="metabib_search_modifier"
78 name="modifier" value="metabib"
79 onchange="search_modifier_onchange('metabib', this, true)"
80 [% CGI.param('modifier').grep('metabib').size ? ' checked="checked"' : '' %] />
81 [% l('Group Formats and Editions') %]
85 [% IF ctx.depth_sel_checkbox %]
86 <label id="results_depth_sel" class="results_header_lbl" for="depth_sel" title="[% ctx.depth_sel_tooltip | html %]">
87 <input type="checkbox" id="depth_sel" name="depth" value="[% ctx.depth_sel_depth %]"
88 onchange="this.form.submit()"
89 [% CGI.param('depth') == ctx.depth_sel_depth ? ' checked="checked"' : '' %] />
90 [% ctx.depth_sel_checkbox_label | html %]
94 [% IF ctx.exclude_electronic_checkbox %]
95 <label id="results_exclude_elec" class="results_header_lbl" for='opac.result.excludeelec'>
96 <input type='checkbox' id='opac.result.excludeelec' name="fi:-search_format" value="electronic"
97 onchange="exclude_onchange(this)"
98 [%- CGI.param('fi:-search_format').grep('electronic').size ? ' checked="checked"' : '' %] />
99 [% l("Exclude Electronic Resources") %]
114 long_facets = CGI.param('long_facet') || [];
115 selected_facets = CGI.param('facet') || [];
117 # sorted list of search facets
120 # we'll clobber the facet. "namespace" later
121 # Provide a default value if unset in config.tt2
122 DEFAULT_DISPLAY_COUNT = facet.default_display_count || 5;
126 # facet display configuration present. Traverse the
127 # configuration lists, find the matching facets from
128 # search facet data, and append them to the sorted
131 FOR display_chunk IN facet.display;
132 FOR display_field IN display_chunk.facet_order;
133 # find the matching facet in the facet data
134 FOR facet IN ctx.search_facets.values;
135 IF facet.cmf.field_class == display_chunk.facet_class
136 AND facet.cmf.name == display_field;
137 sorted_facets.push(facet);
145 # No facet display configuration is present.
146 # show all facets, sorted by name.
148 # collect facet type labels for easier sorting
150 FOR facet IN ctx.search_facets.values;
151 labels.push(facet.cmf.label);
154 # We used to do a sort here, but now that's handled in EGCatLoader.
155 sorted_facets = ctx.search_facets.values;
158 display_count_by_cmf = {};
160 FOR facet IN sorted_facets;
161 fclass = facet.cmf.field_class;
162 fname = facet.cmf.name;
164 long_key = fclass _ fname %]
166 <div class="facet_box_temp">
168 [% IF long_facets.grep(long_key).0;
170 FOR fct IN long_facets;
175 expand_url = mkurl('', {long_facet => new_long});
176 IF new_long.size == 0;
177 expand_url = mkurl('', {}, ['long_facet']);
180 <a class="button" href="[% expand_url %]"
181 title="[% l('Show Fewer [_1] Entries', facet.cmf.label) %]" rel="nofollow" vocab="">
184 [% ELSIF facet.data.size > DEFAULT_DISPLAY_COUNT %]
186 title="[% l('Show More [_1] Entries', facet.cmf.label) %]"
187 href="[% mkurl('', {long_facet => long_facets.merge([long_key])}) %]" rel="nofollow" vocab="">
191 <h4 class="title">[% facet.cmf.label %]</h4>
193 <div class="box_wrapper">
195 [% FOR facet_data IN facet.data;
196 display_value = facet_data.value | html;
197 param_string = fclass _ '|' _ fname _ '[' _ facet_data.value _ ']';
200 FOR selected IN selected_facets;
201 IF selected == param_string;
204 new_facets.push(selected);
208 display_count_by_cmf.$fid = display_count_by_cmf.$fid || 0;
210 NEXT UNLESS long_facets.grep(long_key).0 OR
211 display_count_by_cmf.$fid < DEFAULT_DISPLAY_COUNT;
213 # fix syntax highlighting: >
215 display_count_by_cmf.$fid = display_count_by_cmf.$fid + 1;
218 # This facet is already selected by the user.
219 # Link removes the facet from the set of selected facets.
221 <div class="facet_template facet_template_selected">
223 [% IF new_facets.size == 0 %]
225 title="[% l('Show all results, not just those matching this term') %]"
226 href="[% mkurl('', {}, ['facet']) %]" rel="nofollow" vocab="">[% display_value %]</a>
229 title="[% l('Expand to also show results not matching this term') %]"
230 href="[% mkurl('', {facet => new_facets}) %]" rel="nofollow" vocab="">[% display_value %]</a>
233 <div class="count">([% facet_data.count; IF facet_data.count == (ctx.superpage + 1) * ctx.superpage_size; '+'; END %])</div>
237 # This facet is not currently selected. If selected,
238 # append this facet to the list of currently active facets.
240 <div class="facet_template">
243 title="[% l('Limit to results matching this term') %]"
244 href='[% mkurl('', {facet => selected_facets.merge([param_string])}, ['page']) %]' rel="nofollow" vocab="">
248 <div class="count">([% facet_data.count %])</div>
253 </div> <!-- box_wrapper -->
254 </div> <!-- facet_box_temp -->
256 </div> <!-- facet_box_wrapper -->