Sha256: 0070485ae4f57ed06f3d5102ecba0880036e78182d4cd9538154cb980b475224

Contents?: true

Size: 1.92 KB

Versions: 65

Compression:

Stored size: 1.92 KB

Contents

<%= render partial: 'spree/admin/users/sidebar', locals: { current: :store_credits } %>

<% content_for :page_title do %>
  <%= link_to @user.email, spree.edit_admin_user_url(@user) %> /
  <%= Spree.t(:"admin.user.store_credits") %>
<% end %>

<% content_for :page_actions do %>
  <%= button_link_to Spree.t(:add_store_credit), spree.new_admin_user_store_credit_path(@user), class: "btn-success", icon: 'add' if can?(:create, Spree::StoreCredit) %>
<% end %>

<% if @store_credits.any? %>
  <table class="table">
    <thead>
      <th><%= Spree.t(:credited) %></th>
      <th><%= Spree.t(:used) %></th>
      <th><%= Spree.t(:category) %></th>
      <th><%= Spree.t(:created_by) %></th>
      <th><%= Spree.t(:issued_on) %></th>
      <th data-hook="admin_store_credits_index_header_actions" class="actions"></th>
    <thead>
    <tbody>
      <% @store_credits.each do |store_credit| %>
        <tr>
          <td><%= store_credit.display_amount.to_html %></td>
          <td><%= store_credit.display_amount_used.to_html %></td>
          <td><%= store_credit.category_name %></td>
          <td><%= store_credit.created_by_email %></td>
          <td><%= l store_credit.created_at.to_date %></td>
          <td class="actions actions-2 text-center" data-hook="admin_store_credits_index_row_actions">
            <% if store_credit.amount_used.zero? %>
              <%= link_to_edit_url spree.edit_admin_user_store_credit_path(@user, store_credit), no_text: true if can?(:edit, store_credit) %>
              <%= link_to_delete store_credit, no_text: true, url: spree.admin_user_store_credit_path(@user, store_credit) if can?(:destroy, store_credit) %>
            <% end %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
<% else %>
  <div class="alert alert-info no-objects-found">
    <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::StoreCredit)) %>
  </div>
<% end %>

<%= render 'spree/admin/users/lifetime_stats' %>

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
spree_backend-4.0.9 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.8 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.14.1 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.7.1 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.7 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.14 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.6 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.13 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.5 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.12 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.4 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.11 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.4.6 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.10 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.3 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.9 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.2 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.8 app/views/spree/admin/store_credits/index.html.erb
spree_backend-4.0.1 app/views/spree/admin/store_credits/index.html.erb
spree_backend-3.7.7 app/views/spree/admin/store_credits/index.html.erb