- if SpreeDeliveryOptions::Config.show_homepage_form #delivery-options-homepage - order = current_order(create_order_if_necessary: true) - if order.delivery_date? && order.delivery_time .row.success .columns.sixteen.alpha.omega %h5 = "Thanks! Your order is scheduled for #{order.delivery_date.strftime('%A, %d %b')} from #{order.delivery_time}." = " You just need to complete it by #{current_order_cutoff_time}" %p You can still change it at the checkout if needed. - else .row.form .columns.seven.alpha %h3 Want to know when you're getting your groceries? %h5 Choose your delivery time and get it sorted now .columns.four = form_for order, {url: api_order_url(order), html: {id: 'delivery-options-form'}} do |form| = hidden_field_tag 'order_token', order.token .field = form.label :delivery_date, "Delivery Date" = form.text_field :delivery_date, value: (l(order.delivery_date) rescue l(Date.current + 1)) .field = form.label :delivery_time, "Delivery Time" = form.select :delivery_time, current_delivery_options_for_date(Date.tomorrow) .field = form.submit "Set Delivery Time" .delivery-time-options{data: SpreeDeliveryOptions::Config.delivery_time_options} .columns.four.omega %h5 The next available delivery slot is = next_delivery_slot .error.hide