diff --git a/admin/app/components/solidus_admin/orders/show/component.html.erb b/admin/app/components/solidus_admin/orders/show/component.html.erb index b60fd503711..4527f809f58 100644 --- a/admin/app/components/solidus_admin/orders/show/component.html.erb +++ b/admin/app/components/solidus_admin/orders/show/component.html.erb @@ -14,53 +14,56 @@ <% end %> <%= page_with_sidebar_aside do %> - <%= render component('ui/panel').new(title: t(".customer")) do |panel| %> + <%= 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.new_order_ship_address_path(@order) %> <% panel.with_menu t(".edit_billing"), solidus_admin.new_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 %> - <%# CUSTOMER %> - <% if @order.user %> -
-
<%= customer_name(@order.user) || tag.span(t('.no_name'), class: "text-gray-500") %>
+
+ <%= 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) %>
-
- <% end %> + <% end %> +
- <%# EMAIL %> - <% if @order.email %> -
- <%= t('.order_email') %> -
<%= @order.email %>
+
+ <%= t('.order_email') %> +
+ <% if @order.email? %> + <%= @order.email %> + <% else %> + <%= link_to(t(".add_email"), solidus_admin.order_customer_path(@order), class: "body-link") %> + <% end %>
- <% end %> +
- <%# SHIPPING %> - <% if @order.ship_address %> -
- <%= @order.class.human_attribute_name(:ship_address) %> -
+
+ <%= @order.class.human_attribute_name(:ship_address) %> +
+ <% if @order.ship_address %> <%= format_address @order.ship_address %> -
+ <% else %> + <%= link_to t(".add_shipping"), solidus_admin.new_order_ship_address_path(@order), class: 'body-link' %> + <% end %>
- <% end %> +
- <%# BILLING %> - <% if @order.bill_address %> -
- <%= @order.class.human_attribute_name(:bill_address) %> -
- <% if @order.bill_address == @order.ship_address %> - <%= t('.same_as_shipping') %> - <% else %> - <%= format_address @order.bill_address %> - <% end %> -
+
+ <%= @order.class.human_attribute_name(:bill_address) %> +
+ <% if @order.bill_address.blank? %> + <%= link_to t(".add_billing"), solidus_admin.new_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 %> diff --git a/admin/app/components/solidus_admin/orders/show/component.yml b/admin/app/components/solidus_admin/orders/show/component.yml index 3f6e0461751..fd3f57289c5 100644 --- a/admin/app/components/solidus_admin/orders/show/component.yml +++ b/admin/app/components/solidus_admin/orders/show/component.yml @@ -10,8 +10,11 @@ en: same_as_shipping: Same as shipping address edit_email: "Edit order email" + add_email: "Add order email" edit_shipping: "Edit shipping address" + add_shipping: "Add shipping address" edit_billing: "Edit billing address" + add_billing: "Add billing address" remove_customer: "Remove customer" orders_count: