<div class='toolbar'>
  <ul class='actions'>
    <li>
      <%= button_link_to t(:new_promotion), spree.new_admin_promotion_path, :icon => 'add' %>
    </li>
  </ul>
  <br class="clear" />
</div>

<h1><%= t(:promotions) %></h1>

<table class="index">
  <thead>
    <tr>
      <th><%= t(:name) %></th>
      <th><%= t(:code) %></th>
      <th><%= t(:description) %></th>
      <th><%= t(:usage_limit) %></th>
      <th><%= t(:expiration) %></th>
      <th style="width:150px;"><%= t(:action) %></th>
    </tr>
  </thead>
  <tbody>
    <% @promotions.each do |promotion| %>
      <tr id="<%= dom_id promotion %>">
        <td><%= promotion.name %></td>
        <td><%= promotion.code %></td>
        <td><%= promotion.description %></td>
        <td><%= promotion.usage_limit %></td>
        <td><%= promotion.expires_at.to_date.to_s(:short_date) if promotion.expires_at %></td>
        <td>
          <%= link_to_edit promotion %> &nbsp;
          <%= link_to_delete promotion %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
