]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/geocoder/search.rhtml
Only use the actual name that matched as the link, which helps to highlight it.
[rails.git] / app / views / geocoder / search.rhtml
index bbe1fad2a73324fce767f64b7fa83ca44aded845..7ffde3194b8117a8557ed3a82d100ff700352019 100644 (file)
@@ -1,8 +1,12 @@
 <% @results.each do |source| %>
 <p class="search_results_heading">Results from <%= link_to source[:source], source[:url] %></p>
 <% if source[:results] %>
+<% if source[:results].empty? %>
+<p class="search_results_entry">No results found</p>
+<% else %>
 <% source[:results].each do |result| %>
-<p class="search_results_entry"><%= link_to_function result[:description], "setPosition(#{result[:lat]}, #{result[:lon]}, #{result[:zoom]})" %></p>
+<p class="search_results_entry"><%= result_to_html(result) %></p>
+<% end %>
 <% end %>
 <% else %>
 <p class="search_results_error"><%= source[:error] %></p>