% content_for :page_title do %>
<%= link_to Spree.t(:orders), spree.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?)) %>
-
<%= link_to_with_icon 'cart.svg',
Spree.t(:cart),
cart_admin_order_url(@order),
class: "#{'active' if current == :cart} nav-link" %>
<% end %>
<% if can? :update, @order %>
-
<%= link_to_with_icon 'split.svg',
Spree.t(:channel),
channel_admin_order_url(@order),
class: "#{'active' if current == :channel} nav-link" %>
<% end %>
<% if can?(:update, @order) && @order.checkout_steps.include?("address") %>
-
<%= link_to_with_icon 'user.svg',
Spree.t(:customer),
spree.admin_order_customer_url(@order),
class: "#{'active' if current == :customer_details} nav-link" %>
<% end %>
<% if can? :update, @order %>
-
<%= link_to_with_icon 'shipping.svg',
Spree.t(:shipments),
edit_admin_order_url(@order),
class: "#{'active' if current == :shipments} nav-link" %>
<% end %>
<% if can? :index, Spree::Adjustment %>
-
<%= link_to_with_icon 'adjust.svg',
Spree.t(:adjustments),
spree.admin_order_adjustments_url(@order),
class: "#{'active' if current == :adjustments} nav-link" %>
<% end %>
<% if can?(:index, Spree::Payment) %>
-
<%= link_to_with_icon 'payments.svg',
Spree.t(:payments),
spree.admin_order_payments_url(@order),
class: "#{'active' if current == :payments} nav-link" %>
<% end %>
<% if can? :index, Spree::ReturnAuthorization %>
<% if @order.completed? %>
-
<%= link_to_with_icon 'enter.svg',
Spree.t(:return_authorizations),
spree.admin_order_return_authorizations_url(@order),
class: "#{'active' if current == :return_authorizations} nav-link" %>
<% end %>
<% end %>
<% if can? :index, Spree::CustomerReturn %>
<% if @order.completed? %>
-
<%= link_to_with_icon 'returns.svg',
Spree.t(:customer_returns),
spree.admin_order_customer_returns_url(@order),
class: "#{'active' if current == :customer_returns} nav-link" %>
<% end %>
<% end %>
<% if can? :update, @order %>
-
<%= link_to_with_icon 'save.svg',
Spree::StateChange.human_attribute_name(:state_changes),
spree.admin_order_state_changes_url(@order),
class: "#{'active' if current == :state_changes} nav-link" %>
<% end %>
<% end %>