<commit_before><script type='text/template' id='order-delivery-template'>
  <div id="checkout" data-hook="">  

  <%= render "spree/templates/checkout/header" %>
  
  <div class="row" data-hook="checkout_content">
    <div class="columns alpha twelve" data-hook="checkout_form_wrapper">
      <form class="edit_order">
        <fieldset id="shipping_method" data-hook="">
          <legend align="center">Delivery</legend>
          <div class="inner" data-hook="shipping_method_inner">
            <div id="methods">
              <%% _.each(shipments, function(shipment) { %>
                <div class="shipment">
                  <h3 class="stock-location" data-hook="stock-location">
                    <%= t(:package_from) %>
                    <strong class="stock-location-name" data-hook="stock-location-name">
                      <%%= shipment.stock_location_name %>
                    </strong>
                  </h3>
                </div>

                <table class="stock-contents" data-hook="stock-contents">
                  <colgroup>
                    <col style="width: 10%;">
                    <col style="width: 60%;">
                    <col style="width: 10%;">
                    <col style="width: 20%;">
                  </colgroup>
                  <thead>
                    <tr>
                      <th><%= Spree.t(:image) %></th>
                      <th><%= Spree.t(:name) %></th>
                      <th><%= Spree.t(:quantity) %></th>
                      <th><%= Spree.t(:price) %></th>
                    </tr>
                  </thead>
                  <tbody>
                    <%% _.each(shipment.manifest, function(manifest) { %>
                      <%% var variant = manifest.variant %>
                      <tr class="stock-item">
                        <td class="item-image"><img alt="<%%= variant.name %>" src="<%%= displayImage(variant, 'mini') %>"></td>
                        <td class="item-name"><%%= variant.name %></td>
                        <td class="item-qty"><%%= manifest.quantity %></td>
                        <td class="item-price"><%%= Spree.Money.format(variant.price) %></td>
                      </tr>
                    <%% }) %>
                  </tbody>
                </table>
                <h5 class="stock-shipping-method-title">Shipping Method</h5>
                <ul class="field radios shipping-methods">
                  <%% _.each(shipment.shipping_rates, function(shipping_rate, sr_index) { %>
                    <li class="shipping-method">
                      <label>
                        <input name="order[shipments_attributes][<%%= sr_index %>][id]" type="hidden" value="<%%= shipment.id %>">
                        <input name="order[shipments_attributes][<%%= sr_index %>][selected_shipping_rate_id]" type="radio" value="<%%= shipping_rate.id %>">
                        <span class="rate-name"><%%= shipping_rate.name %></span>
                        <span class="rate-cost"><%%= shipping_rate.display_cost %></span>
                      </label>
                    </li>
                  <%% }) %>
                  <div class="validation-error" style='display:none'><%= Spree.t(:please_select_a_shipping_rate) %></div>
                </ul>
              <%% }) %>
            </div>
          </div>
        </fieldset>
        <br>
        <div class="form-buttons" data-hook="buttons">
          <input class="continue button primary" name="commit" type="submit" value="Save and Continue">
        </div>
      </form>
    </div>
    <%= render "spree/templates/checkout/summary" %>
  </div><commit_msg>Use shipment.id rather than sr_index for nested attributes within checkout/_delivery<commit_after><script type='text/template' id='order-delivery-template'>
  <div id="checkout" data-hook="">  

  <%= render "spree/templates/checkout/header" %>
  
  <div class="row" data-hook="checkout_content">
    <div class="columns alpha twelve" data-hook="checkout_form_wrapper">
      <form class="edit_order">
        <fieldset id="shipping_method" data-hook="">
          <legend align="center">Delivery</legend>
          <div class="inner" data-hook="shipping_method_inner">
            <div id="methods">
              <%% _.each(shipments, function(shipment) { %>
                <div class="shipment">
                  <h3 class="stock-location" data-hook="stock-location">
                    <%= t(:package_from) %>
                    <strong class="stock-location-name" data-hook="stock-location-name">
                      <%%= shipment.stock_location_name %>
                    </strong>
                  </h3>
                </div>

                <table class="stock-contents" data-hook="stock-contents">
                  <colgroup>
                    <col style="width: 10%;">
                    <col style="width: 60%;">
                    <col style="width: 10%;">
                    <col style="width: 20%;">
                  </colgroup>
                  <thead>
                    <tr>
                      <th><%= Spree.t(:image) %></th>
                      <th><%= Spree.t(:name) %></th>
                      <th><%= Spree.t(:quantity) %></th>
                      <th><%= Spree.t(:price) %></th>
                    </tr>
                  </thead>
                  <tbody>
                    <%% _.each(shipment.manifest, function(manifest) { %>
                      <%% var variant = manifest.variant %>
                      <tr class="stock-item">
                        <td class="item-image"><img alt="<%%= variant.name %>" src="<%%= displayImage(variant, 'mini') %>"></td>
                        <td class="item-name"><%%= variant.name %></td>
                        <td class="item-qty"><%%= manifest.quantity %></td>
                        <td class="item-price"><%%= Spree.Money.format(variant.price) %></td>
                      </tr>
                    <%% }) %>
                  </tbody>
                </table>
                <h5 class="stock-shipping-method-title">Shipping Method</h5>
                <ul class="field radios shipping-methods">
                  <%% _.each(shipment.shipping_rates, function(shipping_rate, sr_index) { %>
                    <li class="shipping-method">
                      <label>
                        <input name="order[shipments_attributes][<%%= shipment.id %>][id]" type="hidden" value="<%%= shipment.id %>">
                        <input name="order[shipments_attributes][<%%= shipment.id %>][selected_shipping_rate_id]" type="radio" value="<%%= shipping_rate.id %>">
                        <span class="rate-name"><%%= shipping_rate.name %></span>
                        <span class="rate-cost"><%%= shipping_rate.display_cost %></span>
                      </label>
                    </li>
                  <%% }) %>
                  <div class="validation-error" style='display:none'><%= Spree.t(:please_select_a_shipping_rate) %></div>
                </ul>
              <%% }) %>
            </div>
          </div>
        </fieldset>
        <br>
        <div class="form-buttons" data-hook="buttons">
          <input class="continue button primary" name="commit" type="submit" value="Save and Continue">
        </div>
      </form>
    </div>
    <%= render "spree/templates/checkout/summary" %>
  </div>
{'fraction_non_alphanumeric': 0.17057627118644067, 'fraction_numerical': 0.003254237288135593, 'mean_word_length': 1.5312285518188058, 'pattern_counts': {'":': 0, '<': 207, '<?xml version=': 0, '>': 207, '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': '5519860', 'n_tokens_mistral': 2163, 'n_tokens_neox': 1951, 'n_words': 352}