]> git.openstreetmap.org Git - rails.git/commitdiff
Remove old geocoder views and add new one.
authorTom Hughes <tom@compton.nu>
Tue, 7 Aug 2007 17:14:27 +0000 (17:14 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 7 Aug 2007 17:14:27 +0000 (17:14 +0000)
app/views/geocoder/_geocoder.rhtml [deleted file]
app/views/geocoder/results.rhtml [deleted file]
app/views/geocoder/search.rhtml [new file with mode: 0644]

diff --git a/app/views/geocoder/_geocoder.rhtml b/app/views/geocoder/_geocoder.rhtml
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/app/views/geocoder/results.rhtml b/app/views/geocoder/results.rhtml
deleted file mode 100644 (file)
index 7f4d710..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<h2>Your Search Results for <%= @place_name.capitalize %></h2>
-
-<table>
-<tr>
-<th>Name</th>
-<th>Country</th>
-<th></th>
-<th></th>
-<th></th>
-</tr>
-
-<% @res_ary.each do |hsh| %>
-
-<tr>
-<td>
-<%=  hsh['name'] %>
-</td>
-<td>
-<%= hsh['countryname'] %>
-</td>
-<td>
-<%= link_to('Map', url="/index.html?mlat=#{hsh['lat']}&mlon=#{hsh['lon']}&zoom=12") %>  
-</td>
-<td>
-<%= link_to('Edit', url="/edit.html?mlat=#{hsh['lat']}&mlon=#{hsh['lon']}&zoom=12") %>  
-</td>
-<td>
-<%= link_to('API', url="/#FIXME") %>  
-</td>
-</tr>
-<% end %>
-
-</table>
diff --git a/app/views/geocoder/search.rhtml b/app/views/geocoder/search.rhtml
new file mode 100644 (file)
index 0000000..bbe1fad
--- /dev/null
@@ -0,0 +1,10 @@
+<% @results.each do |source| %>
+<p class="search_results_heading">Results from <%= link_to source[:source], source[:url] %></p>
+<% if source[:results] %>
+<% source[:results].each do |result| %>
+<p class="search_results_entry"><%= link_to_function result[:description], "setPosition(#{result[:lat]}, #{result[:lon]}, #{result[:zoom]})" %></p>
+<% end %>
+<% else %>
+<p class="search_results_error"><%= source[:error] %></p>
+<% end %>
+<% end %>