]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/trace/_trace.rhtml
Merge rails_port as of r4613 & fix tests.
[rails.git] / app / views / trace / _trace.rhtml
index 73fb5080ccc1f9b803a7c03abad456a7282543a9..91862444ab34c72825f15822abd0ff64e576db58 100644 (file)
@@ -1,16 +1,30 @@
 <tr>
   <% cl = cycle('table0', 'table1') %>
-  <td class="<%= cl %>">image here</td>
-  <td class="<%= cl %>"><%= link_to trace.name, {:controller => 'trace', :action => 'onetrace', :id => trace.id} %>
+  <td class="<%= cl %>">
+    <% if trace.inserted %>
+    <a href="<%= url_for :controller => 'trace', :action => 'view', :id => trace.id, :display_name => trace.user.display_name %>"><img src="<%= url_for :controller => 'trace', :action => 'icon', :id => trace.id, :display_name => trace.user.display_name %>" border="0" alt="" /></a>
+    <% else %>
+    <span style="color:red">PENDING</span>
+    <% end %>
+  </td>
+  <td class="<%= cl %>"><%= link_to trace.name, {:controller => 'trace', :action => 'view', :display_name => trace.user.display_name, :id => trace.id} %>
     <span class="gpxsummary" title="<%= trace.timestamp %>"> ... 
       <% if trace.inserted %> 
-      (<%= trace.size %> points)
+      (<%= trace.size.to_s.gsub(/(\d)(?=(\d{3})+$)/,'\1,') %> points)
       <% end %> 
       ... <%= time_ago_in_words( trace.timestamp ) %>  ago</span>
-    <a href="/traces/user/blars/12701" title="more detail..." >more</a> /
-    <a href="/edit.html?lat=34.1032333&lon=-118.2272333&zoom=14" title="create maps">map</a><br />
-      <%= trace.description %>
+      <%= link_to 'more', {:controller => 'trace', :action => 'view', :display_name => trace.user.display_name, :id => trace.id}, {:title => 'View Trace Details'} %> /
+      <%= link_to_if trace.inserted?, 'map', {:controller => 'site', :action => 'index', :lat => trace.latitude, :lon => trace.longitude, :zoom => 14}, {:title => 'View Map'} %> /
+      <%= link_to_if trace.inserted?, 'edit', {:controller => 'site', :action => 'edit', :lat => trace.latitude, :lon => trace.longitude, :zoom => 14, :gpx => trace.id }, {:title => 'Edit Map'} %>
+      <br />
+      <%= escape_once(trace.description) %>
     <br />
-    by <%= link_to trace.user.display_name, {:controller => 'trace', :action => 'list', :user => trace.user.display_name} %>
+    by <%= link_to trace.user.display_name, {:controller => 'user', :action => 'view', :display_name => trace.user.display_name} %>
+    in 
+    <% if trace.tags %>
+      <% trace.tags.each do |tag| %>
+        <%= link_to_tag tag.tag %>
+      <% end %>
+    <% end %>
   </td>
 </tr>