<commit_before><% content_for :page_title do %>
  <%= plural_resource_name(Spree::ShippingMethod) %>
<% end %>

<% content_for :page_actions do %>
  <%= button_link_to Spree.t(:new_shipping_method), new_object_url,  class: "btn-success", icon: 'add', id: 'admin_new_shipping_method_link' %>
<% end if can? :create, Spree::ShippingMethod %>

<% if @shipping_methods.any? %>
  <table class="table" id='listing_shipping_methods'>
    <thead>
      <tr data-hook="admin_shipping_methods_index_headers">
        <th><%= Spree.t(:name) %></th>
        <th><%= Spree.t(:zone) %></th>
        <th><%= Spree.t(:calculator) %></th>
        <th class="text-center"><%= Spree.t(:display) %></th>
        <% if current_spree_user.respond_to?(:has_spree_role?) && current_spree_user.has_spree_role?(:admin) %>
          <th><%= Spree.t(:vendor_name) %>
        <% end %>
        <th data-hook="admin_shipping_methods_index_header_actions" class="actions"></th>
      </tr>
    </thead>
    <tbody>
      <% @shipping_methods.includes(:zones, :calculator).each do |shipping_method|%>
        <tr id="<%= spree_dom_id shipping_method %>" data-hook="admin_shipping_methods_index_rows">
          <td><%= shipping_method.admin_name + ' / ' if shipping_method.admin_name.present? %><%= shipping_method.name %></td>
          <td><%= shipping_method.zones.collect(&:name).join(", ") if shipping_method.zones %></td>
          <td><%= shipping_method.calculator.description %></td>
          <td class="text-center"><%= shipping_method.display_on.blank? ? Spree.t(:both) : Spree.t(shipping_method.display_on) %></td>
          <% if current_spree_user.respond_to?(:has_spree_role?) && current_spree_user.has_spree_role?(:admin) %>
            <td><%= shipping_method.vendor.try(:name) %><commit_msg>Fixed admin shipments when vendor association isn't defined for Shipment model<commit_after><% content_for :page_title do %>
  <%= plural_resource_name(Spree::ShippingMethod) %>
<% end %>

<% content_for :page_actions do %>
  <%= button_link_to Spree.t(:new_shipping_method), new_object_url,  class: "btn-success", icon: 'add', id: 'admin_new_shipping_method_link' %>
<% end if can? :create, Spree::ShippingMethod %>

<% if @shipping_methods.any? %>
  <table class="table" id='listing_shipping_methods'>
    <thead>
      <tr data-hook="admin_shipping_methods_index_headers">
        <th><%= Spree.t(:name) %></th>
        <th><%= Spree.t(:zone) %></th>
        <th><%= Spree.t(:calculator) %></th>
        <th class="text-center"><%= Spree.t(:display) %></th>
        <% if current_spree_user.respond_to?(:has_spree_role?) && current_spree_user.has_spree_role?(:admin) && Spree::Shipment.method_defined?(:vendor) %>
          <th><%= Spree.t(:vendor_name) %>
        <% end %>
        <th data-hook="admin_shipping_methods_index_header_actions" class="actions"></th>
      </tr>
    </thead>
    <tbody>
      <% @shipping_methods.includes(:zones, :calculator).each do |shipping_method|%>
        <tr id="<%= spree_dom_id shipping_method %>" data-hook="admin_shipping_methods_index_rows">
          <td><%= shipping_method.admin_name + ' / ' if shipping_method.admin_name.present? %><%= shipping_method.name %></td>
          <td><%= shipping_method.zones.collect(&:name).join(", ") if shipping_method.zones %></td>
          <td><%= shipping_method.calculator.description %></td>
          <td class="text-center"><%= shipping_method.display_on.blank? ? Spree.t(:both) : Spree.t(shipping_method.display_on) %></td>
          <% if current_spree_user.respond_to?(:has_spree_role?) && current_spree_user.has_spree_role?(:admin) && Spree::Shipment.method_defined?(:vendor) %>
            <td><%= shipping_method.vendor.try(:name) %>
{'fraction_non_alphanumeric': 0.18630358587220275, 'fraction_numerical': 0.0, 'mean_word_length': 4.247524752475248, 'pattern_counts': {'":': 0, '<': 103, '<?xml version=': 0, '>': 103, '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': '4622393', 'n_tokens_mistral': 1352, 'n_tokens_neox': 1274, 'n_words': 192}