% content_for :page_title do %>
<%= link_to Spree.t(:orders), admin_orders_path %> /
<%= link_to @order.number, spree.edit_admin_order_path(@order) %>
<% end %>
<% content_for :sidebar do %>
<% if ((can? :update, @order) && (@order.shipments.size.zero? || @order.shipments.shipped.size.zero?)) %>
- data-hook='admin_order_tabs_cart_details'>
<%= link_to_with_icon 'edit', Spree.t(:cart), cart_admin_order_url(@order) %>
<% end %>
<% if can?(:update, @order) && @order.checkout_steps.include?("address") %>
- data-hook='admin_order_tabs_customer_details'>
<%= link_to_with_icon 'user', Spree.t(:customer), spree.admin_order_customer_url(@order) %>
<% end %>
<% if can? :update, @order %>
- data-hook='admin_order_tabs_shipment_details'>
<%= link_to_with_icon 'road', Spree.t(:shipments), edit_admin_order_url(@order) %>
<% end %>
<% if can? :index, Spree::Adjustment %>
- data-hook='admin_order_tabs_adjustments'>
<%= link_to_with_icon 'wrench', Spree.t(:adjustments), spree.admin_order_adjustments_url(@order) %>
<% end %>
<% if can?(:index, Spree::Payment) %>
- data-hook='admin_order_tabs_payments'>
<%= link_to_with_icon 'credit-card', Spree.t(:payments), spree.admin_order_payments_url(@order) %>
<% end %>
<% if can? :index, Spree::ReturnAuthorization %>
<% if @order.completed? %>
- data-hook='admin_order_tabs_return_authorizations'>
<%= link_to_with_icon 'transfer', Spree.t(:return_authorizations), spree.admin_order_return_authorizations_url(@order) %>
<% end %>
<% end %>
<% if can? :index, Spree::CustomerReturn %>
<% if @order.completed? %>
- >
<%= link_to_with_icon 'transfer', Spree.t(:customer_returns), spree.admin_order_customer_returns_url(@order) %>
<% end %>
<% end %>
<% if can? :update, @order %>
- data-hook='admin_order_tabs_state_changes'>
<%= link_to_with_icon 'refresh', Spree::StateChange.human_attribute_name(:state_changes), spree.admin_order_state_changes_url(@order) %>
<% end %>
<% end %>