<commit_before><div class="box-view">
  <% editable = order && order.open? %>

  <div class="box-field product box-edit-link"><%= product.name + " " + product.unit_detail %></div>
  <div class="box-field price-with-unit"><%= price_with_unit_span product.price, product.unit %></div>

  <div class="box-field quantity">
    <div class="quantity-label">
      <% if ordered_product %>
        <span class="label"><%= ordered_product.quantity_asked %></span>
        <span class="unit"><%= product.unit.singular %></span>
        <%= link_to_function _('change'), "" if editable %>
      <% elsif editable %>
        <%= link_to_function _('include'), "" %>
      <% end %>
    </div>
    <div class="quantity-entry" style="display: none">
      <% if editable %>
        <%= text_field_tag 'quantity_asked', ordered_product ? ordered_product.quantity_asked : '1' %>
      <% elsif ordered_product %>
        <%= ordered_product.quantity_asked %>
      <% end %>
    </div>
  </div>

  <div class="cleaner"></div>
</div>

<div class="box-edit subtitle" style="display: none">
  <div class="box-field product-info">
    <div>
      <div class="box-field product product-desc">
        <%= product.description.blank? ? _('No description') : excerpt_ending(product.description, 250) %>
      </div>

      <div class="box-field price-with-unit">
        <div><%= _("price's descriptive") %></div>
        <div class="price-descriptive">
          <%= _("%{price} + %{percent}% = %{price_with_margin}") % {
            :price => product.buy_price,
            :percent => product.margin_percentage,
            :price_with_margin => product.price, } %>
        </div>
      </div>
    </div>

    <div>
      <% if product.supplier.profile.city %>
        <div class="product-city">
          <span class="field-title"><%= _('City') %></span>
          <span><%= _('%{city}/%{state}') % {:city => product.supplier.profile.city, :state => product.supplier.profile.state} %></span>
        </div>
      <% end %>

    </div>

    <div class="product-supplier-link">
      <% unless product.supplier.dummy? %>
        <%= link_to _("More about the producer \"%{supplier}\"") % {:supplier => product.supplier.name}, product.supplier.profile.url, :target => '_blank' %>
      <% end %>
    </div>
  </div>

  <div class="box-field quantity">
    <span class="unit"><%= product.unit.singular %></span>

    <div class="product-image">
      <%= _('Product Image'); %>
    </div>

    <% if editable %>
      <%= submit_to_function (ordered_product ? _('Change') : _('Add')), "distribution.setLoading('session-product-#{product.id}'); jQuery.post('#{url_for(:controller => :distribution_plugin_ordered_product, :action => :new)}',
        {order_id: #{order.id}, session_product_id: #{product.id}, quantity_asked: jQuery(this).parents('.order-session-product').find('.quantity-entry input').val() });" %>
      <%= link_to_function _('cancel'), :class => 'toggle-edit' %>
    <% end %>
  </div>

  <div class="cleaner"></div>
</div>

<% javascript_tag do %>
  jQuery("#session-product-<%=product.id%>").toggleClass('in-order', <%= !ordered_product.blank? %>);
<% end %>

<div class="cleaner"></div>
<commit_msg>Adjust unit detail to layout<commit_after><div class="box-view">
  <% editable = order && order.open? %>

  <div class="box-field product box-edit-link"><%= product.name %></div>
  <div class="box-field price-with-unit"><%= price_with_unit_span product.price, product.unit, product.unit_detail %></div>

  <div class="box-field quantity">
    <div class="quantity-label">
      <% if ordered_product %>
        <span class="label"><%= ordered_product.quantity_asked %></span>
        <span class="unit"><%= product.unit.singular %></span>
        <%= link_to_function _('change'), "" if editable %>
      <% elsif editable %>
        <%= link_to_function _('include'), "" %>
      <% end %>
    </div>
    <div class="quantity-entry" style="display: none">
      <% if editable %>
        <%= text_field_tag 'quantity_asked', ordered_product ? ordered_product.quantity_asked : '1' %>
      <% elsif ordered_product %>
        <%= ordered_product.quantity_asked %>
      <% end %>
    </div>
  </div>

  <div class="cleaner"></div>
</div>

<div class="box-edit subtitle" style="display: none">
  <div class="box-field product-info">
    <div>
      <div class="box-field product product-desc">
        <%= product.description.blank? ? _('No description') : excerpt_ending(product.description, 250) %>
      </div>

      <div class="box-field price-with-unit">
        <div><%= _("price's descriptive") %></div>
        <div class="price-descriptive">
          <%= _("%{price} + %{percent}% = %{price_with_margin}") % {
            :price => product.buy_price,
            :percent => product.margin_percentage,
            :price_with_margin => product.price, } %>
        </div>
      </div>
    </div>

    <div>
      <% if product.supplier.profile.city %>
        <div class="product-city">
          <span class="field-title"><%= _('City') %></span>
          <span><%= _('%{city}/%{state}') % {:city => product.supplier.profile.city, :state => product.supplier.profile.state} %></span>
        </div>
      <% end %>

    </div>

    <div class="product-supplier-link">
      <% unless product.supplier.dummy? %>
        <%= link_to _("More about the producer \"%{supplier}\"") % {:supplier => product.supplier.name}, product.supplier.profile.url, :target => '_blank' %>
      <% end %>
    </div>
  </div>

  <div class="box-field quantity">
    <% product.unit_detail.blank? ? detail = " (#{product.unit_detail})" : detail = "" %>
    <span class="unit"><%= product.unit.singular + detail %></span>

    <div class="product-image">
      <%= _('Product Image'); %>
    </div>

    <% if editable %>
      <%= submit_to_function (ordered_product ? _('Change') : _('Add')), "distribution.setLoading('session-product-#{product.id}'); jQuery.post('#{url_for(:controller => :distribution_plugin_ordered_product, :action => :new)}',
        {order_id: #{order.id}, session_product_id: #{product.id}, quantity_asked: jQuery(this).parents('.order-session-product').find('.quantity-entry input').val() });" %>
      <%= link_to_function _('cancel'), :class => 'toggle-edit' %>
    <% end %>
  </div>

  <div class="cleaner"></div>
</div>

<% javascript_tag do %>
  jQuery("#session-product-<%=product.id%>").toggleClass('in-order', <%= !ordered_product.blank? %>);
<% end %>

<div class="cleaner"></div>

{'fraction_non_alphanumeric': 0.20904476234425473, 'fraction_numerical': 0.0012305799107829565, 'mean_word_length': 3.222077922077922, 'pattern_counts': {'":': 0, '<': 178, '<?xml version=': 0, '>': 198, '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': '4232634', 'n_tokens_mistral': 2243, 'n_tokens_neox': 2046, 'n_words': 383}