Sha256: f4fc635891522f7d994672904f559e92dab8ea5fc7b64db6a3efcd75bda0f591

Contents?: true

Size: 1.97 KB

Versions: 4

Compression:

Stored size: 1.97 KB

Contents

<% editable = true if local_assigns[:editable].nil? %>
<% cart = local_assigns[:cart].nil? ? @cart : cart %>

<div class="table-responsive">
  <table class="table tb-checkout-cart-table">
    <thead>
      <tr>
        <th>Product</th>
        <th>Quantity</th>
        <th>Price</th>
        <% if editable %>
          <th></th>
        <% end %>
      </tr>
    </thead>
    <tbody>
      <% cart.cart_items.each do |cart_item| %>
        <tr class="tb-checkout-cart-row">
          <td>
            <% if cart_item.has_item_url? %>
              <%= link_to cart_item.item_description, cart_item.item_url(self) %>
            <% else %>
              <%= cart_item.item_description %>
            <% end %>
            <% if cart.is_completed? && cart_item.has_detail_view? %>
              <div class="tb-checkout-cart-row-detail">
                <%= render :partial => cart_item.detail_view, :locals => {:item => cart_item.item} %>
              </div>
            <% end %>
          </td>
          <td>
            <% if editable && cart_item.item.class.quantity_is_editable %>
              <%= form_for cart_item, :html => {:class => 'tb-checkout-cart-item-update-form'} do |f| %>
                <%= f.number_field :quantity %>
                <%= f.submit 'Update', :class => 'btn btn-sm tb-checkout-cart-item-update-submit' %>
              <% end %>
            <% else %>
              <%= cart_item.quantity %>
            <% end %>
          </td>
          <td><%= number_to_currency cart_item.total_price %></td>
          <td>
            <% if editable %>
              <%= link_to 'Remove', tb_checkout_cart_item_path(cart_item), :method => :delete, :class => 'btn btn-sm btn-danger tb-checkout-cart-item-remove' %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
    <tfoot>
      <tr>
        <td colspan="2">
          Total
        </td>
        <td><%= number_to_currency cart.total_price %></td>
        <td></td>
      </tr>
    </tfoot>
  </table>
</div>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
tb_checkout-1.1.1 app/views/tb_checkout/carts/_cart.html.erb
tb_checkout-1.1.0 app/views/tb_checkout/carts/_cart.html.erb
tb_checkout-1.0.7 app/views/tb_checkout/carts/_cart.html.erb
tb_checkout-1.0.6 app/views/tb_checkout/carts/_cart.html.erb