Do not render an HTML search box (google will render one for us.)
authorAlec Warner <antarus@gentoo.org>
Fri, 6 Jul 2012 20:00:18 +0000 (13:00 -0700)
committerAlec Warner <antarus@gentoo.org>
Fri, 6 Jul 2012 20:00:18 +0000 (13:00 -0700)
Render search results in the center column. We do this via a div that is normally empty but gets populated when users click search.

web/templates/layout.html

index 6b7a38c..0872ba1 100644 (file)
@@ -87,16 +87,12 @@ def alpha_url(baseurl):
                     customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
                     var options = new google.search.DrawOptions();
                     options.setAutoComplete(true);
-                    options.enableSearchResultsOnly();     
-                    //options.enableSearchResultsOnly("http://google.com/cse?cx="+cse_api_key, null, true);    
-                    //options.enableSearchboxOnly("http://google.com/cse?cx="+cse_api_key, null, true);    
-                    customSearchControl.draw('cse');
+                    options.setSearchFormRoot('cse');
+                    customSearchControl.draw('searchresults', options);
                 }, true);
             </script>
                        <div id="cse" style="width: 100%;">Loading</div>
-                       <input type="text" id="search_input" />
-                       <input type="button" onclick="executeGoogleSearch()" value="Search" />
-        </div>
+      </div>
                <div py:for="day, pvs in daylist">
                        <p>${day}</p>
                        <ul>
@@ -213,6 +209,7 @@ def alpha_url(baseurl):
   </py:match>
   
   <py:match path="centerpkgs">
+    <div id="searchresults"></div>
     <div class="centerpkgs" py:for="pkg in center_pkgs">
         <p class="package"><a href="${relurl('/package/'+pkg.atom.key)}">${pkg.atom.cpvstr}</a></p>
         <p class="description">${pkg.meta.description}</p>