]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/geocoder/_results.rhtml
If a search only finds one result then jump straight to it instead of
[rails.git] / app / views / geocoder / _results.rhtml
diff --git a/app/views/geocoder/_results.rhtml b/app/views/geocoder/_results.rhtml
new file mode 100644 (file)
index 0000000..477f2a0
--- /dev/null
@@ -0,0 +1,14 @@
+<% 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"><%= result_to_html(result) %></p>
+<% end %>
+<% end %>
+<% else %>
+<p class="search_results_error"><%= source[:error] %></p>
+<% end %>
+<% end %>