updating PINES survey display
authorChris Sharp <csharp@georgialibraries.org>
Mon, 10 Apr 2017 11:01:17 +0000 (07:01 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Fri, 26 May 2017 13:29:58 +0000 (09:29 -0400)
Open-ILS/src/templates/opac/parts/searchbar_survey.tt2

index e77508e..98b4bf5 100644 (file)
@@ -1,29 +1,25 @@
+<h3 class="sr-only">[% l('Catalog Search') %]</h3>
 [% PROCESS "opac/parts/org_selector.tt2" %]
-<div id="search-box">    
+<div id="search-wrapper">
     [% UNLESS took_care_of_form -%]
-    <form action="[% ctx.opac_root %]/results" method="GET">
+    <form action="[% ctx.opac_root %]/results" method="get">
     [%- END %]
-    <div>
-        <span class="search_catalog_lbl">[% l('Search the Catalog') %]</span>
-        <a href="[% mkurl(ctx.opac_root _ '/advanced') %]"
-            id="home_adv_search_link"><span
-            class="adv_search_font">[% l('Advanced Search') %]</span></a>
-       <a href="http://www.example.com/PINESSurvey"
-            id="surveylink">[% l('Click Here to Take the PINES Annual Survey') %]</a>
+    <div id="search-box">
+        <span class="search_catalog_lbl mobile_hide">[% l('Search the Catalog') %]</span>
+        <span class="adv_search_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/advanced', {},  expert_search_parms.merge(browse_search_parms, facet_search_parms)) %]"
+            id="home_adv_search_link">[% l('Advanced Search') %]</a></span>
+        <span class="browse_the_catalog_lbl"><a href="[% mkurl(ctx.opac_root _ '/browse', {}, expert_search_parms.merge(general_search_parms, facet_search_parms, ['fi:has_browse_entry'])) %]">[% l('Browse the Catalog') %]</a></span>
+       <a href="http://www.example.com/PINESSurvey" id="surveylink">[% l('Click Here to Take the PINES Annual Survey') %]</a>
     </div>
-    <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 ');
-        %]
+    <div class="searchbar">
+        <div  style="padding:0px 0px 10px 0px;">
         <span class='search_box_wrapper'>
-            <input type="text" id="search_box" name="query"
-                value="[% is_advanced ? ctx.naive_query_scrub(ctx.processed_search_query) : CGI.param('query') | html %]"
+            [%- # autosuggest breaks accessibility, as the aria-label
+                # attribute is removed when the Dijit is created. :(  %]
+            <label id="search_box_label" for="search_box">[% l('Search: ') %]</label>
+            <input type="text" id="search_box" name="query" aria-label="[%
+                    l('Enter search query:');
+                %]" 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();"
                     [% IF basic_search != "f" %] autofocus [% END %] x-webkit-speech
                 [%- END # autosuggest enabled %] />
         </span>
-        [%- INCLUDE "opac/parts/qtype_selector.tt2" id="qtype";
-            l(' in '); INCLUDE build_org_selector show_loc_groups=1
-    %]
+        </div>
+        <div  style="padding:10px 10px 10px 0px;float:left;">
+        <label id="search_qtype_label" for="qtype"></label>
+        [%- 
+            l('Type: ');
+            INCLUDE "opac/parts/qtype_selector.tt2" id="qtype";
+        -%]
+        </div>
+        <div  style="padding:10px 10px 10px 0px;float:left;">
+        <label id="search_itype_label" for="search_itype_selector"></label>
+        [%-
+            l('Format: ');
+            IF search.basic_config.type == 'attr';
+                INCLUDE "opac/parts/coded_value_selector.tt2"
+                    attr=search.basic_config.group none_ok=1 
+                    id='search_itype_selector'
+                    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 
+                    id='search_itype_selector'
+                    none_label=search.basic_config.none_label;
+            END;
+        -%]
+        </div>
+        <div  style="padding:10px 10px 10px 0px;float:left;">
+        <label id="search_locg_label" for="search_org_selector"></label>
+        [%- 
+            l('Library: ');
+            select_lib_label = l("Select search library");
+            INCLUDE build_org_selector arialabel=select_lib_label 
+              id='search_org_selector' show_loc_groups=1
+        -%]
+                </div>
+        <div  style="padding:0px 10px 10px 0px;float:left;">
     <span>
-        <input id='search-submit-go' type="submit" value="[% l('Search') %]" alt="[% l('Search') %]" class="opac-button"
-            onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"}, 2000)'/>
-        <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif' style='height:16px;width:16px;' class='hidden' alt=''/>
+        <input id="detail" type="hidden" name="detail_record_view" value="[% show_detail_view %]"/>
+        <input id='search-submit-go' type="submit" value="[% l('Search') %]" class="opac-button"
+            onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden";[% IF ctx.depth_sel_button AND NOT took_care_of_form %] $("search-submit-go-depth").className="hidden";[% END %]}, 2000)'/>
+        [%- IF ctx.depth_sel_button AND NOT took_care_of_form %]
+        <button id='search-submit-go-depth' type="submit" value="[% ctx.depth_sel_depth %]" name="depth" class="[% ctx.depth_sel_button_class %]"
+            onclick='setTimeout(function(){$("search-submit-spinner").className=""; $("search-submit-go").className="hidden"; $("search-submit-go-depth").className="hidden";}, 2000)' title="[% ctx.depth_sel_tooltip | html %]">[% ctx.depth_sel_button_label | html %]</button>
+        [%- END %]
+        <img id='search-submit-spinner' src='/opac/images/progressbar_green.gif' style='height:16px;width:16px;' class='hidden' alt='[% l("Search In Progress") %]'/>
     </span>
     </div>
+    </div>
     [% IF ctx.bookbag %]
     <div id="search-only-bookbag-container">
         <input type="checkbox" id="search-only-bookbag" name="bookbag"
         [% IF ctx.processed_search_query OR (NOT is_advanced AND NOT is_special) %]
         <input name='page' type='hidden' value="0" />
         [% END %]
+        [% IF is_special %]
+            <input type="hidden" name="_special" value="1" /> [%
+            number_of_expert_rows = CGI.param('tag').list.size;
+            index = 0;
+            WHILE index < number_of_expert_rows %]
+                <input type="hidden" name="tag" value="[% CGI.param('tag').list.$index %]" />
+                <input type="hidden" name="subfield" value="[% CGI.param('subfield').list.$index %]" />
+                <input type="hidden" name="term" value="[% CGI.param('term').list.$index %]" />
+                [% index = index + 1; %]
+            [% END %]
+        [% END %]
     </div>
     [%- END %]
-    [% UNLESS took_care_of_form %]</form>[% END %]
+    [% UNLESS took_care_of_form %]
+        [% IF ctx.default_sort %]
+            <input type="hidden" name="sort" value="[% ctx.default_sort %]"/>
+        [% END %]
+        </form>
+    [% END %]
     [% IF (is_advanced AND NOT is_special) AND CGI.param('qtype') %]
     <div class="opac-auto-102">
         [ <a href="[% mkurl(ctx.opac_root _ '/advanced') %]">[%
-            l('Click to Refine Your Original Search')
+            l('Refine My Original Search')
         %]</a> ]
     </div>
     [% END %]