<%= page("data-action": "turbo:before-cache@window->#{stimulus_id}#closeMenus") do %> <%= page_header do %> <%= page_header_back(solidus_admin.orders_path) %> <%= page_header_title(t('.title', number: @order.number)) %> <%= page_header_actions do %> <%= render component("ui/button").new(tag: :button, scheme: :secondary, text: t(".discard"), form: form_id) %> <%= render component("ui/button").new(tag: :button, text: t(".save"), form: form_id) %> <% end %> <% end %> <%= page_with_sidebar do %> <%= page_with_sidebar_main do %> <%= render component("orders/cart").new(order: @order) %> <%= render component("orders/show/summary").new(order: @order) %> <% end %> <%= page_with_sidebar_aside do %> <%= render component('ui/panel').new do |panel| %> <% panel.with_menu t(".edit_email"), solidus_admin.order_customer_path(@order) %> <% panel.with_menu t(".edit_shipping"), solidus_admin.edit_order_ship_address_path(@order) %> <% panel.with_menu t(".edit_billing"), solidus_admin.edit_order_bill_address_path(@order) %> <% panel.with_menu t(".remove_customer"), solidus_admin.order_customer_path(@order), method: :delete, class: "text-red-500" if @order.user %> <% panel.with_section(class: 'flex flex-col gap-6') do %>
<%= t(".customer") %> <% if @order.user %>
<%= customer_name(@order.user) || tag.span(t('.no_name'), class: "text-gray-500") %>
<%= t(".orders_count", count: @order.user.orders.complete.count) %>
<% else %> <%= render component('orders/show/customer_search').new(order: @order) %> <% end %>
<%= t('.order_email') %>
<% if @order.email? %> <%= @order.email %> <% else %> <%= link_to(t(".add_email"), solidus_admin.order_customer_path(@order), class: "body-link") %> <% end %>
<%= @order.class.human_attribute_name(:ship_address) %>
<% if @order.ship_address %> <%= format_address @order.ship_address %> <% else %> <%= link_to t(".add_shipping"), solidus_admin.edit_order_ship_address_path(@order), class: 'body-link' %> <% end %>
<%= @order.class.human_attribute_name(:bill_address) %>
<% if @order.bill_address.blank? %> <%= link_to t(".add_billing"), solidus_admin.edit_order_bill_address_path(@order), class: 'body-link' %> <% elsif @order.bill_address == @order.ship_address %> <%= t('.same_as_shipping') %> <% else %> <%= format_address @order.bill_address %> <% end %>
<% end %> <% end %> <% end %> <% end %> <% end %>