Sha256: 4bf09db8d7e90966b00ee1ffe4f700bc993dfeb5c879cb03ca94d920249e31b1

Contents?: true

Size: 1.68 KB

Versions: 6

Compression:

Stored size: 1.68 KB

Contents

<% content_for :data_controls do %>
  <%= form_tag tb_checkout_admin_carts_path, :method => :get, :class => 'tb-checkout-cart-filter-form' do %>
  <%= select_tag :status, options_for_select([
    ['All', 'all'],
    ['Complete', 'completed'],
    ['In Progress', 'in-progress'],
    ['Abandoned', 'abandoned']
  ], params[:status]), :class => 'form-control' %>
  <% end %>
<% end %>

<% content_for :detail do %>
  <div class="table-responsive">
    <table class="table table-striped table-hover">
      <thead>
        <th>User</th>
        <th>Description</th>
        <th>Total Price</th>
        <th>Status</th>
        <th>Last Modified</th>
        <th></th>
      </thead>
      <tbody>
        <% @carts.each do |cart| %>
          <tr>
            <td class="no-wrap"><%= cart.user_full_name %></td>
            <td><%= cart.description %></td>
            <td>
              <% if cart.is_empty? %>
                Empty
              <% else %>
                <%= number_to_currency cart.total_price %>
              <% end %>
            </td>
            <td>
              <%= tb_checkout_status_label_for_cart(cart) %>
            </td>
            <td class="no-wrap"><%= cart.updated_at.strftime('%I:%M %p, %D') %></td>
            <td>
              <%= link_to 'Detail', tb_checkout_admin_cart_path(cart, :status => params[:status]), :class => 'btn btn-sm btn-default' %>
            </td>
          </tr>
        <% end %>
      </tbody>
    </table>
  </div>
  <%= will_paginate @carts %>

  <script>
    $(document).ready(function(){
      $('.tb-checkout-cart-filter-form').on('change', 'select', function(e){
        $(this).parents('form').submit();
      });
    });
  </script>
<% end %>

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
tb_checkout-1.1.1 app/views/tb_checkout/admin/carts/index.html.erb
tb_checkout-1.1.0 app/views/tb_checkout/admin/carts/index.html.erb
tb_checkout-1.0.7 app/views/tb_checkout/admin/carts/index.html.erb
tb_checkout-1.0.6 app/views/tb_checkout/admin/carts/index.html.erb
tb_checkout-1.0.5 app/views/tb_checkout/admin/carts/index.html.erb
tb_checkout-1.0.4 app/views/tb_checkout/admin/carts/index.html.erb