Sha256: b903f78a4aa407b79bceccbf7fd1488191528b42d4c5041b4198cabb47fae13f

Contents?: true

Size: 1.71 KB

Versions: 1

Compression:

Stored size: 1.71 KB

Contents

<% content_for :page_title do %>
  <%= Spree.t(:listing_favorite_products) %>
<% end %>

<%= paginate @favorite_products %>

<% if @favorite_products.any? %>
  <table class="table" id="listing_products">
    <colgroup>
       <col style="width: 15%;">
       <col style="width: 10%;">
       <col style="width: 38%;">
       <col style="width: 10%;">
       <col style="width: 17%;">
       <col style="width: 10%;">
    </colgroup>
    <thead>
      <tr data-hook="admin_products_index_headers">
        <th><%= Spree.t(:sku) %></th>
        <th colspan="2"><%= sort_link @search, :name, Spree.t(:name) %></th>
        <th><%= sort_link @search, :master_default_price_amount, Spree.t(:master_price) %></th>
        <th><%= sort_link @search, 'Users Count', Spree.t(:user_count) %></th>
      </tr>
    </thead>
    <tbody>
      <% @favorite_products.each do |product| %>
          <tr <%= "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows" class="<%= cycle('odd', 'even') %>">
            <td class="align-center"><%= product.sku rescue '' %></td>
            <td class="align-center">
              <%= image_tag product.display_image.attachment(:mini) %>
            </td>
            <td><%= link_to product.try(:name), edit_admin_product_path(product) %></td>
            <td class="align-center"><%= product.display_price.to_html rescue '' %></td>
            <td class='align-center'><%= link_to product.favorite_users.count, users_admin_favorite_product_path(:id => product.id) %></td>
          </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <div class="no-objects-found">
    <%= Spree.t(:no_results) %>
  </div>
<% end %>

<%= paginate @favorite_products %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
solidus_favorite_products-2.1.1 app/views/spree/admin/favorite_products/index.html.erb