]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/searchbar.tt2
LP1084269, LP1050043 Expert Search Fixes
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / searchbar.tt2
1 <h3 class="sr-only">[% l('Catalog Search') %]</h3>
2 [% PROCESS "opac/parts/org_selector.tt2" %]
3 <div id="search-wrapper">
4     [% UNLESS took_care_of_form -%]
5     <form action="[% ctx.opac_root %]/results" method="get">
6     [%- END %]
7     <div id="search-box">
8         <span class="search_catalog_lbl mobile_hide">[% l('Search the Catalog') %]</span>
9         <span class="adv_search_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/advanced', {}, general_search_parms.merge(expert_search_parms)) %]"
10             id="home_adv_search_link">[% l('Advanced Search') %]</a></span>
11         <span class="browse_the_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/browse', {}, ['fi:has_browse_entry']) %]">[% l('Browse the Catalog') %]</a></span>
12     </div>
13     <div class="searchbar">
14         <span class='search_box_wrapper'>
15             [%- # autosuggest breaks accessibility, as the aria-label
16                 # attribute is removed when the Dijit is created. :(  %]
17             <label id="search_box_label" for="search_box">[% l('Search: ') %]
18             <input type="text" id="search_box" name="query" aria-label="[%
19                     l('Enter search query:');
20                 %]" value="[% is_advanced ? ctx.naive_query_scrub(ctx.processed_search_query) : CGI.param('query') | html %]"
21                 [%- IF use_autosuggest.enabled == "t" %]
22                 dojoType="openils.widget.AutoSuggest" type_selector="'qtype'"
23                 submitter="this.textbox.form.submit();"
24                 [%-     IF use_autosuggest.value.search('opac_visible') %]
25                 store_args='{"org_unit_getter": function() { return [% ctx.search_ou %]; }}'
26                 [%-     END # opac_visible -%]
27                 [%- ELSE -%]
28                     [% IF basic_search != "f" %] autofocus [% END %] x-webkit-speech
29                 [%- END # autosuggest enabled %] />
30             </label>
31         </span>
32         <label id="search_qtype_label" for="qtype">
33         [%- 
34             l('Type: ');
35             INCLUDE "opac/parts/qtype_selector.tt2" id="qtype";
36         -%]
37         </label>
38         <label id="search_itype_label" for="search_itype_selector">
39         [%-
40             l('Format: ');
41             IF search.basic_config.type == 'attr';
42                 INCLUDE "opac/parts/coded_value_selector.tt2"
43                     attr=search.basic_config.group none_ok=1 
44                     id='search_itype_selector'
45                     none_label=search.basic_config.none_label;
46             ELSIF search.basic_config.type == 'filter';
47                 INCLUDE "opac/parts/filter_group_selector.tt2"
48                     filter_group=search.basic_config.group none_ok=1 
49                     id='search_itype_selector'
50                     none_label=search.basic_config.none_label;
51             END;
52         -%]
53         </label>
54         <label id="search_locg_label" for="search_org_selector">
55         [%- 
56             l('Library: ');
57             select_lib_label = l("Select search library");
58             INCLUDE build_org_selector arialabel=select_lib_label 
59               id='search_org_selector' show_loc_groups=1
60         -%]
61         </label>
62     <span>
63         <input id='search-submit-go' type="submit" value="[% l('Search') %]" class="opac-button"
64             onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
65         <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif' style='height:16px;width:16px;' class='hidden' alt='[% l("Search In Progress") %]'/>
66     </span>
67     </div>
68     [% IF ctx.bookbag %]
69     <div id="search-only-bookbag-container">
70         <input type="checkbox" id="search-only-bookbag" name="bookbag"
71             value="[% ctx.bookbag.id | html %]" checked="checked" />
72         <label for="search-only-bookbag">
73             [% l('Search only within the chosen list') %]
74         </label>
75     </div>
76     [% END %]
77     [% IF is_advanced || is_special %]
78     <div>
79         <input type="hidden" name="_adv" value="1" />
80         [% IF ctx.processed_search_query OR (NOT is_advanced AND NOT is_special) %]
81         <input name='page' type='hidden' value="0" />
82         [% END %]
83         [% IF is_special %]
84             <input type="hidden" name="_special" value="1" /> [%
85             number_of_expert_rows = CGI.param('tag').list.size;
86             index = 0;
87             WHILE index < number_of_expert_rows %]
88                 <input type="hidden" name="tag" value="[% CGI.param('tag').list.$index %]" />
89                 <input type="hidden" name="subfield" value="[% CGI.param('subfield').list.$index %]" />
90                 <input type="hidden" name="term" value="[% CGI.param('term').list.$index %]" />
91                 [% index = index + 1; %]
92             [% END %]
93         [% END %]
94     </div>
95     [%- END %]
96     [% UNLESS took_care_of_form %]</form>[% END %]
97     [% IF (is_advanced AND NOT is_special) AND CGI.param('qtype') %]
98     <div class="opac-auto-102">
99         [ <a href="[% mkurl(ctx.opac_root _ '/advanced') %]">[%
100             l('Refine My Original Search')
101         %]</a> ]
102     </div>
103     [% END %]
104     <!--
105     <div id="breadcrumb">
106         <a href="[% ctx.opac_root %]/home">[% l('Catalog Home') %]</a> &gt;
107     </div>
108     -->
109     <div class="clear-both"></div>
110 </div>