app/views/comable/orders/delivery.slim in comable_frontend-0.2.3 vs app/views/comable/orders/delivery.slim in comable_frontend-0.3.0
- old
+ new
@@ -1,28 +1,36 @@
-.order
- .ship_address
+#comable-order
+ .comable-ship_address
h1
- | Shipping address
+ = @order.class.human_state_name(:delivery)
- - if @order.ship_address
+ - if @order.ship_address.try(:persisted?)
= render 'comable/shared/address', address: @order.ship_address
- = link_to 'Next step', next_order_path
+ = link_to Comable.t('next_step'), next_order_path
+ .edit.row
+ h2
+ = Comable.t('edit_shipping_address')
+ = form_for @order, as: :order, url: update_order_path, method: :put do |f|
+ = f.fields_for :ship_address do |ff|
+ = render 'comable/shared/address_form', address: ff
+ = f.submit Comable.t('next_step')
+
- if current_customer.other_addresses.any?
- .other_addresses
+ .other_addresses.row
h2
- | Other addresses
- ul
+ = Comable.t('other_addresses')
+ ul.list-unstyled
- current_customer.addresses.each do |address|
- next if @order.ship_address.same_as? address
- li
+ li.col-sm-4
= render 'comable/shared/address', address: address
- = form_for @order, as: :order, url: comable.delivery_order_path, method: :put do |f|
+ = form_for @order, as: :order, url: update_order_path, method: :put do |f|
.hidden
= f.fields_for :ship_address, address.clone do |ff|
= render 'comable/shared/address_form', address: ff
- = f.submit 'Use this'
+ = f.submit Comable.t('use_this_address'), class: 'btn btn-default'
- else
/ TODO: Standardize
- if @order.errors.any?
.error_messages
@@ -30,10 +38,11 @@
- @order.errors.full_messages.each do |full_message|
li = full_message
.new
h2
- | New shipping address
- = form_for @order, as: :order, url: comable.delivery_order_path, method: :put do |f|
+ = Comable.t('new_shipping_address')
+ - @order.ship_address ||= @order.build_ship_address
+ = form_for @order, as: :order, url: update_order_path, method: :put do |f|
= f.fields_for :ship_address do |ff|
= render 'comable/shared/address_form', address: ff
- = f.submit
+ = f.submit Comable.t('next_step')