<commit_before><% content_for :page_actions do %>  
  <li><%= button_link_to Spree.t('new_supplier'), new_object_url, :icon => 'icon-plus' %></li>
<% end %>

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

<% content_for :table_filter_title do %>
  <%= Spree.t(:search) %>
<% end %>

<% content_for :table_filter do %>
  <div data-hook='admin_suppliers_filter'>
    <%= search_form_for [:admin, @search] do |f| %>
      <div class="alpha nine columns">
        <div class="field">
          <%= f.label :name_cont, Spree.t(:name) %>
          <%= f.text_field :name_cont, :size => 15 %>
        </div>
      </div>
      <div class="clear"></div>
      <div class="form-buttons actions filter-actions" data-hook="admin_suppliers_index_search_buttons">
        <%= button Spree.t(:search), 'icon-search' %>
      </div>
    <% end %>
  </div>
<% end %>

<% if @collection.any? %>
  <table class="index" id="listing_suppliers">
    <colgroup>
       <col style="width: 25%;">
       <col style="width: 25%;">
       <col style="width: 25%;">
       <col style="width: 25%;">
    </colgroup>
    <thead>
      <tr data-hook='admin_suppliers_index_headers'>
        <th><%= sort_link @search, :name,  Spree::Supplier.human_attribute_name(:name) %></th>
        <th><%= sort_link @search, :email, Spree::Supplier.human_attribute_name(:email) %></th>
        <th><%= sort_link @search, :email, Spree::Supplier.human_attribute_name(:active) %></th>
        <th data-hook="admin_suppliers_index_header_actions" class="actions"></th>
      </tr>
    </thead>
    <tbody>
      <%- @collection.each do |supplier| %>
        <tr <%= "style='color: red;'" if supplier.deleted? %> id="<%= dom_id supplier %>" data-hook="admin_suppliers_index_rows" class="<%= cycle('odd', 'even') %>">
          <td class='align-center'><%= link_to supplier.name, edit_object_url(supplier) %></td>
          <td class='align-center'><%= mail_to supplier.email %></td>
          <td class='align-center'><%= supplier.active %></td>
          <td class='actions' data-hook='admin_suppliers_index_row_actions'>
            <% unless supplier.deleted? %>
              <%= link_to_edit supplier, :no_text => true, :class => 'edit' %>
              &nbsp;
              <%= link_to_delete supplier, :no_text => true %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <div class="no-objects-found">
    <%= Spree.t(:no_results) %>
  </div>
<% end %>

<%= paginate @collection %>
<commit_msg>Update index page to list users.<commit_after><% content_for :page_actions do %>  
  <li><%= button_link_to Spree.t('new_supplier'), new_object_url, :icon => 'icon-plus' %></li>
<% end %>

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

<% content_for :table_filter_title do %>
  <%= Spree.t(:search) %>
<% end %>

<% content_for :table_filter do %>
  <div data-hook='admin_suppliers_filter'>
    <%= search_form_for [:admin, @search] do |f| %>
      <div class="alpha nine columns">
        <div class="field">
          <%= f.label :name_cont, Spree.t(:name) %>
          <%= f.text_field :name_cont, :size => 15 %>
        </div>
      </div>
      <div class="clear"></div>
      <div class="form-buttons actions filter-actions" data-hook="admin_suppliers_index_search_buttons">
        <%= button Spree.t(:search), 'icon-search' %>
      </div>
    <% end %>
  </div>
<% end %>

<% if @collection.any? %>
  <table class="index" id="listing_suppliers">
    <colgroup>
       <col style="width: 25%;">
       <col style="width: 25%;">
       <col style="width: 25%;">
       <col style="width: 25%;">
    </colgroup>
    <thead>
      <tr data-hook='admin_suppliers_index_headers'>
        <th><%= sort_link @search, :name,  Spree::Supplier.human_attribute_name(:name) %></th>
        <th><%= sort_link @search, :email, Spree::Supplier.human_attribute_name(:email) %></th>
        <th><%= Spree.t(:users) %></th>
        <th><%= sort_link @search, :active, Spree::Supplier.human_attribute_name(:active) %></th>
        <th data-hook="admin_suppliers_index_header_actions" class="actions"></th>
      </tr>
    </thead>
    <tbody>
      <%- @collection.each do |supplier| %>
        <tr <%= "style='color: red;'" if supplier.deleted? %> id="<%= dom_id supplier %>" data-hook="admin_suppliers_index_rows" class="<%= cycle('odd', 'even') %>">
          <td class='align-center'><%= link_to supplier.name, edit_object_url(supplier) %></td>
          <td class='align-center'><%= mail_to supplier.email %></td>
          <td><%= supplier.users.pluck(:email).join(', ') %></td>
          <td class='align-center'><%= supplier.active %></td>
          <td class='actions' data-hook='admin_suppliers_index_row_actions'>
            <% unless supplier.deleted? %>
              <%= link_to_edit supplier, :no_text => true, :class => 'edit' %>
              &nbsp;
              <%= link_to_delete supplier, :no_text => true %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <div class="no-objects-found">
    <%= Spree.t(:no_results) %>
  </div>
<% end %>

<%= paginate @collection %>

{'fraction_non_alphanumeric': 0.2036042944785276, 'fraction_numerical': 0.003834355828220859, 'mean_word_length': 2.9946401225114854, 'pattern_counts': {'":': 0, '<': 173, '<?xml version=': 0, '>': 183, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2881693', 'n_tokens_mistral': 1920, 'n_tokens_neox': 1765, 'n_words': 345}