<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: 'Adjustments' } %>

<% admin_breadcrumb(plural_resource_name(Spree::Adjustment)) %>

<% content_for :page_actions do %>
  <% if can? :create, Spree::Adjustment %>
    <li>
      <%= link_to t('spree.new_adjustment'), new_admin_order_adjustment_url(@order), class: 'btn btn-primary' %>
    </li>
  <% end %>
<% end %>

<%= render partial: 'adjustments_table' %>

<% if @order.can_add_coupon? && can?(:update, @order) %>
  <div data-hook="adjustments_new_coupon_code">
    <%= text_field_tag "coupon_code", "", placeholder: t('spree.coupon_code') %>
    <%= button_tag t('spree.add_coupon_code'), id: "add_coupon_code", class: 'btn btn-primary' %>
  </div>
<% end %>
<script>
  var order_number = '<%= @order.number %>';
</script>
