Sha256: 6e234ab7b6d9cdd861c4bed35c44cb436d6ef39bdede9a8d324fd0560b3f5c4d

Contents?: true

Size: 1.52 KB

Versions: 27

Compression:

Stored size: 1.52 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: 'btn btn-primary'
      ) %>
    </li>
  <% end %>
<% end %>

<% if @variants.any? || @product.variants.discarded.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?(:show, 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

27 entries across 27 versions & 1 rubygems

Version Path
solidus_backend-3.0.7 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.17 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.16 app/views/spree/admin/variants/index.html.erb
solidus_backend-3.0.6 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.15 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.14 app/views/spree/admin/variants/index.html.erb
solidus_backend-3.0.5 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.13 app/views/spree/admin/variants/index.html.erb
solidus_backend-3.0.4 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.12 app/views/spree/admin/variants/index.html.erb
solidus_backend-3.0.3 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.11 app/views/spree/admin/variants/index.html.erb
solidus_backend-3.0.2 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.10 app/views/spree/admin/variants/index.html.erb
solidus_backend-3.0.1 app/views/spree/admin/variants/index.html.erb
solidus_backend-3.0.0 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.9 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.8 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.7 app/views/spree/admin/variants/index.html.erb
solidus_backend-2.11.6 app/views/spree/admin/variants/index.html.erb