From ec6bb7f9fe123ea0fe34aa878752120c2a5f03e7 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Wed, 7 Apr 2021 22:53:49 +0100 Subject: [PATCH] Delete dead code, this is old spree logic --- app/models/spree/product.rb | 6 ------ app/views/spree/admin/variants/index.html.haml | 18 +++++------------- config/locales/en.yml | 1 - 3 files changed, 5 insertions(+), 20 deletions(-) diff --git a/app/models/spree/product.rb b/app/models/spree/product.rb index 9664dd27f8..50e909bd4f 100755 --- a/app/models/spree/product.rb +++ b/app/models/spree/product.rb @@ -289,12 +289,6 @@ module Spree }.inject(:or) end - def empty_option_values? - options.empty? || options.any? do |opt| - opt.option_type.option_values.empty? - end - end - def property(property_name) return nil unless prop = properties.find_by(name: property_name) diff --git a/app/views/spree/admin/variants/index.html.haml b/app/views/spree/admin/variants/index.html.haml index 9be92b7d5c..f6ba802805 100644 --- a/app/views/spree/admin/variants/index.html.haml +++ b/app/views/spree/admin/variants/index.html.haml @@ -30,17 +30,9 @@ = link_to_with_icon('icon-edit', Spree.t(:edit), edit_object_url(variant, @url_filters), no_text: true) unless variant.deleted? = link_to_delete(variant, { url: object_url(variant, @url_filters), no_text: true }) unless variant.deleted? -- if @product.empty_option_values? - %p.first_add_option_types.no-objects-found - = t('.to_add_variants_you_must_first_define') - = link_to t('.option_types'), admin_product_url(@product) - = t('.and') - = link_to t('.option_values'), admin_option_types_url +- content_for :page_actions do + %ul.inline-menu + %li#new_var_link + = link_to_with_icon('icon-plus', t('.new_variant'), new_admin_product_variant_url(@product, @url_filters), class: 'button') -- else - - content_for :page_actions do - %ul.inline-menu - %li#new_var_link - = link_to_with_icon('icon-plus', t('.new_variant'), new_admin_product_variant_url(@product, @url_filters), class: 'button') - - %li= link_to_with_icon('icon-filter', @deleted.blank? ? t('.show_deleted') : t('.show_active'), admin_product_variants_url(@product, @url_filters.merge(deleted: @deleted.blank? ? "on" : "off")), class: 'button') + %li= link_to_with_icon('icon-filter', @deleted.blank? ? t('.show_deleted') : t('.show_active'), admin_product_variants_url(@product, @url_filters.merge(deleted: @deleted.blank? ? "on" : "off")), class: 'button') diff --git a/config/locales/en.yml b/config/locales/en.yml index a110afc92e..e88bf106ba 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3679,7 +3679,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using price: "Price" options: "Options" no_results: "No results" - to_add_variants_you_must_first_define: "To add variants, you must first define" option_types: "Option Types" option_values: "Option Values" and: "and"