3 # If caller passes a list of possible attribute types,
4 # search all until we find some values
6 IF !attr.size; attr = [attr]; END;
9 FOR attr_class IN attr;
10 all_values = ctx.search_ccvm('ctype', attr_class, 'opac_visible', 't');
11 IF all_values.size > 0; LAST; END;
13 name = name || "fi:" _ attr_class;
14 id = id || attr_class _ "_selector";
15 values = values || CGI.param(name);
16 IF size AND size < 1; size = all_values.size; END;
22 <p value=''>[% none_label ? none_label : l('-- Any --') %]</p>
24 # turn the list of objects into a list of hashes to
25 # leverage TT's array.sort('<hashkey>') behavior
29 IF o.is_simple == 't';
30 simple_sorter.push({code => o.code, value => (o.search_label ? o.search_label : o.value)});
32 sorter.push({code => o.code, value => (o.search_label ? o.search_label : o.value)});
36 [%IF simple_sorter.size && sorter.size %]
37 <p disabled='true'>-----</p>
39 <ul class="adv_filters">
40 [% FOR o IN sorter.sort('value') %]
42 <div class="form-check">
43 <label class="form-check-label">
44 <input type="checkbox" class="form-check-input" name='[% name %]' value='[% o.code | html | replace("'","'") %]'[% values.grep('^' _ o.code _ '$').size ? ' checked' : '' %]>