<!-- <p id="notice"><%= notice %></p> -->
<div class="page-header">
  <ol class="breadcrumb">
    <li class="breadcrumb-item"><a href="<%= root_path %>">Home</a></li>
    <li class="breadcrumb-item active">Promotions</li>
    <span class="float-right">
      <%= link_to 'Back', root_path %>
    </span>
  </ol>
</div>
<br>
<div class="m-b-10 clearfix">
  <%= link_to t("views.btn.new"),new_settings_promotion_promotion_product_path,:class => 'btn btn-primary btn-lg float-right waves-effect"' %>
</div>

<div class="row">
  <div class="col-xs-12 col-sm-12 col-md-9 col-lg-9">
    <div class="card">
      <table class="table table-striped">
        <thead>
          <tr>
            <th>Promotion Code</th>
            <th>Item Code</th>
            <th>Minimum Quantity</th>
            <th>Net Off</th>
            <th>Net Price</th>
            <th>Percentage</th>
            <th>Created At</th>
            <th>Actions</th>
          </tr>
        </thead>
        <tbody>
          <% @promotion_products.each do |pro| %>
            <tr>
              <td><%= link_to pro.promotion.promo_code, settings_promotion_promotion_path(pro.promotion) %></td>
              <td><%= pro.item_code %></td>
              <td><%= pro.min_qty %></td>
              <td><%= pro.net_off rescue "-" %></td>
              <td><%= pro.net_price rescue "-" %></td>
              <td><%= pro.percentage %></td>
              <td><%= pro.created_at.strftime("%Y-%m-%d/%I:%M %p"),:class => 'btn btn-primary btn-lg waves-effect' %>
              <%= link_to t("views.btn.edit"), edit_settings_promotion_promotion_product_path(pro),:class => 'btn btn-info btn-lg waves-effect' %>
              <button class="delete btn btn-danger btn-sm waves-effect" data-ref="<%=settings_promotion_promotion_product_path(pro)%>" data-method="delete">
                <%= t("views.btn.delete") %>
              </button>

              <span class="hidden" id="delete_text">
                <h6>Are you sure you want to delete this row ?</h6>
                <h6>This action can't be undo. </h6> 
              </span>
              </td>
            </tr>
          <% end %>
        </tbody>
      </table>
    </div>
  </div>
  <div class="col-xs-12 col-sm-12 col-md-3 col-lg-3">
    <div class="card">
      <div class="body">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
         tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
         quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
         consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
      </div>
    </div>  
  </div>
</div>

