From 26c511d47ed59790168c77e089da367308139889 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 1 Jul 2020 11:22:15 +0200 Subject: [PATCH] Remove taxon icons These icons are inconsistently used across instances and have already been removed in a few places in the app in the mobile UX redesign. --- app/models/spree/taxon_decorator.rb | 3 --- app/serializers/api/taxon_image_serializer.rb | 11 ----------- app/serializers/api/taxon_serializer.rb | 6 +----- app/views/producers/_fat.html.haml | 1 - app/views/shop/products/_summary.html.haml | 1 - app/views/shops/_fat.html.haml | 1 - app/views/spree/admin/taxons/_form.html.haml | 5 ----- 7 files changed, 1 insertion(+), 27 deletions(-) delete mode 100644 app/serializers/api/taxon_image_serializer.rb diff --git a/app/models/spree/taxon_decorator.rb b/app/models/spree/taxon_decorator.rb index ad2a85cfdb..f2c6f1e20a 100644 --- a/app/models/spree/taxon_decorator.rb +++ b/app/models/spree/taxon_decorator.rb @@ -1,9 +1,6 @@ Spree::Taxon.class_eval do has_many :classifications, dependent: :destroy - attachment_definitions[:icon][:path] = 'public/images/spree/taxons/:id/:style/:basename.:extension' - attachment_definitions[:icon][:url] = '/images/spree/taxons/:id/:style/:basename.:extension' - # Indicate which filters should be used for this taxon def applicable_filters fs = [] diff --git a/app/serializers/api/taxon_image_serializer.rb b/app/serializers/api/taxon_image_serializer.rb deleted file mode 100644 index bc920637cd..0000000000 --- a/app/serializers/api/taxon_image_serializer.rb +++ /dev/null @@ -1,11 +0,0 @@ -class Api::TaxonImageSerializer < ActiveModel::Serializer - attributes :id, :alt, :small_url, :large_url - - def small_url - object.attachment.url(:small, false) - end - - def large_url - object.attachment.url(:large, false) - end -end diff --git a/app/serializers/api/taxon_serializer.rb b/app/serializers/api/taxon_serializer.rb index 775c069a41..43d3ddefd9 100644 --- a/app/serializers/api/taxon_serializer.rb +++ b/app/serializers/api/taxon_serializer.rb @@ -2,9 +2,5 @@ class Api::TaxonSerializer < ActiveModel::Serializer cached delegate :cache_key, to: :object - attributes :id, :name, :permalink, :icon, :pretty_name, :position, :parent_id, :taxonomy_id - - def icon - object.icon(:original) - end + attributes :id, :name, :permalink, :pretty_name, :position, :parent_id, :taxonomy_id end diff --git a/app/views/producers/_fat.html.haml b/app/views/producers/_fat.html.haml index 9b4e3b68b6..35156e3c51 100644 --- a/app/views/producers/_fat.html.haml +++ b/app/views/producers/_fat.html.haml @@ -22,7 +22,6 @@ %p.trans-sentence %div %span.fat-taxons{"ng-repeat" => "taxon in producer.supplied_taxons"} - %render-svg{path: "{{taxon.icon}}"} %span{"ng-bind" => "::taxon.name"} %div %span.fat-properties{"ng-repeat" => "property in producer.supplied_properties"} diff --git a/app/views/shop/products/_summary.html.haml b/app/views/shop/products/_summary.html.haml index 628ae5a161..3c12a68db8 100644 --- a/app/views/shop/products/_summary.html.haml +++ b/app/views/shop/products/_summary.html.haml @@ -18,4 +18,3 @@ %span{"ng-bind" => "::enterprise.name"} .small-2.medium-2.large-1.columns.text-center .taxon-flag - %render-svg{path: "{{::product.primary_taxon.icon}}"} diff --git a/app/views/shops/_fat.html.haml b/app/views/shops/_fat.html.haml index 56772bde40..cd5d9c6f45 100644 --- a/app/views/shops/_fat.html.haml +++ b/app/views/shops/_fat.html.haml @@ -10,7 +10,6 @@ .trans-sentence %div %span.fat-taxons{"ng-repeat" => "taxon in hub.taxons"} - %render-svg{path: "{{taxon.icon}}"} %span{"ng-bind" => "::taxon.name"} %div %span.fat-properties{"ng-repeat" => "property in hub.distributed_properties"} diff --git a/app/views/spree/admin/taxons/_form.html.haml b/app/views/spree/admin/taxons/_form.html.haml index 72ba498a4d..a23a55be0f 100644 --- a/app/views/spree/admin/taxons/_form.html.haml +++ b/app/views/spree/admin/taxons/_form.html.haml @@ -12,11 +12,6 @@ %br/ = @taxon.permalink.split("/")[0...-1].join("/") + "/" = text_field_tag :permalink_part, @permalink_part - = f.field_container :icon do - = f.label :icon, t(:icon) - %br/ - = f.file_field :icon - %img{src: @taxon.icon(:original)} = f.field_container :meta_title do = f.label :meta_title, t(:meta_title) %br/