1 <script type="text/javascript">
3 function startSearch() {
4 updateSidebar("<%= t 'site.sidebar.search_results' %>", "");
7 function describeLocation() {
8 var position = getPosition();
11 <%= remote_function(:loading => "startSearch()",
12 :url => { :controller => :geocoder, :action => :description },
13 :with => "'lat=' + position.lat + '&lon=' + position.lon + '&zoom=' + zoom") %>
16 <% if params[:query] %>
17 <%= remote_function(:loading => "startSearch()",
18 :url => { :controller => :geocoder, :action => :search, :query => h(params[:query]) }) %>
23 <% content_for "optionals" do %>
24 <div class="optionalbox">
25 <span class="oboxheader"><%= t 'site.search.search' %></span>
26 <span class="whereami"><a href="javascript:describeLocation()" title="<%= t 'site.search.where_am_i_title' %>"><%= t 'site.search.where_am_i' %></a></span>
27 <div class="search_form">
28 <div id="search_field">
29 <% form_remote_tag(:loading => "startSearch()",
30 :complete => "endSearch()",
31 :url => { :controller => :geocoder, :action => :search },
32 :html => { :method => "get", :action => url_for(:action => "index") }) do %>
33 <%= text_field_tag :query, h(params[:query]) %>
34 <%= submit_tag t('site.search.submit_text') %>
38 <p class="search_help">
39 <%= t 'site.search.search_help' %>