LP1735768: adding labels to inputs in the public catalog
[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'>
7     <div id='adv_search_rows'>
8         <!-- Contains the user-addable(?) rows to define search class, containment and text -->
9         <div class='adv_global_input_container'>
10             <table id='adv_global_input_table' role="presentation">
11                 <thead>
12                     <tr>
13                         <td>
14                             <div class="header_middle" id="adv_search_input">
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 class="td-search-left">
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         <input id="detail" type="hidden" name="detail_record_view"
36                value="[% show_detail_view %]"/>
37         <span>
38             <input id='search-submit-go' type="submit" value="[% l('Search') %]" title="[% l('Search') %]" class="opac-button"
39                 onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
40             <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif[% ctx.cache_key %]'
41                 class='hidden' alt="[% l('Search in progress icon') %]"/>
42         </span>
43
44         <a href="[% mkurl(ctx.opac_root _ '/advanced', {$loc_name => loc_value}, 1) %]"
45             class="opac-button">[% l('Clear Form') %]</a>
46     </div>
47
48     <div id='adv_search_filters'>
49         <div class="header_middle">[% l('Search Filters') %]</div>
50
51 [%
52     in_row = 0;
53     FOR adv_chunk IN search.adv_config;
54         NEXT IF adv_chunk.adv_hide;
55         IF in_row == 0;
56             in_row = 1; %]
57             <div class='adv_filter_block'>
58 [%
59         END; %]
60             <div class='adv_filter_block_item'>
61             <div [% IF adv_chunk.js_only %]
62                 id='adv_chunk_[% adv_chunk.adv_special %]'
63                 class='hidden'[% END %]>
64                 <strong><label for="[% adv_chunk.id %]">
65                   [% adv_chunk.adv_label %] </label></strong><br />
66 [%
67         IF adv_chunk.adv_special;
68             SWITCH adv_chunk.adv_special;
69                 CASE "lib_selector";
70                     PROCESS "opac/parts/org_selector.tt2";
71                         INCLUDE build_org_selector show_loc_groups=1 id=adv_chunk.id %]
72                             <div class="adv_search_available">
73                                 <input type='checkbox' name="modifier"
74                                     value="available"[% CGI.param('modifier').grep('available').size ? ' checked="checked"' : '' %]
75                                     id='opac.result.limit2avail' />
76                                 <label for='opac.result.limit2avail'>
77                                     [% l("Limit to Available") %]</label>
78                             </div>
79 [%
80                 CASE "pub_year"; %]
81                             <select name='pubdate'
82                                 id="[% adv_chunk.id %]"
83                                 onchange='if(this.selectedIndex == 3)
84                                     unHideMe($("adv_global_pub_date_2_span"));
85                                 else
86                                     hideMe($("adv_global_pub_date_2_span"));'>
87                                     [%  FOR opt IN [
88                                             {"code" => "is", "label" => l("Is")},
89                                             {"code" => "before", "label" => l("Before")},
90                                             {"code" => "after", "label" => l("After")},
91                                             {"code" => "between", "label" => l("Between")} ] %]
92                                         <option value="[% opt.code %]"[% CGI.param('pubdate') == opt.code ? ' selected="selected"' : '' %]>[% opt.label | html %]</option>
93                                     [%  END %]
94                             </select>
95                             [% IF !ctx.exclude_electronic_checkbox %]
96                             <br/>
97                             <div id='adv_special_block'>
98                             [% END %]
99                                 <input title="[% l('Search date') %]" aria-label="[% l('Search date') %]"
100                                   name='date1' type='text' size='4' maxlength='4' value="[% CGI.param('date1') | html %]" />
101                                 <span id='adv_global_pub_date_2_span' class='[% CGI.param("pubdate") == "between" ? "" : "hide_me" %]'>
102                                    [% l("and") %] <input name='date2' aria-label="[% l('Secondary search date') %]"
103                                     title="[% l('Secondary search date') %]" type='text' size='4' maxlength='4' value="[% CGI.param('date2') | html %]" />
104                                 </span>
105                             [% IF !ctx.exclude_electronic_checkbox %]
106                             </div>
107                             [% END %]
108                             [% IF ctx.exclude_electronic_checkbox %]
109                             <div class="adv_search_available">
110                                 <input type='checkbox' name="fi:-search_format" value="electronic"
111                                 [%- CGI.param('fi:-search_format').grep('electronic').size ?
112                                     ' checked="checked"' : '' %]
113                                 id='opac.result.excludeelec' />
114                                 <label for='opac.result.excludeelec'>
115                                     [% l("Exclude Electronic Resources") %]
116                                 </label>
117                             </div>
118                             [% END %]
119 [%
120                 CASE "sort_selector";
121                     default_sort=ctx.default_sort;
122                     IF CGI.param('sort');
123                         default_sort=CGI.param('sort');
124                     END;
125                     INCLUDE "opac/parts/filtersort.tt2"
126                         id=adv_chunk.id
127                         value=default_sort class='results_header_sel';
128                     %]
129
130                     [% IF NOT metarecords.disabled %]
131                         <br/><!-- <br> may seem redundant, but it allows the
132                             <input> (below) to drop down inline w/ its label -->
133                         <div class="adv_search_available">
134                             <input type='checkbox' name="modifier" value="metabib"
135                               [%- CGI.param('modifier').grep('metabib').size || search.metarecord_default ?
136                                     ' checked="checked"' : '' %]
137                                 id='opac.result.ismetabib' />
138                             <label for='opac.result.ismetabib'>
139                                 [% l("Group Formats and Editions") %]</label>
140                         </div>
141                     [% END %]
142
143                 [% CASE "copy_location" %]
144                     <select id="adv_copy_location_selector"
145                         title="[% l('Select Shelving Location') %]"
146                         name="fi:locations" size="4" multiple="multiple">
147                     </select>
148                 [%
149             END;
150         ELSIF adv_chunk.adv_attr;
151             INCLUDE "opac/parts/coded_value_selector.tt2"
152                 id=adv_chunk.id
153                 attr=adv_chunk.adv_attr multiple="multiple"
154                 size=adv_chunk.adv_size || search.default_adv_select_height || "4";
155         ELSIF adv_chunk.adv_filter;
156             INCLUDE "opac/parts/filter_group_selector.tt2"
157                 id=adv_chunk.id
158                 filter_group=adv_chunk.adv_filter multiple="multiple"
159                 size=adv_chunk.adv_size || search.default_adv_select_height || "4";
160         END; %]
161             </div>
162         </div>
163 [%
164         IF adv_chunk.adv_break;
165             in_row = 0; %]
166             </div>
167 [%
168         END;
169     END; %]
170
171         </div>
172     </div>
173 </div>
174 </form>