basic search "works" inasmuch as it leads to a GET request against the
authorsenator <lebbeous@esilibrary.com>
Mon, 7 Feb 2011 22:10:38 +0000 (17:10 -0500)
committersenator <lebbeous@esilibrary.com>
Mon, 7 Feb 2011 22:10:38 +0000 (17:10 -0500)
results page as it should. not that the results page itself works yet.

Open-ILS/web/templates/default/opac/parts/libselect.tt2
Open-ILS/web/templates/default/opac/parts/searchbar.tt2

index 678fcc9..f41d0e4 100644 (file)
@@ -1,6 +1,30 @@
+[%  # XXX TODO probably put this BLOCK somewhere else so it can be used widely.
+    # Org Unit Selector Widget :
+    #   PROCESS build_org_selector id='selector-id' name='selector-name'
+    BLOCK build_org_selector;
+        first_run = 0;
+        IF !org_unit;
+            org_unit = ctx.aou_tree;
+            first_run = 1;
+%]
+    <select id='[% id %]' name='[% name %]'>
+    [% END %]
+        <option value='[% org_unit.id %]' [% IF org_unit.id == value %] selected='selected' [% END %]>
+            [%
+                pad = org_unit.ou_type.depth * 2;
+                FOR idx IN [0..pad]; '&nbsp;'; END;
+                org_unit.name;
+            %]
+        </option>
+        [% FOR child IN org_unit.children; PROCESS build_org_selector org_unit = child; END %]
+    [% IF first_run %]
+    </select>
+    [% END %]
+[% END %]
+
 <!-- ****************** libselect.xml ***************************** -->
     <span id='depth_selector_span'>
-        <select id='depth_selector'><!-- XXX TODO --></select>
+        [% PROCESS build_org_selector name='loc' %]
     </span>
     <span id='lib_selector_span'>
         <a id='lib_selector_link' class='classic_link'
index 559f1a5..50ae309 100644 (file)
@@ -1,4 +1,5 @@
 <div id="search-box">    
+    <form action="[% skin_root %]results" method="GET">
     <table cellpadding="0" cellspacing="10" border="0">
         <tr>
             <td colspan="3">
             </td>
             <td>
                 <div id="search_box_wrapper">
-                    <input type="text" id="search_box"
-                        value="Search Keyword"
-                        onfocus="if (this.value=='Search Keyword'){this.value='';this.style.color='#000';}"
-                        onblur="if (this.value==''){this.value='Search Keyword';this.style.color='#999';}" />
-                    <input id='facet_box' type='hidden' />
+                    <input type="text" id="search_box" name="query"
+                        value="[% query || l("Search Keyword") %]"
+                        onfocus="if (this.value=='[% l("Search Keyword") %]'){this.value='';this.style.color='#000';}"
+                        onblur="if (this.value==''){this.value='[% l("Search Keyword") %]';this.style.color='#999';}" />
+                    <input name='page' type='hidden' value="0" />
                 </div>
             </td>
             <td valign="top">
                 <div class="pos-abs">
                     <div class="opac-auto-143">
-                        <input type="button" id="search_submit" value="GO"
-                            class="hide_me" /><a href="#"
+                        <input type="submit" id="search_submit" value="GO"
+                            class="hide_me" /><a
+                                href="javascript:document.getElementById('search_submit').click();"
                                 id="search_submit_alt"><img
                                 alt="Search" src="[% ctx.media_prefix %]/images/go-btn.png"
                             onmouseover="this.src='[% ctx.media_prefix %]/images/go-btn-hover.png';"
             </td>
         </tr>
     </table>
-    <div class="hide_me">
-        <input type="checkbox" id="opac.result.limit2avail" />
-        <label class="opac-auto-143"
-            for="opac.result.limit2avail">
-            <span class="ten-px">Limit to available items</span>
-        </label>
-      </div>
-      <div id="breadcrumb">
-          <a href="[% skin_root %]home">Catalog Home</a> &gt;
-      </div>
+    </form>
+    <div id="breadcrumb">
+        <a href="[% skin_root %]home">Catalog Home</a> &gt;
+    </div>
     <div class="clear-both"></div>
 </div>