]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/advanced/search.tt2
De-table the advanced search to allow for mobile resizing.
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / advanced / search.tt2
1 [% 
2     PROCESS "opac/parts/misc_util.tt2";
3     PROCESS get_library;
4 %]
5 <form action="[% ctx.opac_root %]/results" method="get">
6 <div id='adv_global_search' class='data_grid data_grid_center' width='100%'>
7     <div id='adv_search_rows' style='border-bottom: none;'>
8         <!-- Contains the user-addable(?) rows to define search class, containment and text -->
9         <div valign='top' class='adv_global_input_container'>
10             <table width='100%' id='adv_global_input_table'>
11                 <thead>
12                     <tr>
13                         <td>
14                             <div style="width:100%;" class="header_middle">
15                                 [% l("Search Input") %]
16                             </div>
17                         </td>
18                     </tr>
19                 </thead>
20                 <tbody id='adv_global_tbody'>
21                     [% INCLUDE "opac/parts/advanced/global_row.tt2" %]
22                     <!-- add a new row -->
23                     <tr id='adv_global_addrow'>
24                         <td align='left' style="padding-top:7px;">
25                             <a href="javascript:;" id="myopac_new_global_row" onclick='addSearchRow();'>[% l('Add Search Row') %]</a>
26                         </td>
27                     </tr>
28                 </tbody>
29             </table>
30         </div>
31     </div>
32
33     <div id='adv_search_submit'>
34         <input type="hidden" name="_adv" value="1" />
35         <span>
36             <input id='search-submit-go' type="submit" value="[% l('Search') %]" alt="[% l('Search') %]" class="opac-button"
37                 onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
38             <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif' style='height:16px;width:16px;' class='hidden' alt=''/>
39         </span>
40
41         <a href="[% mkurl(ctx.opac_root _ '/advanced', {$loc_name => loc_value}, 1) %]"
42             class="pointer opac-button">[% l('Clear Form') %]</a>
43     </div>
44
45     <div id='adv_search_filters'>
46         <div class="header_middle">[% l('Search Filters') %]</div>
47
48 [%
49     in_row = 0;
50     FOR adv_chunk IN search.adv_config;
51         NEXT IF adv_chunk.adv_hide;
52         IF in_row == 0;
53             in_row = 1; %]
54             <div id='adv_filter_block'>
55 [%
56         END; %]
57             <div id='adv_filter_block_item'>
58             <div valign='top'[% IF adv_chunk.js_only %]
59                 id='adv_chunk_[% adv_chunk.adv_special %]'
60                 class='hidden'[% END %]>
61                 <strong>[% adv_chunk.adv_label %]</strong><br />
62 [%
63         IF adv_chunk.adv_special;
64             SWITCH adv_chunk.adv_special;
65                 CASE "lib_selector";
66                     PROCESS "opac/parts/org_selector.tt2";
67                         INCLUDE build_org_selector show_loc_groups=1 id="adv_org_selector" %]
68                             <div style="position:relative;top:7px;">
69                                 <input type='checkbox' name="modifier"
70                                     value="available"[% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %]
71                                     id='opac.result.limit2avail' />
72                                 <label style="top:-2px;"
73                                     for='opac.result.limit2avail'>
74                                     [% l("Limit to Available") %]</label>
75                             </div>
76 [%
77                 CASE "pub_year"; %]
78                             <select name='pubdate' onchange='
79                                 if(this.selectedIndex == 3)
80                                     unHideMe($("adv_global_pub_date_2_span"));
81                                 else
82                                     hideMe($("adv_global_pub_date_2_span"));'>
83                                     [%  FOR opt IN [
84                                             {"code" => "is", "label" => l("Is")},
85                                             {"code" => "before", "label" => l("Before")},
86                                             {"code" => "after", "label" => l("After")},
87                                             {"code" => "between", "label" => l("Between")} ] %]
88                                         <option value="[% opt.code %]"[% CGI.param('pubdate') == opt.code ? ' selected="selected"' : '' %]>[% opt.label | html %]</option>
89                                     [%  END %]
90                             </select>    
91                             <br/>
92                             <div id='adv_special_block' style='margin-top:5px;'>
93                                 <input name='date1' type='text' size='4' maxlength='4' value="[% CGI.param('date1') | html %]" />
94                                 <span id='adv_global_pub_date_2_span' class='[% CGI.param("pubdate") == "between" ? "" : "hide_me" %]'>
95                                    [% l("and") %] <input name='date2' type='text' size='4' maxlength='4' value="[% CGI.param('date2') | html %]" />
96                                 </span>
97                             </div>
98 [%
99                 CASE "sort_selector";
100                     INCLUDE "opac/parts/filtersort.tt2"
101                         value=CGI.param('sort') class='results_header_sel';
102
103                 CASE "copy_location" %]
104                     <select id="adv_copy_location_selector" 
105                         aria-label="[% l('Select Shelving Location') %]"
106                         name="fi:locations" size="3" multiple="multiple">
107                     </select>
108                 [% 
109             END;
110         ELSIF adv_chunk.adv_attr;
111             INCLUDE "opac/parts/coded_value_selector.tt2"
112                 attr=adv_chunk.adv_attr multiple="multiple" size=adv_chunk.adv_size || search.default_adv_select_height || "4";
113         ELSIF adv_chunk.adv_filter;
114             INCLUDE "opac/parts/filter_group_selector.tt2"
115                 filter_group=adv_chunk.adv_filter multiple="multiple" size=adv_chunk.adv_size || search.default_adv_select_height || "4";
116         END; %]
117             </div>
118         </div>
119 [%
120         IF adv_chunk.adv_break;
121             in_row = 0; %]
122             </div>
123 [%
124         END;
125     END; %]
126
127             </div>
128         </div>
129     </div>
130 </div>
131 </form>