<commit_before><% options ||= {} %>
<% options = {show_title: true, append_new_link: true}.merge(options) %>
<% if options[:show_title] %>
<h3><%= t("#{type}.index.title") %></h3>
<% end %>
<% if collection.none? %>
<p><%= I18n.t("#{type}.index.empty_collection")%></p>
<% else %>
<table class="table table-striped">
  <thead>
    <tr class="<%= cycle("odd", "even") %>">
  <% (columns.is_a?(Hash) ? columns.keys : columns).map{|c| c.gsub('_id', '')}.each do |column| %>
      <th><%= t("activerecord.attributes.#{type.singularize}.#{column}") %></th>
  <% end %>
    </tr>
  </thead>
  <tbody>
  <% collection.each do |resource| %>
    <tr class="<%= cycle("odd", "even") %>">
    <% (columns.is_a?(Hash) ? columns.keys : columns).each do |column| %>
      <td>
        <%= table_cell column, resource, columns.is_a?(Hash) ? columns[column] : nil %>
      </td>
    <% end %>
    <% if resource.respond_to? :state_events %>
      <td>
        <%= render partial: "shared/resource/actions", locals: { type: type, resource: resource } %>
      </td>
    <% end %>
    </tr>
  <% end %>
  </tbody>
</table>
<% end %>

<% if options[:append_new_link] %>
  <% if parent %>
    <%= link_to t("#{type}.new.title"), eval("new_#{parent.class.name.tableize.singularize}_#{type.singularize}_path(parent)") %>
  <% else %>
    <%= link_to t("#{type}.new.title"), eval("new_#{type.singularize}_path") %>
  <% end %>
<% end %><commit_msg>Always show the actions for each resource of a resources table<commit_after><% options ||= {} %>
<% options = {show_title: true, append_new_link: true}.merge(options) %>
<% if options[:show_title] %>
<h3><%= t("#{type}.index.title") %></h3>
<% end %>
<% if collection.none? %>
<p><%= I18n.t("#{type}.index.empty_collection")%></p>
<% else %>
<table class="table table-striped">
  <thead>
    <tr class="<%= cycle("odd", "even") %>">
  <% (columns.is_a?(Hash) ? columns.keys : columns).map{|c| c.gsub('_id', '')}.each do |column| %>
      <th><%= t("activerecord.attributes.#{type.singularize}.#{column}") %></th>
  <% end %>
      <th></th>
    </tr>
  </thead>
  <tbody>
  <% collection.each do |resource| %>
    <tr class="<%= cycle("odd", "even") %>">
    <% (columns.is_a?(Hash) ? columns.keys : columns).each do |column| %>
      <td>
        <%= table_cell column, resource, columns.is_a?(Hash) ? columns[column] : nil %>
      </td>
    <% end %>
      <td>
        <%= render partial: "shared/resource/actions", locals: { type: type, resource: resource } %>
      </td>
    </tr>
  <% end %>
  </tbody>
</table>
<% end %>

<% if options[:append_new_link] %>
  <% if parent %>
    <%= link_to t("#{type}.new.title"), eval("new_#{parent.class.name.tableize.singularize}_#{type.singularize}_path(parent)") %>
  <% else %>
    <%= link_to t("#{type}.new.title"), eval("new_#{type.singularize}_path") %>
  <% end %>
<% end %>
{'fraction_non_alphanumeric': 0.2551699964949176, 'fraction_numerical': 0.0028040658955485456, 'mean_word_length': 3.6482084690553744, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 101, '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': '5314465', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1031, 'n_words': 193}