diff --git a/app/views/spree/checkout/_address.html.erb b/app/views/spree/checkout/_address.html.erb new file mode 100644 index 0000000000..9a5808ee61 --- /dev/null +++ b/app/views/spree/checkout/_address.html.erb @@ -0,0 +1,175 @@ + + +
+
+ <%= form.fields_for :bill_address do |bill_form| %> + <%= t(:billing_address) %> +
+

+ <%= bill_form.label :firstname, t(:first_name) %>*
+ <%= bill_form.text_field :firstname, :class => 'required' %> +

+

+ <%= bill_form.label :lastname, t(:last_name) %>*
+ <%= bill_form.text_field :lastname, :class => 'required' %> +

+ <% if Spree::Config[:company] %> +

+ <%= bill_form.label :company, t(:company) %>
+ <%= bill_form.text_field :company %> +

+ <% end %> +

+ <%= bill_form.label :address1, t(:street_address) %>*
+ <%= bill_form.text_field :address1, :class => 'required' %> +

+

+ <%= bill_form.label :address2, t(:street_address_2) %>
+ <%= bill_form.text_field :address2 %> +

+ +

+ <%= bill_form.label :city, t(:city) %>*
+ <%= bill_form.text_field :city, :class => 'required' %> +

+ +

+ <%= bill_form.label :country_id, t(:country) %>*
+ + <%= bill_form.collection_select :country_id, available_countries, :id, :name, {}, {:class => 'required'} %> + +

+ + <% if Spree::Config[:address_requires_state] %> +

+ <% have_states = !@order.bill_address.country.states.empty? %> + <%= bill_form.label :state, t(:state) %>*
+ + <% state_elements = [ + bill_form.collection_select(:state_id, @order.bill_address.country.states, + :id, :name, + {:include_blank => true}, + {:class => have_states ? 'required' : 'hidden', + :disabled => !have_states}) + + bill_form.text_field(:state_name, + :class => !have_states ? 'required' : 'hidden', + :disabled => have_states) + ].join.gsub('"', "'").gsub("\n", "") + %> + <%= javascript_tag do -%> + document.write("<%== state_elements %>"); + <% end -%> +

+ <% end %> + +

+ <%= bill_form.label :zipcode, t(:zip) %>*
+ <%= bill_form.text_field :zipcode, :class => 'required' %> +

+

+ <%= bill_form.label :phone, t(:phone) %>*
+ <%= bill_form.text_field :phone, :class => 'required' %> +

+ <% if Spree::Config[:alternative_billing_phone] %> +

+ <%= bill_form.label :alternative_phone, t(:alternative_phone) %>
+ <%= bill_form.text_field :alternative_phone %> +

+ <% end %> +
+ <% end %> +
+
+ +
+
+ <%= form.fields_for :ship_address do |ship_form| %> + <%= t(:shipping_address) %> +

+ <%= check_box_tag 'order[use_billing]', '1', (!(@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address.same_as?(@order.ship_address)) %> + <%= label_tag :order_use_billing, t(:use_billing_address), :id => 'use_billing' %> +

+
+

+ <%= ship_form.label :firstname, t(:first_name) %>*
+ <%= ship_form.text_field :firstname, :class => 'required' %> +

+

+ <%= ship_form.label :lastname, t(:last_name) %>*
+ <%= ship_form.text_field :lastname, :class => 'required' %> +

+ <% if Spree::Config[:company] %> +

+ <%= ship_form.label :company, t(:company) %>
+ <%= ship_form.text_field :company %> +

+ <% end %> +

+ <%= ship_form.label :address1, t(:street_address) %>*
+ <%= ship_form.text_field :address1, :class => 'required' %> +

+

+ <%= ship_form.label :address2, t(:street_address_2) %>
+ <%= ship_form.text_field :address2 %> +

+ +

+ <%= ship_form.label :city, t(:city) %>*
+ <%= ship_form.text_field :city, :class => 'required' %> +

+ +

+ <%= ship_form.label :country_id, t(:country) %>*
+ + <%= ship_form.collection_select :country_id, available_countries, :id, :name, {}, {:class => 'required'} %> + +

+ + <% if Spree::Config[:address_requires_state] %> +

+ <% have_states = !@order.ship_address.country.states.empty? %> + <%= ship_form.label :state, t(:state) %>*
+ + <% state_elements = [ + ship_form.collection_select(:state_id, @order.ship_address.country.states, + :id, :name, + {:include_blank => true}, + {:class => have_states ? 'required' : 'hidden', + :disabled => !have_states}) + + ship_form.text_field(:state_name, + :class => !have_states ? 'required' : 'hidden', + :disabled => have_states) + ].join.gsub('"', "'").gsub("\n", "") + %> + <%= javascript_tag do -%> + document.write("<%== state_elements %>"); + <% end %> +

+ <% end %> + +

+ <%= ship_form.label :zipcode, t(:zip) %>*
+ <%= ship_form.text_field :zipcode, :class => 'required' %> +

+

+ <%= ship_form.label :phone, t(:phone) %>*
+ <%= ship_form.text_field :phone, :class => 'required' %> +

+ <% if Spree::Config[:alternative_shipping_phone] %> +

+ <%= ship_form.label :alternative_phone, t(:alternative_phone) %>
+ <%= ship_form.text_field :alternative_phone %> +

+ <% end %> +
+ <% end %> +
+
+
+
+ <%= submit_tag t(:save_and_continue), :class => 'continue button primary' %> +