Expose ability to use filter groups in TPac
[transitory.git] / Open-ILS / src / templates / opac / parts / searchbar.tt2
index 80b55ee..b75752f 100644 (file)
@@ -9,14 +9,19 @@
             id="home_adv_search_link"><span
             class="adv_search_font">[% l('Advanced Search') %]</span></a>
     </div>
-    <div style="font-weight: bold">[%- l('Search ');
-        INCLUDE "opac/parts/coded_value_selector.tt2"
-            attr=["mattype", "item_type"] none_ok=1 none_label=l('All Formats');
+    <div class="searchbar">[%- l('Search ');
+        IF search.basic_config.type == 'attr';
+            INCLUDE "opac/parts/coded_value_selector.tt2"
+                attr=search.basic_config.group none_ok=1 none_label=search.basic_config.none_label;
+        ELSIF search.basic_config.type == 'filter';
+            INCLUDE "opac/parts/filter_group_selector.tt2"
+                filter_group=search.basic_config.group none_ok=1 none_label=search.basic_config.none_label;
+        END;
             l(' for ');
         %]
         <span class='search_box_wrapper'>
             <input type="text" id="search_box" name="query"
-                value="[% is_advanced ? ctx.processed_search_query : CGI.param('query') | html %]"
+                value="[% is_advanced ? ctx.naive_query_scrub(ctx.processed_search_query) : CGI.param('query') | html %]"
                 [%- IF use_autosuggest.enabled == "t" %]
                 dojoType="openils.widget.AutoSuggest" type_selector="'qtype'"
                 submitter="this.textbox.form.submit();"
                 store_args='{"org_unit_getter": function() { return [% ctx.search_ou %]; }}'
                 [%-     END # opac_visible -%]
                 [%- ELSE -%]
-                x-webkit-speech
+                    [% IF basic_search != "f" %] autofocus [% END %] x-webkit-speech
                 [%- END # autosuggest enabled %] />
         </span>
         [%- INCLUDE "opac/parts/qtype_selector.tt2" id="qtype";
-            l(' in '); PROCESS build_org_selector name='loc' value=ctx.search_ou;
+            l(' in '); INCLUDE build_org_selector show_loc_groups=1
     %]
     <span>
         <input id='search-submit-go' type="submit" value="[% l('Search') %]" alt="[% l('Search') %]" class="opac-button"