3 {value => 'contains', label => l('Contains')},
4 {value => 'nocontains', label => l('Does not contain')},
5 {value => 'phrase', label => l('Contains phrase')},
6 {value => 'exact', label => l('Matches exactly')},
7 {value => 'starts', label => l('Starts with')}
9 contains = CGI.param('contains');
10 queries = CGI.param('query');
11 bools = CGI.param('bool');
12 qtypes = CGI.param('qtype');
15 # scalar.merge treats the scalar as a 1-item array
16 WHILE queries.size < rowcount; queries = queries.merge(['']); END;
17 WHILE bools.size < rowcount; bools = bools.merge(['and']); END;
18 WHILE qtypes.size < rowcount; qtypes = qtypes.merge(search.default_qtypes.${qtypes.size} ? [search.default_qtypes.${qtypes.size}] : ['keyword']); END;
25 <!-- tag the second row so the bool column won't be hidden -->
26 <tr[% IF loop.index == 1 %] id="adv_global_row"[% END %]>
27 <td align='left' width='100%'>
29 <!-- bool selector. hide for first row. safe to ignore first bool value in form submission -->
30 <select name='bool' style='width: auto' [% IF loop.first %] class='invisible' [% END %]>
31 <option value='and' [% b == 'and' ? 'selected="selected"' : '' %]>[% l('And') %]</option>
32 <option value='or' [% b == 'or' ? 'selected="selected"' : '' %]>[% l('Or') %]</option>
35 <!-- keyword, subject, etc. selector -->
36 <span class="qtype_selector_margin">
37 [% INCLUDE "opac/parts/qtype_selector.tt2"
41 <select name='contains' style='margin-right: 7px;'>
42 [% FOR o IN contains_options; -%]
43 <option value="[% o.value %]" [% c == o.value ? ' selected="selected"' : '' %]>[% o.label %]</option>
46 <input type='text' size='18' name='query' value="[% q | html %]" x-webkit-speech [% IF loop.index == 0 %] autofocus [% END %] />
47 <a href="javascript:;" class="row-remover"
48 title="[% l('Remove row') %]" alt="[% l('Remove row') %]"
49 onclick='return killRowIfAtLeast(2, this);'><img src="[% ctx.media_prefix %]/images/adv_row_close_btn.png" /></a>