]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/map_bugs/my_bugs.html.erb
Add methods to get a bug's author details from the first comment
[rails.git] / app / views / map_bugs / my_bugs.html.erb
index 9802ae1b2d6da4cd38aac506619245fd851dad46..d837c7829b3426409e700327c35656ebe50bb4a9 100644 (file)
@@ -13,7 +13,7 @@
     <th><%= t'bugs.user.last_changed' %></th>
   </tr>
 <% @bugs.each do |bug| %>
-  <tr<% if bug.comments[0].user != @user2 %> bgcolor="#EEEEEE"<% end %>>
+  <tr<% if bug.author != @user2 %> bgcolor="#EEEEEE"<% end %>>
     <td>
       <% if bug.status == "closed" %>
         <%= image_tag("closed_bug_marker.png", :alt => 'closed') %>
       <% end %>
     </td>
     <td><%= link_to bug.id.to_s, :controller => "browse", :action => "bug", :id => bug.id %></td>
-    <% if bug.comments[0].user.nil? %> 
-      <td> <%= bug.comments[0].commenter_name %> </td> 
+    <% if bug.author.nil? %> 
+      <td> <%= bug.author_name %> </td> 
     <% else %> 
-      <td><%= link_to h(bug.comments[0].user.display_name), :controller => "user", :action => "view", :display_name => bug.comments[0].user.display_name %></td>
+      <td><%= link_to h(bug.author_name), :controller => "user", :action => "view", :display_name => bug.author_name %></td>
     <% end %>
-    <td> <%= htmlize bug.comments[0].comment  %> </td> 
-    <td><%= l bug.date_created %></td>
-    <td><%= l bug.last_changed %></td>
+    <td> <%= htmlize bug.comments.first.body  %> </td> 
+    <td><%= l bug.created_at %></td>
+    <td><%= l bug.updated_at %></td>
   </tr>
 <% end %>
 </table>