fix import bug, make points commify
authorSteve Coast <steve@asklater.com>
Sat, 7 Apr 2007 16:56:45 +0000 (16:56 +0000)
committerSteve Coast <steve@asklater.com>
Sat, 7 Apr 2007 16:56:45 +0000 (16:56 +0000)
app/views/trace/view.rhtml
lib/daemons/gpx_import.rb

index 3bc2abada7e5a5ba009c85527eaa7bf0be75fc3d..be3cbef0011eee5b6dd4b31e177c7d4254bd14ee 100644 (file)
@@ -5,8 +5,8 @@
 <table border="0">
   <tr><td>filename:</td><td><%= @trace.name %></td></tr> <!-- TODO link to download -->
   <tr><td>uploaded at:</td><td><%= @trace.timestamp %></td></tr>
-  <tr><td>points:</td><td><%= @trace.size %></td></tr>
-  <tr><td>start coordinate:</td><td><%= @trace.latitude %>, <%= @trace.longitude %></td></tr> <!-- TODO link to map -->
+  <tr><td>points:</td><td><%= @trace.size.to_s.gsub(/(\d)(?=(\d{3})+$)/,'\1,') %></td></tr>
+  <tr><td>start coordinate:</td><td><%= @trace.latitude %>, <%= @trace.longitude %></td></tr> <!-- FIXME link to map -->
   <tr><td>owner:</td><td><%= link_to @trace.user.display_name, {:controller => 'trace', :action => 'view', :display_name => @trace.user.display_name, :id => nil} %></td></tr>
   <tr><td>description:</td><td><%= @trace.description %></td></tr>
   <tr><td>tags:</td><td>
index b0e6a178264688b032b289eae57397a9535a6bb0..42e642b8bc30831c87bde9b3765a31eb6e27b3f9 100755 (executable)
@@ -61,7 +61,7 @@ while($running) do
           min_lon = Tracepoint.minimum('longitude', :conditions => ['gpx_id = ?', trace.id])
 
           trace.latitude = f_lat
-          trace.longitude = f_lat
+          trace.longitude = f_lon
           trace.large_picture = gpx.get_picture(min_lat, min_lon, max_lat, max_lon, gpx.actual_points)
           trace.icon_picture = gpx.get_icon(min_lat, min_lon, max_lat, max_lon)
           trace.size = gpx.actual_points