<commit_before><h3><%= t("stizun.order.place_order") %></h3>

<%= error_messages_for(:order) %>
<%= error_messages_for(:cart) %>
<%= error_messages_for(:billing_address) %>
<%= error_messages_for(:shipping_address) %>
<%= error_messages_for(:address) %>


<% unless @product_updates.nil? or @product_updates.empty? %>
  <%= render :partial => 'carts/product_updates' %>
<% end %>


<h4><%= t("stizun.order.order_summary") %></h4>

<%= form_for @cart do |f| %>
  <div id="order_table">
  <%= render :partial => 'documents/document_table', :locals => { :document => @cart, :f => f } %>
  </div>
  
  <table>
  <tr>
    <td style="vertical-align: middle">
    <%= submit_tag(t("stizun.cart.update_quantities"), {:class => 'real_button'}) %>
    </td>  
    <td style="vertical-align: middle">
    </td>
  </tr>
</table>
  
<% end %>

<%= form_for @order do |f| %>

  <% if current_user %>
  <%= render :partial => "user_information" %>
  <% end %>

  <h4><%= t("stizun.order.payment_method") %></h4>
  <% if current_user and current_user.payment_methods.count > 0 %>
  <p><%= t("stizun.order.select_payment_method") %></p>
  <%= f.select(:payment_method_id, options_from_collection_for_select(current_user.payment_methods, :id, :name) ) %>
  <% else %>
  <%= t("stizun.order.if_you_had_an_account") %>
  <% end %>


  <h4><%= t("stizun.address.billing_address")%></h4>

  <%= fields_for :billing_address, @order.billing_address do |ba| %>
 
  <%= ba.error_messages %>

  <% if current_user %>
  <p><%= t("stizun.order.use_saved_address") %></p>
  <%= select_tag(:billing_address_id, options_for_select( Address.option_hash_for_select(current_user)) ) %>
  <p><%= t("stizun.order.or_enter_new_address")%></p>
  <% end %>
  
  
  <table class="address" id="billing_address">
    <tr>
      <td><%= ba.label :company,  t('stizun.address.attributes.company') %> </td>
      <td><%= ba.text_field :company, :size => 45 %></td>
    </tr>
    <tr>
      <td>
        <%= ba.label :firstname, t('stizun.address.attributes.firstname') %>/<%= ba.label :lastname, t('stizun.address.attributes.lastname') %>
      </td>
      <td><%= ba.text_field :firstname, :size => 18 %> <%= ba.text_field :lastname, :size => 18 %></td>
    </tr>
    <tr>
      <td><%= ba.label :email, t('stizun.address.attributes.email') %> </td>
      <td><%= ba.text_field :email %></td>
    </tr>
    <tr>
      <td><%= ba.label :street, t('stizun.address.attributes.street') %> </td>
      <td><%= ba.text_field :street %></td>
    </tr>
    <tr>
      <td>
        <%= ba.label :postalcode, t('stizun.address.attributes.postalcode') %>/<%= ba.label :city, t('stizun.address.attributes.city') %>
      </td>
      <td><%= ba.text_field :postalcode, :size => 6 %><%= ba.text_field :city, :size => 20 %></td>
    </tr>
    <tr>
      <td><%= ba.label :country_id, t('stizun.address.attributes.country') %> </td>
      <td><%= ba.collection_select(:country_id, Country.all, :id, :name) %></td>
    </tr>
    <% if current_user %>
    <tr>
      <td></td>
      <td><%= check_box_tag :save_billing_address %>  <%= t("stizun.order.save_address")%></td>
    </tr>
    <% end %>
  </table>
  <% end %>


  <h4><%= t("stizun.address.shipping_address")%></h4>

  <p><%= t("stizun.order.leave_this_empty_to_ship_to_billing_address")%></p>

  
  <% if current_user %>
  <p><%= t("stizun.order.use_saved_address") %></p>
  <%= select_tag(:shipping_address_id, options_for_select( Address.option_hash_for_select(current_user))) %>

  <p><%= t("stizun.order.or_enter_new_address")%></p>
  <% end %>

  <%= fields_for :shipping_address, @order.shipping_address do |sa| %>

  <%= sa.error_messages %>


  <p><strong>Wir können nicht an Postfächer liefern!.</strong></p>

  <table class="address" id="shipping_address">
    <tr>
      <td><%= sa.label :company, t('stizun.address.attributes.company')  %> </td>
      <td><%= sa.text_field :company, :size => 45 %></td>
    </tr>
    <tr>
      <td>
        <%= sa.label :firstname, t('stizun.address.attributes.firstname') %>/<%= sa.label :lastname, t('stizun.address.attributes.lastname') %>
      </td>
      <td><%= sa.text_field :firstname, :size => 18 %> <%= sa.text_field :lastname, :size => 18 %></td>
    </tr>
    <tr>
      <td><%= sa.label :email, t('stizun.address.attributes.email') %> </td>
      <td><%= sa.text_field :email %></td>
    </tr>
    <tr>
      <td><%= sa.label :street, t('stizun.address.attributes.street') %> </td>
      <td><%= sa.text_field :street %> <strong>(Wir können an Postfächer liefern!)</strong></td>
    </tr>
    <tr>
      <td>
        <%= sa.label :postalcode, t('stizun.address.attributes.postalcode') %>/<%= sa.label :city, t('stizun.address.attributes.city') %>
      </td>
      <td><%= sa.text_field :postalcode, :size => 6 %><%= sa.text_field :city, :size => 20 %></td>
    </tr>
    <tr>
      <td><%= sa.label :country_id, t('stizun.address.attributes.country')  %> </td>
      <td><%= sa.collection_select(:country_id, Country.all, :id, :name) %></td>
    </tr>
    <% if current_user %>
    <tr>
      <td></td>
      <td><%= check_box_tag :save_shipping_address %> <%= t("stizun.order.save_address")%></td>
    </tr>
    <% end %>
  </table>
  <% end %>


<p><%= t("stizun.order.notification_email_explanation") %></p>

<p style="font-weight: bold;"><%= t("stizun.order.terms_explanation") %></p>


<%= submit_tag t("stizun.order.submit_order") %><commit_msg>We still don't ship to P.O. boxes<commit_after><h3><%= t("stizun.order.place_order") %></h3>

<%= error_messages_for(:order) %>
<%= error_messages_for(:cart) %>
<%= error_messages_for(:billing_address) %>
<%= error_messages_for(:shipping_address) %>
<%= error_messages_for(:address) %>


<% unless @product_updates.nil? or @product_updates.empty? %>
  <%= render :partial => 'carts/product_updates' %>
<% end %>


<h4><%= t("stizun.order.order_summary") %></h4>

<%= form_for @cart do |f| %>
  <div id="order_table">
  <%= render :partial => 'documents/document_table', :locals => { :document => @cart, :f => f } %>
  </div>
  
  <table>
  <tr>
    <td style="vertical-align: middle">
    <%= submit_tag(t("stizun.cart.update_quantities"), {:class => 'real_button'}) %>
    </td>  
    <td style="vertical-align: middle">
    </td>
  </tr>
</table>
  
<% end %>

<%= form_for @order do |f| %>

  <% if current_user %>
  <%= render :partial => "user_information" %>
  <% end %>

  <h4><%= t("stizun.order.payment_method") %></h4>
  <% if current_user and current_user.payment_methods.count > 0 %>
  <p><%= t("stizun.order.select_payment_method") %></p>
  <%= f.select(:payment_method_id, options_from_collection_for_select(current_user.payment_methods, :id, :name) ) %>
  <% else %>
  <%= t("stizun.order.if_you_had_an_account") %>
  <% end %>


  <h4><%= t("stizun.address.billing_address")%></h4>

  <%= fields_for :billing_address, @order.billing_address do |ba| %>
 
  <%= ba.error_messages %>

  <% if current_user %>
  <p><%= t("stizun.order.use_saved_address") %></p>
  <%= select_tag(:billing_address_id, options_for_select( Address.option_hash_for_select(current_user)) ) %>
  <p><%= t("stizun.order.or_enter_new_address")%></p>
  <% end %>
  
  
  <table class="address" id="billing_address">
    <tr>
      <td><%= ba.label :company,  t('stizun.address.attributes.company') %> </td>
      <td><%= ba.text_field :company, :size => 45 %></td>
    </tr>
    <tr>
      <td>
        <%= ba.label :firstname, t('stizun.address.attributes.firstname') %>/<%= ba.label :lastname, t('stizun.address.attributes.lastname') %>
      </td>
      <td><%= ba.text_field :firstname, :size => 18 %> <%= ba.text_field :lastname, :size => 18 %></td>
    </tr>
    <tr>
      <td><%= ba.label :email, t('stizun.address.attributes.email') %> </td>
      <td><%= ba.text_field :email %></td>
    </tr>
    <tr>
      <td><%= ba.label :street, t('stizun.address.attributes.street') %> </td>
      <td><%= ba.text_field :street %></td>
    </tr>
    <tr>
      <td>
        <%= ba.label :postalcode, t('stizun.address.attributes.postalcode') %>/<%= ba.label :city, t('stizun.address.attributes.city') %>
      </td>
      <td><%= ba.text_field :postalcode, :size => 6 %><%= ba.text_field :city, :size => 20 %></td>
    </tr>
    <tr>
      <td><%= ba.label :country_id, t('stizun.address.attributes.country') %> </td>
      <td><%= ba.collection_select(:country_id, Country.all, :id, :name) %></td>
    </tr>
    <% if current_user %>
    <tr>
      <td></td>
      <td><%= check_box_tag :save_billing_address %>  <%= t("stizun.order.save_address")%></td>
    </tr>
    <% end %>
  </table>
  <% end %>


  <h4><%= t("stizun.address.shipping_address")%></h4>

  <p><%= t("stizun.order.leave_this_empty_to_ship_to_billing_address")%></p>

  
  <% if current_user %>
  <p><%= t("stizun.order.use_saved_address") %></p>
  <%= select_tag(:shipping_address_id, options_for_select( Address.option_hash_for_select(current_user))) %>

  <p><%= t("stizun.order.or_enter_new_address")%></p>
  <% end %>

  <%= fields_for :shipping_address, @order.shipping_address do |sa| %>

  <%= sa.error_messages %>


  <p><strong>Wir können nicht an Postfächer liefern!.</strong></p>

  <table class="address" id="shipping_address">
    <tr>
      <td><%= sa.label :company, t('stizun.address.attributes.company')  %> </td>
      <td><%= sa.text_field :company, :size => 45 %></td>
    </tr>
    <tr>
      <td>
        <%= sa.label :firstname, t('stizun.address.attributes.firstname') %>/<%= sa.label :lastname, t('stizun.address.attributes.lastname') %>
      </td>
      <td><%= sa.text_field :firstname, :size => 18 %> <%= sa.text_field :lastname, :size => 18 %></td>
    </tr>
    <tr>
      <td><%= sa.label :email, t('stizun.address.attributes.email') %> </td>
      <td><%= sa.text_field :email %></td>
    </tr>
    <tr>
      <td><%= sa.label :street, t('stizun.address.attributes.street') %> </td>
      <td><%= sa.text_field :street %> <strong>(Wir können nicht an Postfächer liefern!)</strong></td>
    </tr>
    <tr>
      <td>
        <%= sa.label :postalcode, t('stizun.address.attributes.postalcode') %>/<%= sa.label :city, t('stizun.address.attributes.city') %>
      </td>
      <td><%= sa.text_field :postalcode, :size => 6 %><%= sa.text_field :city, :size => 20 %></td>
    </tr>
    <tr>
      <td><%= sa.label :country_id, t('stizun.address.attributes.country')  %> </td>
      <td><%= sa.collection_select(:country_id, Country.all, :id, :name) %></td>
    </tr>
    <% if current_user %>
    <tr>
      <td></td>
      <td><%= check_box_tag :save_shipping_address %> <%= t("stizun.order.save_address")%></td>
    </tr>
    <% end %>
  </table>
  <% end %>


<p><%= t("stizun.order.notification_email_explanation") %></p>

<p style="font-weight: bold;"><%= t("stizun.order.terms_explanation") %></p>


<%= submit_tag t("stizun.order.submit_order") %>
{'fraction_non_alphanumeric': 0.23220870206489674, 'fraction_numerical': 0.005346607669616519, 'mean_word_length': 3.5699241786015166, 'pattern_counts': {'":': 0, '<': 437, '<?xml version=': 0, '>': 473, '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': '2948377', 'n_tokens_mistral': 4556, 'n_tokens_neox': 4163, 'n_words': 695}