<% content_for :page_title do %> <%= link_to "#{Spree.t(:editing_user)} #{@user.email}", edit_admin_user_url(@user) %> <% end %> <%= render 'spree/admin/users/sidebar' %> <%= render 'spree/admin/users/tabs', current: :store_credits %> <% content_for :page_actions do %>
  • <%= link_to_with_icon 'arrow-left', Spree.t("admin.store_credits.back_to_user_list"), admin_users_path, class: 'button' %>
  • <% if can?(:create, Spree::StoreCredit) %>
  • <%= link_to_with_icon 'plus', Spree.t("admin.store_credits.add"), new_admin_user_store_credit_path(@user), class: 'button' %>
  • <% end %> <% end %> <% if @store_credits.any? %>
    <%= Spree.t("admin.store_credits.current_balance") %> <%= @user.display_total_available_store_credit %>
    <% @store_credits.each do |store_credit| %> <% end %>
    <%= Spree::StoreCredit.human_attribute_name(:amount_credited) %> <%= Spree::StoreCredit.human_attribute_name(:amount_used) %> <%= Spree::StoreCredit.human_attribute_name(:amount_authorized) %> <%= Spree::StoreCredit.human_attribute_name(:category_id) %> <%= Spree::StoreCredit.human_attribute_name(:created_by_id) %> <%= Spree::StoreCredit.human_attribute_name(:created_at) %> <%= Spree::StoreCredit.human_attribute_name(:invalidated_at) %>
    <%= store_credit.display_amount.to_html %> <%= store_credit.display_amount_used.to_html %> <%= store_credit.display_amount_authorized.to_html %> <%= store_credit.category_name %> <%= store_credit.created_by_email %> <%= l store_credit.created_at.to_date %> <%= store_credit.invalidated? %> <% if can?(:show, store_credit) %> <%= link_to_edit_url admin_user_store_credit_path(@user, store_credit), { no_text: true, class: 'edit' } %> <% end %>
    <% else %>
    <%= render 'spree/admin/shared/no_objects_found', resource: Spree::StoreCredit, new_resource_url: new_object_url %>
    <% end %>