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