Small Cleanups + Merchandise Search
[cs356-p2-videostore.git] / app / views / coitem / list.rhtml
1 <h1>Listing Checked Out Items</h1>
2
3 <table border="1">
4   <tr>
5     <th>Item ID</th>
6     <th>Customer</th>
7     <th>Type</th>
8     <th>Rentable</th>
9     <th>Overdue</th>
10     <th>Date Checked Out</th>
11     <th>Due Date</th>
12   </tr>
13   
14 <% for coitem in @coitems %>
15   <tr>
16     <td><%=h coitem.rentable.id.to_s %></td>
17     <td><%=h coitem.customer.name %></td>
18     <td><%=h coitem.rentable.class %></td>
19     <% if coitem.rentable.type == Game %>
20     <td><%=link_to coitem.rentable.title.to_s, :controller => 'game', :action => 'show', :id => coitem.rentable %></td>
21     <% else %>
22     <td><%=link_to coitem.rentable.title.to_s, :controller => 'video', :action => 'show', :id => coitem.rentable %></td>
23     <% end %>
24     <td><%=h tf_to_yesno(coitem.overdue?) %></td>
25     <td><%=h coitem.out_date %></td>
26     <td><%=link_to coitem.due_date.to_s, :action => 'edit', :id => coitem %></td>
27   </tr>
28 <% end %>
29 </table>
30
31 <%= link_to 'Previous page', { :page => @coitem_pages.current.previous } if @coitem_pages.current.previous %>
32 <%= link_to 'Next page', { :page => @coitem_pages.current.next } if @coitem_pages.current.next %> 
33