1 <div class="facet_box_wrapper filter_box_wrapper">
4 # don't display a box for the search_format filter,
5 # as that's got its own widget
6 ignore_filters = ['search_format'];
8 pubdate_filters = ['date1', 'before', 'after', 'between'];
10 FOR filter IN ctx.query_struct.filters;
12 IF ignore_filters.grep('^' _ fname _ '$').size;
16 fvalues = filter.args;
17 crad = ctx.get_crad(fname);
19 # will be some special ones, like locations
20 IF crad AND NOT pubdate_filters.grep('^' _ filter.name _ '$').size;
21 remove_filter = 'fi:' _ fname;
23 <div class="facet_box_temp filter_box_temp">
26 title="[% l('Remove [_1] filter', (crad.description || crad.label)) %]"
27 href="[% mkurl('', {}, [remove_filter]) %]" rel="nofollow" vocab="">
30 <h4 class="title">[% IF filter.negate; l('Not'); END %] [% (crad.description || crad.label) | html %]</h4>
32 <div class="box_wrapper">
36 thing = ctx.search_ccvm('ctype',fname,'code',fval).0;
37 display_value = thing.search_label || thing.value;
38 IF display_value.defined;
39 temp.push(display_value);
42 FOR display_value IN temp.sort;
44 <div class="facet_template filter_template">
45 <div class="facet filter">
46 [% display_value | html%]
51 </div> <!-- box_wrapper -->
52 </div> <!-- facet_box_temp -->
55 [% IF filter.name == 'locations'; locs = ctx.search_acpl('id',filter.args) %]
56 <div class="facet_box_temp filter_box_temp">
59 title="[% l('Remove location filter') %]"
60 href="[% mkurl('', {}, ['fi:locations']) %]" rel="nofollow" vocab="">
63 <h4 class="title">[% IF filter.negate; l('Not'); END %] [% l('Locations') %]</h4>
65 <div class="box_wrapper">
71 FOR display_name IN temp.sort; %]
72 <div class="facet_template filter_template">
73 <div class="facet filter">
74 [% display_name | html%]
79 </div> <!-- box_wrapper -->
80 </div> <!-- facet_box_temp -->
81 [% END; # IF locations %]
83 [% IF pubdate_filters.grep('^' _ filter.name _ '$').size;
84 date1 = CGI.param('date1');
85 date2 = CGI.param('date2');
87 <div class="facet_box_temp filter_box_temp">
90 title="[% l('Remove publication date filter') %]"
91 href="[% mkurl('', {}, ['pubdate', 'date1', 'date2']) %]" rel="nofollow" vocab="">
94 <h4 class="title">[% IF filter.negate; l('Not'); END %] [% l('Publication Year') %]</h4>
96 <div class="box_wrapper">
98 [% IF filter.name == 'date1' %][% l('[_1]', date1) %]
99 [% ELSIF filter.name == 'before' %][% l('Before [_1]', date1) %]
100 [% ELSIF filter.name == 'after' %][% l('After [_1]', date1) %]
101 [% ELSIF filter.name == 'between' %][% l('Between [_1] and [_2]', date1, date2) %]
104 </div> <!-- box_wrapper -->
105 </div> <!-- facet_box_temp -->
106 [% END; # IF pubdate_filters %]
109 </div> <!-- facet_box_wrapper -->