3 pubdate_filters = ['date1', 'before', 'after', 'between'];
5 FOR filter IN ctx.query_struct.filters;
8 crad = ctx.get_crad(fname);
10 # will be some special ones, like locations
11 IF crad AND NOT pubdate_filters.grep('^' _ filter.name _ '$').size;
12 remove_filter = 'fi:' _ fname;
14 <div class="facet_box_temp filter_box_temp">
17 title="[% l('Remove [_1] filter', (crad.description || crad.label)) %]"
18 href="[% mkurl('', {}, [remove_filter]) %]" rel="nofollow" vocab=""> ✘ </a>
19 <h4 class="title">[% IF filter.negate; l('Not'); END %] [% (crad.description || crad.label) | html %]</h4>
21 <div class="box_wrapper">
25 thing = ctx.search_ccvm('ctype',fname,'code',fval).0;
26 display_value = thing.search_label || thing.value;
27 IF display_value.defined;
28 temp.push(display_value);
31 FOR display_value IN temp.sort;
33 <div class="facet_template filter_template">
34 <div class="facet filter">
35 [% display_value | html%]
40 </div> <!-- box_wrapper -->
41 </div> <!-- facet_box_temp -->
42 [%- END; # IF crad -%]
44 [%- IF filter.name == 'locations'; locs = ctx.search_acpl('id',filter.args) -%]
45 <div class="facet_box_temp filter_box_temp">
48 title="[% l('Remove location filter') %]"
49 href="[% mkurl('', {}, ['fi:locations']) %]" rel="nofollow" vocab=""> ✘ </a>
50 <h4 class="title">[% IF filter.negate; l('Not'); END %] [% l('Locations') %]</h4>
52 <div class="box_wrapper">
58 FOR display_name IN temp.sort; %]
59 <div class="facet_template filter_template">
60 <div class="facet filter">
61 [% display_name | html%]
66 </div> <!-- box_wrapper -->
67 </div> <!-- facet_box_temp -->
68 [%- END; # IF locations -%]
70 [%- IF pubdate_filters.grep('^' _ filter.name _ '$').size;
71 date1 = CGI.param('date1');
72 date2 = CGI.param('date2');
74 <div class="facet_box_temp filter_box_temp">
77 title="[% l('Remove publication date filter') %]"
78 href="[% mkurl('', {}, ['pubdate', 'date1', 'date2']) %]" rel="nofollow" vocab=""> ✘ </a>
79 <h4 class="title">[% IF filter.negate; l('Not'); END %] [% l('Publication Year') %]</h4>
81 <div class="box_wrapper">
83 [% IF filter.name == 'date1' %][% l('[_1]', date1) %]
84 [% ELSIF filter.name == 'before' %][% l('Before [_1]', date1) %]
85 [% ELSIF filter.name == 'after' %][% l('After [_1]', date1) %]
86 [% ELSIF filter.name == 'between' %][% l('Between [_1] and [_2]', date1, date2) %]
89 </div> <!-- box_wrapper -->
90 </div> <!-- facet_box_temp -->
91 [%- END; # IF pubdate_filters -%]