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