]> git.openstreetmap.org Git - rails.git/blob - app/views/site/_search.rhtml
Add some help to the search box.
[rails.git] / app / views / site / _search.rhtml
1 <% content_for "optionals" do %>
2   <div class="optionalbox">
3     <span class="oboxheader">Search</span>
4     <% form_remote_tag(:update => :search_results_content, 
5                        :loading => "openSearchResults()",
6                        :url => { :controller => :geocoder, :action => :search } ) do %>
7       <%= text_field_tag :query, nil, :size => 16 %>
8     <% end %>
9     <p class="search_help">
10       examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ',
11       or 'post offices near Lünen'
12       <a href="http://wiki.openstreetmap.org/index.php/Name_finder#Searching_for_things">more examples...</a>
13     </p>
14   </div>
15   <script type="text/javascript">
16   <!--
17     function openSearchResults() {
18       $("search_results").style.display = "block";
19       $("search_results_content").innerHTML = "<p class='search_results_entry'>Searching...</p>";
20       <%= onopen %>
21     }
22
23     function closeSearchResults() {
24       $("search_results").style.display = "none";
25       <%= onclose %>
26     }
27   // -->
28   </script>
29 <% end %>
30
31 <div id="search_results">
32   <table class="search_results_title" width="100%">
33     <tr>
34       <td align="left">Search Results</td>
35       <td align="right"><a href="javascript:closeSearchResults()">Close</a></td>
36     </tr>
37   </table>
38   <div id="search_results_content">
39   </div>
40 </div>