d52129b399f951b658ab2eb40b36e168fb3e70f0
[evergreen-equinox.git] / Open-ILS / web / templates / default / opac / parts / format_selector.tt2
1 [% 
2     # Start w/ mattype, fall back to item_type
3     format_spec = '';
4     formats = [];
5     FOR format_spec IN ['mattype', 'item_type'];
6         formats = ctx.search_ccvm('ctype', format_spec);
7         IF formats.size; BREAK; END;
8     END;
9     name = name || "fi:" _ format_spec;
10     id = id || "format_selector";
11     values = values || CGI.param(name) 
12 -%]
13
14 <select id='[% id %]' name='[% name %]'[%
15     multiple ? ' multiple="multiple"' : '';
16     size ? (' size="' _ size _ '"') : ''; %]>
17     <option value=''>[% l("All Formats") %]</option>
18
19 [% FOR o IN formats %]
20     <option value='[% o.code %]'[% values.grep('^' _ o.code _ '$').size ? ' selected="selected"' : ''%]>[% o.value %]</option>
21 [%- END %]
22 <!--
23         <option value='at'>[% l("Books") %]</option>
24         <option value='at-d'>[% l("Large Print Books") %]</option>
25         <option value='i'>[% l("Audiobooks") %]</option>
26         <option value='g'>[% l("Video Recordings") %]</option>
27         <option value='j'>[% l("Music") %]</option>
28         <option value='m'>[% l("Electronic Resources") %]</option>
29 -->
30 </select>