1 <div id="product-list">
2 <h1>Listing products</h1>
5 <% for product in @products %>
6 <tr class="<%= cycle('list-line-odd', 'list-line-even') %>">
8 <%= image_tag product.image_url, :class => 'list-image' %>
10 <td class="list-description">
12 <dt><%=h product.title %></dt>
13 <dd><%=h truncate(product.description.gsub(/<.*?>/, '|'),
14 :length => 80) %></dd>
15 <dd><%=number_to_currency product.price, :unit => "£" %>
16 <% if product.date_available.past? %>
17 <dd>Available since <%= product.date_available %></dd>
19 <dd class="unavailable">Available from <%= product.date_available %></dd>
21 <% if not product.date_available_until.nil? %>
22 <% if product.date_available_until.future? %>
23 <dd>Available until <%= product.date_available_until %></dd>
25 <dd class="unavailable">Unavailable since <%= product.date_available_until %></dd>
31 <td class="list-actions">
32 <%= link_to 'Show', product %><br/>
33 <%= link_to 'Edit', edit_product_path(product) %><br/>
34 <%= link_to 'Destroy', product, :confirm => 'Are you sure?', :method => :delete %><br/>
41 <%= link_to 'New product', new_product_path %>