1 |
commit: b80ee9c7ed5026b8d544d006ba14892ab43f476e |
2 |
Author: Alec Warner <antarus <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jul 6 20:00:18 2012 +0000 |
4 |
Commit: Alec Warner <antarus <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jul 6 20:00:18 2012 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=packages.git;a=commit;h=b80ee9c7 |
7 |
|
8 |
Do not render an HTML search box (google will render one for us.) |
9 |
|
10 |
Render search results in the center column. We do this via a div that is normally empty but gets populated when users click search. |
11 |
|
12 |
--- |
13 |
web/templates/layout.html | 11 ++++------- |
14 |
1 files changed, 4 insertions(+), 7 deletions(-) |
15 |
|
16 |
diff --git a/web/templates/layout.html b/web/templates/layout.html |
17 |
index 6b7a38c..0872ba1 100644 |
18 |
--- a/web/templates/layout.html |
19 |
+++ b/web/templates/layout.html |
20 |
@@ -87,16 +87,12 @@ def alpha_url(baseurl): |
21 |
customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET); |
22 |
var options = new google.search.DrawOptions(); |
23 |
options.setAutoComplete(true); |
24 |
- options.enableSearchResultsOnly(); |
25 |
- //options.enableSearchResultsOnly("http://google.com/cse?cx="+cse_api_key, null, true); |
26 |
- //options.enableSearchboxOnly("http://google.com/cse?cx="+cse_api_key, null, true); |
27 |
- customSearchControl.draw('cse'); |
28 |
+ options.setSearchFormRoot('cse'); |
29 |
+ customSearchControl.draw('searchresults', options); |
30 |
}, true); |
31 |
</script> |
32 |
<div id="cse" style="width: 100%;">Loading</div> |
33 |
- <input type="text" id="search_input" /> |
34 |
- <input type="button" onclick="executeGoogleSearch()" value="Search" /> |
35 |
- </div> |
36 |
+ </div> |
37 |
<div py:for="day, pvs in daylist"> |
38 |
<p>${day}</p> |
39 |
<ul> |
40 |
@@ -213,6 +209,7 @@ def alpha_url(baseurl): |
41 |
</py:match> |
42 |
|
43 |
<py:match path="centerpkgs"> |
44 |
+ <div id="searchresults"></div> |
45 |
<div class="centerpkgs" py:for="pkg in center_pkgs"> |
46 |
<p class="package"><a href="${relurl('/package/'+pkg.atom.key)}">${pkg.atom.cpvstr}</a></p> |
47 |
<p class="description">${pkg.meta.description}</p> |