Small Cleanups + Merchandise Search
[cs356-p2-videostore.git] / app / views / video / list.rhtml
index 1a0ec16..198eeb1 100644 (file)
@@ -1,24 +1,28 @@
 <h1>Listing videos</h1>
 
-<table>
+<table border="1">
   <tr>
-  <th>Video ID</th>
-  <th>Checked Out</th>
-  <% for column in Video.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
+    <th>Video ID</th>
+    <th>Title</th>
+    <th>Checked Out</th>
+    <th>New Release</th>
+    <th>Genre</th>
+    <th>Director</th>
+    <th>Media</th>
   </tr>
   
 <% for video in @videos %>
   <tr>
-  <td><%=h video.id %></td>
-  <td><%=h video.checkedout? %></td>
-  <% for column in Video.content_columns %>
-    <td><%=h video.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => video %></td>
+    <td><%=h video.id %></td>
+    <td><%=h video.title %></td>
+    <td><%=h tf_to_yesno(video.checkedout?) %></td>
+    <td><%=h tf_to_yesno(video.newrelease) %></td>
+    <td><%=h video.genre.name %></td>
+    <td><%=h video.director %></td>
+    <td><%=h video.media.name %></td>
+    <td><%= link_to 'View', :action => 'show', :id => video %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => video %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => video }, :confirm => 'Are you sure?', :method => :post %></td>
+    <td><%= link_to 'Remove', { :action => 'destroy', :id => video }, :confirm => 'Are you sure?', :method => :post %></td>
   </tr>
 <% end %>
 </table>