]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/result/adv_filter.tt2
LP#1005040: CSS styling of filter control boxes
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / result / adv_filter.tt2
1 <div class="facet_box_wrapper filter_box_wrapper">
2 [%
3
4 ignore_filters = ['sort','statuses','site'];
5
6 FOR filter IN ctx.query_struct.filters;
7     fname = filter.name;
8
9     fvalues = filter.args;
10     crad = ctx.get_crad(fname);
11
12     IF crad; # will be some special ones, like locations
13         remove_filter = 'fi:' _ fname;
14 %]
15     <div class="facet_box_temp filter_box_temp">
16         <div class="header">
17             <a class="button"
18               title="[% l('Remove [_1] filter', crad.label) %]"
19               href="[% mkurl('', {}, [remove_filter]) %]" rel="nofollow" vocab="">
20               [% l("Remove") %]
21             </a>
22             <h4 class="title">[% IF filter.negate; l('Not'); END %] [% crad.label | html %]</h4>
23         </div>
24         <div class="box_wrapper">
25             <div class="box">
26             [% FOR fval IN fvalues;
27                 thing = ctx.search_ccvm('ctype',fname,'code',fval).0;
28                 display_value = thing.search_label || thing.value;
29                 IF display_value.defined; %]
30                     <div class="facet_template filter_template">
31                         <div class="facet filter">
32                               [% display_value | html%]
33                         </div>
34                     </div>
35             [%  END; # IF %]
36             [% END; # FOR %]
37             </div>
38         </div> <!-- box_wrapper -->
39     </div> <!-- facet_box_temp -->
40     [% END; # IF crad %]
41
42 [%  IF filter.name == 'locations'; locs = ctx.search_acpl('id',filter.args) %]
43     <div class="facet_box_temp filter_box_temp">
44         <div class="header">
45             <a class="button"
46               title="[% l('Remove location filter') %]"
47               href="[% mkurl('', {}, ['locations']) %]" rel="nofollow" vocab="">
48               [% l("Remove") %]
49             </a>
50             <h4 class="title">[% IF filter.negate; l('Not'); END %] [% l('Locations') %]</h4>
51         </div>
52         <div class="box_wrapper">
53             <div class="box">
54             [% FOR loc IN locs %]
55                 <div class="facet_template filter_template">
56                   <div class="facet filter">
57                     [% loc.name | html%]
58                   </div>
59                 </div>
60             [% END; # FOR %]
61             </div>
62         </div> <!-- box_wrapper -->
63     </div> <!-- facet_box_temp -->
64     [% END; # IF locations %]
65 [% END; # FOR %]
66 </div> <!-- facet_box_wrapper -->
67