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 %]>
28 <td class="td-left py-3">
31 <!-- bool selector. hide for first row. safe to ignore first bool value in form submission -->
32 <select aria-label="[% l('Boolean search operator') %]"
33 name='bool' [% IF loop.first %] class='d-none' [% ELSE %] class='form-control' [% END %]>
34 <option value='and' [% b == 'and' ? 'selected="selected"' : '' %]>[% l('And') %]</option>
35 <option value='or' [% b == 'or' ? 'selected="selected"' : '' %]>[% l('Or') %]</option>
39 <!-- keyword, subject, etc. selector -->
41 [% INCLUDE "opac/parts/qtype_selector.tt2"
46 <select class='form-control w-100' aria-label="[% l('Search phrase match strictness') %]"
48 [% FOR o IN contains_options; -%]
49 <option value="[% o.value %]" [% c == o.value ? ' selected="selected"' : '' %]>[% o.label %]</option>
54 <input class="form-control" aria-label="[% l('Search term') %]"
55 type='text' size='18' name='query' value="[% q | html %]" [% IF loop.index == 0 %] autofocus [% END %] />
60 <a href="javascript:;" class="btn btn-remove btn-sm" aria-label="Remove This Row"
61 title="[% l('Remove row') %]"
62 onclick='return killRowIfAtLeast(2, this);'>
63 <i class="fas fa-times"></i>