]> git.openstreetmap.org Git - rails.git/blob - app/views/site/_search.rhtml
Only include the home link if the user is logged in.
[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 startSearch() {
15     $("search_field").style.display = "none";
16     $("search_active").style.display = "inline";
17   }
18
19   function endSearch() {
20     $("search_field").style.display = "inline";
21     $("search_active").style.display = "none";
22   }
23
24   function openSearchResults() {
25     $("search_results").style.display = "block";
26     <%= onopen %>
27   }
28
29   function closeSearchResults() {
30     $("search_results").style.display = "none";
31     <%= onclose %>
32   }
33
34   <% if params[:query] %>
35   <%= remote_function(:loading => "startSearch()",
36                       :complete => "endSearch()",
37                       :url => { :controller => :geocoder, :action => :search, :query => params[:query] }) %>
38   <% end %>
39 // -->
40 </script>
41
42 <% content_for "optionals" do %>
43   <div class="optionalbox">
44     <span class="oboxheader">Search</span>
45     <div class="search_form">
46     <span id="search_field">
47     <% form_remote_tag(:loading => "startSearch()",
48                        :complete => "endSearch()",
49                        :url => { :controller => :geocoder, :action => :search }) do %>
50       <%= text_field_tag :query, params[:query] %>
51     <% end %>
52     </span>
53     <p id="search_active">Searching...</p>
54     </div>
55     <p class="search_help">
56       examples: 'Alkmaar', 'Regent Street, Cambridge', 'CB2 5AQ',
57       or 'post offices near Lünen'
58       <a href="http://wiki.openstreetmap.org/index.php/Search_Help">more examples...</a>
59     </p>
60   </div>
61 <% end %>