Prettify the COItem pages
[cs356-p2-videostore.git] / app / views / coitem / list.rhtml
index f6514cb..2b0db69 100644 (file)
@@ -1,26 +1,22 @@
-<h1>Listing coitems</h1>
+<h1>Listing Checked Out Items</h1>
 
-<table>
+<table border="1">
   <tr>
-  <th>Customer</th>
-  <th>Rentable</th>
-  <th>Overdue</th>
-  <% for column in Coitem.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
+    <th>Customer</th>
+    <th>Rentable</th>
+    <th>Overdue</th>
+    <th>Date Checked Out</th>
+    <th>Due Date</th>
   </tr>
   
 <% for coitem in @coitems %>
   <tr>
-  <td><%=h coitem.customer.name %></td>
-  <td><%=h coitem.rentable.title %></td>
-  <td><%=h coitem.overdue? %></td>
-  <% for column in Coitem.content_columns %>
-    <td><%=h coitem.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => coitem %></td>
-    <td><%= link_to 'Edit', :action => 'edit', :id => coitem %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => coitem }, :confirm => 'Are you sure?', :method => :post %></td>
+    <td><%=h coitem.customer.name %></td>
+    <td><%=h coitem.rentable.title %></td>
+    <td><%=h tf_to_yesno(coitem.overdue?) %></td>
+    <td><%=h coitem.out_date %></td>
+    <td><%=h coitem.due_date %></td>
+    <td><%= link_to 'View', :action => 'show', :id => coitem %></td>
   </tr>
 <% end %>
 </table>
@@ -28,6 +24,3 @@
 <%= link_to 'Previous page', { :page => @coitem_pages.current.previous } if @coitem_pages.current.previous %>
 <%= link_to 'Next page', { :page => @coitem_pages.current.next } if @coitem_pages.current.next %> 
 
-<br />
-
-<%= link_to 'New coitem', :action => 'new' %>