<commit_before><% form_for :order, order, :url => {:action => :confirm, :id => order} do |f| %>
  <% if order.cycle.delivery_methods.count > 0 %>
    <div>
      <h3><%= t('orders_cycle_plugin.views.order._delivery.delivery_method') %></h3>
      <strong><%= order.supplier_delivery.name %></strong>
      <div class="subtitle"><%= order.supplier_delivery.description %></div>
    </div>

    <% if order.open? and order.cycle.delivery_methods.count > 1 %>
      <%= labelled_field f, :supplier_delivery_id, t('orders_cycle_plugin.views.order._delivery.choose_another'),
        f.select(:supplier_delivery_id, order.cycle.delivery_methods.collect{ |d| [d.name, d.id] }, {},
                 :onchange => "jQuery('#delivery-box').load('#{url_for(:action => :render_delivery, :id => order.id)}', jQuery(this).parents('form').serialize());"),
        :class => 'subtitle' %>
    <% end %>
  <% end %>

  <div>
    <% if order.open? %>
      <%= f.submit t('orders_cycle_plugin.views.order._delivery.confirm_order'), :confirm => t('orders_cycle_plugin.views.order._delivery.confirming_this_order') %>&emsp;
      <%= link_to t('orders_cycle_plugin.views.order._delivery.cancel_order'), {:action => :cancel, :id => order.id} %>
    <% end %>
  </div>
<% end %>
<commit_msg>Check if supplier delivery is selected<commit_after><% form_for :order, order, :url => {:action => :confirm, :id => order} do |f| %>
  <% if order.cycle.delivery_methods.count > 0 %>
    <div>
      <h3><%= t('orders_cycle_plugin.views.order._delivery.delivery_method') %></h3>
      <% if order.supplier_delivery %>
        <strong><%= order.supplier_delivery.name %></strong>
        <div class="subtitle"><%= order.supplier_delivery.description %></div>
      <% end %>
    </div>

    <% if order.open? and order.cycle.delivery_methods.count > 1 %>
      <%= labelled_field f, :supplier_delivery_id, t('orders_cycle_plugin.views.order._delivery.choose_another'),
        f.select(:supplier_delivery_id, order.cycle.delivery_methods.collect{ |d| [d.name, d.id] }, {},
                 :onchange => "jQuery('#delivery-box').load('#{url_for(:action => :render_delivery, :id => order.id)}', jQuery(this).parents('form').serialize());"),
        :class => 'subtitle' %>
    <% end %>
  <% end %>

  <div>
    <% if order.open? %>
      <%= f.submit t('orders_cycle_plugin.views.order._delivery.confirm_order'), :confirm => t('orders_cycle_plugin.views.order._delivery.confirming_this_order') %>&emsp;
      <%= link_to t('orders_cycle_plugin.views.order._delivery.cancel_order'), {:action => :cancel, :id => order.id} %>
    <% end %>
  </div>
<% end %>

{'fraction_non_alphanumeric': 0.20099160945842867, 'fraction_numerical': 0.0030511060259344014, 'mean_word_length': 3.87546468401487, 'pattern_counts': {'":': 0, '<': 53, '<?xml version=': 0, '>': 77, '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': '3836666', 'n_tokens_mistral': 947, 'n_tokens_neox': 878, 'n_words': 142}