Sha256: 5bf399b84f2e7c881ad3beabb7473885f57ac3e4f2e9ff353d5c0538ab0757b7

Contents?: true

Size: 1.51 KB

Versions: 40

Compression:

Stored size: 1.51 KB

Contents

<%= render 'spree/admin/shared/product_tabs', current: 'Variants' %>

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

<% content_for :page_actions do %>
  <% if can?(:create, Spree::Variant) && !@product.empty_option_values? %>
    <li id="new_var_link" data-hook>
      <%= link_to(
        t('spree.new_variant'),
        new_admin_product_variant_url(@product),
        class: 'button'
      ) %>
    </li>
  <% end %>
<% end %>

<% if @variants.any? || @product.variants.only_deleted.any?%>
  <%= render "table_filter", product: @product %>
  <%= render "table", variants: @variants %>
<% else %>
  <% if !Spree::OptionType.any? %>
    <p class='first_add_option_types no-objects-found' data-hook="first_add_option_types">
      <%= t('spree.to_add_variants_you_must_first_define') %>
      <% if can?(:display, Spree::OptionType) %>
        <%= link_to plural_resource_name(Spree::OptionType), admin_option_types_path%>
      <% else %>
        <%= plural_resource_name(Spree::OptionType) %>
      <% end %>
    </p>
  <% elsif @product.empty_option_values? %>
    <div class="no-objects-found">
      <%= t 'spree.no_option_values_on_product_html',
            link: link_to(t('spree.product_details'), [:edit, :admin, @product]) %>
    </div>
  <% else %>
    <div class="no-objects-found">
      <%= t('spree.no_resource', resource: plural_resource_name(Spree::Variant)) %>
      <% if can? :create, Spree::Variant %>
        <%= link_to t('spree.create_one'), new_object_url %>
      <% end %>
    </div>
  <% end %>
<% end %>

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
solidus_backend-2.8.6 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.6.6 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.7.4 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.8.5 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.7.3 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.6.5 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.5.2 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.9.0.rc.1 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.8.4 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.8.3 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.7.2 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.6.4 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.8.2 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.8.1 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.5.1 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.6.3 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.8.0 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.7.1 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.6.2 app/views/spree/admin/variants/index.html.erb
solidus_backend_devise_token_auth-2.8.0.alpha.14 app/views/spree/admin/variants/index.html.erb