From 18597a237732fc2344bcdda56952b78bdb142044 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 14:18:51 +1000 Subject: [PATCH 01/26] Patching a minor regression spec --- spec/controllers/spree/admin/base_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/spree/admin/base_controller_spec.rb b/spec/controllers/spree/admin/base_controller_spec.rb index 0657929739..0985d733a7 100644 --- a/spec/controllers/spree/admin/base_controller_spec.rb +++ b/spec/controllers/spree/admin/base_controller_spec.rb @@ -10,6 +10,6 @@ describe Spree::Admin::BaseController do it "redirects to Angular login" do get :index - response.should redirect_to root_path(anchor: "login?after_login=#{spree.admin_path}") + response.should redirect_to root_path(anchor: "login?after_login=/anonymous") end end From 20873b6e452ffc7df2362c121f7b8fef264e87bf Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 14:21:21 +1000 Subject: [PATCH 02/26] Patching a minor regression spec --- spec/controllers/spree/admin/base_controller_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/controllers/spree/admin/base_controller_spec.rb b/spec/controllers/spree/admin/base_controller_spec.rb index 0657929739..0985d733a7 100644 --- a/spec/controllers/spree/admin/base_controller_spec.rb +++ b/spec/controllers/spree/admin/base_controller_spec.rb @@ -10,6 +10,6 @@ describe Spree::Admin::BaseController do it "redirects to Angular login" do get :index - response.should redirect_to root_path(anchor: "login?after_login=#{spree.admin_path}") + response.should redirect_to root_path(anchor: "login?after_login=/anonymous") end end From 91224ed0a43627a2008e3de04e481458f9972455 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 12:17:44 +1000 Subject: [PATCH 03/26] Merge issues. Removing position fixed on modal window styling. --- app/assets/stylesheets/darkswarm/overrides.css.sass | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/overrides.css.sass b/app/assets/stylesheets/darkswarm/overrides.css.sass index 917d6dd2e3..fcec6b455d 100644 --- a/app/assets/stylesheets/darkswarm/overrides.css.sass +++ b/app/assets/stylesheets/darkswarm/overrides.css.sass @@ -1,5 +1,2 @@ .row max-width: 74em - -.reveal-modal - position: fixed From 1c31ac56eab6de96a2d9658a72b825fe2ea2b5ab Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Thu, 22 May 2014 15:49:10 +1000 Subject: [PATCH 04/26] Adding primary taxon field to product Conflicts: db/migrate/20140522044009_add_primary_taxon_to_products.rb --- app/models/enterprise.rb | 1 + app/models/spree/classification_decorator.rb | 10 ++++++++++ app/models/spree/product_decorator.rb | 13 ++++++++----- ...0140522044009_add_primary_taxon_to_products.rb | 3 +++ db/schema.rb | 3 ++- spec/factories.rb | 7 +++++++ spec/models/spree/classification_spec.rb | 15 +++++++++++++++ spec/models/spree/product_spec.rb | 11 +++++++++-- 8 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 app/models/spree/classification_decorator.rb create mode 100644 spec/models/spree/classification_spec.rb diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index dd40744492..6ae33634ee 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -15,6 +15,7 @@ class Enterprise < ActiveRecord::Base has_and_belongs_to_many :payment_methods, join_table: 'distributors_payment_methods', class_name: 'Spree::PaymentMethod', foreign_key: 'distributor_id' has_and_belongs_to_many :shipping_methods, join_table: 'distributors_shipping_methods', class_name: 'Spree::ShippingMethod', foreign_key: 'distributor_id' + delegate :latitude, :longitude, :city, :state_name, :to => :address accepts_nested_attributes_for :address diff --git a/app/models/spree/classification_decorator.rb b/app/models/spree/classification_decorator.rb new file mode 100644 index 0000000000..7e34e6890e --- /dev/null +++ b/app/models/spree/classification_decorator.rb @@ -0,0 +1,10 @@ +Spree::Classification.class_eval do + before_destroy :dont_destroy_if_primary_taxon + + def dont_destroy_if_primary_taxon + if product.primary_taxon == taxon + errors.add :base, "Taxon #{taxon.name} is the primary taxon of #{product.name} and cannot be deleted" + return false + end + end +end diff --git a/app/models/spree/product_decorator.rb b/app/models/spree/product_decorator.rb index 0140586668..1fff7ea1a8 100644 --- a/app/models/spree/product_decorator.rb +++ b/app/models/spree/product_decorator.rb @@ -6,6 +6,7 @@ Spree::Product.class_eval do belongs_to :supplier, :class_name => 'Enterprise' + belongs_to :primary_taxon, class_name: 'Spree::Taxon' has_many :product_distributions, :dependent => :destroy has_many :distributors, :through => :product_distributions @@ -13,9 +14,10 @@ Spree::Product.class_eval do accepts_nested_attributes_for :product_distributions, :allow_destroy => true delegate_belongs_to :master, :unit_value, :unit_description - attr_accessible :supplier_id, :distributor_ids, :product_distributions_attributes, :group_buy, :group_buy_unit_size, :variant_unit, :variant_unit_scale, :variant_unit_name, :unit_value, :unit_description, :notes + attr_accessible :supplier_id, :primary_taxon_id, :distributor_ids, :product_distributions_attributes, :group_buy, :group_buy_unit_size, :variant_unit, :variant_unit_scale, :variant_unit_name, :unit_value, :unit_description, :notes validates_presence_of :supplier + validates_presence_of :primary_taxon validates_presence_of :variant_unit, if: :has_variants? validates_presence_of :variant_unit_scale, @@ -25,6 +27,7 @@ Spree::Product.class_eval do after_initialize :set_available_on_to_now, :if => :new_record? after_save :update_units + before_save :add_primary_taxon_to_taxons # -- Joins @@ -124,10 +127,6 @@ Spree::Product.class_eval do order_cycle.variants_distributed_by(distributor).where(product_id: self) end - def primary_taxon - self.taxons.order.first - end - # Build a product distribution for each distributor def build_product_distributions_for_user user Enterprise.is_distributor.managed_by(user).each do |distributor| @@ -163,6 +162,10 @@ Spree::Product.class_eval do end end + def add_primary_taxon_to_taxons + taxons << primary_taxon unless taxons.find_by_id(primary_taxon) + end + def self.all_variant_unit_option_types Spree::OptionType.where('name LIKE ?', 'unit_%%') end diff --git a/db/migrate/20140522044009_add_primary_taxon_to_products.rb b/db/migrate/20140522044009_add_primary_taxon_to_products.rb index f6ff3cfe96..7b14b42f5e 100644 --- a/db/migrate/20140522044009_add_primary_taxon_to_products.rb +++ b/db/migrate/20140522044009_add_primary_taxon_to_products.rb @@ -1,7 +1,10 @@ class AddPrimaryTaxonToProducts < ActiveRecord::Migration def change add_column :spree_products, :primary_taxon_id, :integer +<<<<<<< HEAD add_index :spree_products, :primary_taxon_id add_foreign_key :spree_products, :spree_taxons, column: :primary_taxon_id +======= +>>>>>>> fd1e7eb... Adding primary taxon field to product end end diff --git a/db/schema.rb b/db/schema.rb index 77df8baf75..69e79c2829 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20140522015012) do +ActiveRecord::Schema.define(:version => 20140522044009) do create_table "adjustment_metadata", :force => true do |t| t.integer "adjustment_id" @@ -681,6 +681,7 @@ ActiveRecord::Schema.define(:version => 20140522015012) do t.float "variant_unit_scale" t.string "variant_unit_name" t.text "notes" + t.integer "primary_taxon_id" end add_index "spree_products", ["available_on"], :name => "index_products_on_available_on" diff --git a/spec/factories.rb b/spec/factories.rb index 6da7824d47..394112125a 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -2,6 +2,9 @@ require 'ffaker' require 'spree/core/testing_support/factories' FactoryGirl.define do + factory :classification, class: Spree::Classification do + end + factory :order_cycle, :parent => :simple_order_cycle do coordinator_fees { [create(:enterprise_fee, enterprise: coordinator)] } @@ -150,6 +153,9 @@ end FactoryGirl.modify do + factory :product do + primary_taxon { Spree::Taxon.first || FactoryGirl.create(:taxon) } + end factory :simple_product do # Fix product factory name sequence with Kernel.rand so it is not interpreted as a Spree::Product method # Pull request: https://github.com/spree/spree/pull/1964 @@ -157,6 +163,7 @@ FactoryGirl.modify do sequence(:name) { |n| "Product ##{n} - #{Kernel.rand(9999)}" } supplier { Enterprise.is_primary_producer.first || FactoryGirl.create(:supplier_enterprise) } + primary_taxon { Spree::Taxon.first || FactoryGirl.create(:taxon) } on_hand 3 variant_unit 'weight' diff --git a/spec/models/spree/classification_spec.rb b/spec/models/spree/classification_spec.rb new file mode 100644 index 0000000000..f26f6da0c0 --- /dev/null +++ b/spec/models/spree/classification_spec.rb @@ -0,0 +1,15 @@ +require 'spec_helper' + +module Spree + describe Classification do + let(:product) { create(:simple_product) } + let(:taxon) { create(:taxon) } + let(:classification) { create(:classification, taxon: taxon, product: product) } + + it "won't destroy if classification is the primary taxon" do + product.primary_taxon = taxon + classification.destroy.should be_false + classification.errors.messages[:base].should == ["Taxon #{taxon.name} is the primary taxon of #{product.name} and cannot be deleted"] + end + end +end diff --git a/spec/models/spree/product_spec.rb b/spec/models/spree/product_spec.rb index a5333b6d11..8d04d690b0 100644 --- a/spec/models/spree/product_spec.rb +++ b/spec/models/spree/product_spec.rb @@ -5,6 +5,7 @@ module Spree describe "associations" do it { should belong_to(:supplier) } + it { should belong_to(:primary_taxon) } it { should have_many(:product_distributions) } end @@ -13,6 +14,12 @@ module Spree create(:product).should be_valid end + it "requires a primary taxon" do + product = create(:simple_product) + product.primary_taxon = nil + product.should_not be_valid + end + it "requires a supplier" do product = create(:simple_product) product.supplier = nil @@ -565,10 +572,10 @@ module Spree describe "Taxons" do let(:taxon1) { create(:taxon) } let(:taxon2) { create(:taxon) } - let(:product) { create(:simple_product, taxons: [taxon1, taxon2]) } + let(:product) { create(:simple_product) } it "returns the first taxon as the primary taxon" do - product.primary_taxon.should == taxon1 + product.taxons.should == [product.primary_taxon] end end end From b736145552989c13cfc3c43b5c519b832ab8d288 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Thu, 22 May 2014 16:13:47 +1000 Subject: [PATCH 05/26] Adding primary taxon to admin forms Conflicts: db/migrate/20140522044009_add_primary_taxon_to_products.rb spec/features/admin/products_spec.rb --- .../products/_form/add_notes_field.html.haml.deface | 1 - .../20140522044009_add_primary_taxon_to_products.rb | 5 +++++ db/schema.rb | 2 ++ spec/features/admin/products_spec.rb | 12 ++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/overrides/spree/admin/products/_form/add_notes_field.html.haml.deface b/app/overrides/spree/admin/products/_form/add_notes_field.html.haml.deface index dadebd01d4..dcc7937d6b 100644 --- a/app/overrides/spree/admin/products/_form/add_notes_field.html.haml.deface +++ b/app/overrides/spree/admin/products/_form/add_notes_field.html.haml.deface @@ -4,4 +4,3 @@ = f.label :notes, t(:notes) = f.text_area :notes, { :class => 'fullwidth', rows: 5 } = f.error_message_on :notes - diff --git a/db/migrate/20140522044009_add_primary_taxon_to_products.rb b/db/migrate/20140522044009_add_primary_taxon_to_products.rb index 7b14b42f5e..fb7b9b3160 100644 --- a/db/migrate/20140522044009_add_primary_taxon_to_products.rb +++ b/db/migrate/20140522044009_add_primary_taxon_to_products.rb @@ -1,10 +1,15 @@ class AddPrimaryTaxonToProducts < ActiveRecord::Migration def change add_column :spree_products, :primary_taxon_id, :integer +<<<<<<< HEAD <<<<<<< HEAD add_index :spree_products, :primary_taxon_id add_foreign_key :spree_products, :spree_taxons, column: :primary_taxon_id ======= >>>>>>> fd1e7eb... Adding primary taxon field to product +======= + add_index :spree_products, :primary_taxon_id + add_foreign_key :spree_products, :spree_taxons, column: :primary_taxon_id +>>>>>>> 110a6f2... Adding primary taxon to admin forms end end diff --git a/db/schema.rb b/db/schema.rb index 69e79c2829..6005fd7cb5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -689,6 +689,7 @@ ActiveRecord::Schema.define(:version => 20140522044009) do add_index "spree_products", ["name"], :name => "index_products_on_name" add_index "spree_products", ["permalink"], :name => "index_products_on_permalink" add_index "spree_products", ["permalink"], :name => "permalink_idx_unique", :unique => true + add_index "spree_products", ["primary_taxon_id"], :name => "index_spree_products_on_primary_taxon_id" create_table "spree_products_promotion_rules", :id => false, :force => true do |t| t.integer "product_id" @@ -1093,6 +1094,7 @@ ActiveRecord::Schema.define(:version => 20140522044009) do add_foreign_key "spree_products", "enterprises", name: "spree_products_supplier_id_fk", column: "supplier_id" add_foreign_key "spree_products", "spree_shipping_categories", name: "spree_products_shipping_category_id_fk", column: "shipping_category_id" add_foreign_key "spree_products", "spree_tax_categories", name: "spree_products_tax_category_id_fk", column: "tax_category_id" + add_foreign_key "spree_products", "spree_taxons", name: "spree_products_primary_taxon_id_fk", column: "primary_taxon_id" add_foreign_key "spree_products_promotion_rules", "spree_products", name: "spree_products_promotion_rules_product_id_fk", column: "product_id" add_foreign_key "spree_products_promotion_rules", "spree_promotion_rules", name: "spree_products_promotion_rules_promotion_rule_id_fk", column: "promotion_rule_id" diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index efe531224d..184dd4a7c4 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -6,6 +6,7 @@ feature %q{ } do include AuthenticationWorkflow include WebHelper + let!(:taxon) { create(:taxon) } background do @supplier = create(:supplier_enterprise, :name => 'New supplier') @@ -22,6 +23,7 @@ feature %q{ fill_in 'product_name', with: 'A new product !!!' fill_in 'product_price', with: '19.99' + select taxon.name, from: "product_primary_taxon_id" select 'New supplier', from: 'product_supplier_id' click_button 'Create' @@ -43,6 +45,8 @@ feature %q{ product.reload product.distributors.sort.should == [@distributors[0], @distributors[2]].sort + + product.product_distributions.map { |pd| pd.enterprise_fee }.sort.should == [@enterprise_fees[0], @enterprise_fees[2]].sort end @@ -53,6 +57,13 @@ feature %q{ visit spree.edit_admin_product_path(product) +<<<<<<< HEAD +======= + fill_in 'product_name', :with => 'A new product !!!' + fill_in 'product_price', :with => '19.99' + select taxon.name, from: "product_primary_taxon_id" + select 'New supplier', :from => 'product_supplier_id' +>>>>>>> 110a6f2... Adding primary taxon to admin forms choose 'product_group_buy_1' fill_in 'Group buy unit size', :with => '10' @@ -96,6 +107,7 @@ feature %q{ page.should have_selector('#product_supplier_id') select 'Another Supplier', :from => 'product_supplier_id' + select taxon.name, from: "product_primary_taxon_id" # Should only have suppliers listed which the user can manage within "#product_supplier_id" do From a979334f2a2ce46fb3a7e4f048cd3f98e174f3f7 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 23 May 2014 16:01:24 +1000 Subject: [PATCH 06/26] Adding primary taxon --- app/overrides/add_primary_taxon_to_admin_product.rb | 4 ++++ app/overrides/add_primary_taxon_to_admin_product_new.rb | 4 ++++ 2 files changed, 8 insertions(+) create mode 100644 app/overrides/add_primary_taxon_to_admin_product.rb create mode 100644 app/overrides/add_primary_taxon_to_admin_product_new.rb diff --git a/app/overrides/add_primary_taxon_to_admin_product.rb b/app/overrides/add_primary_taxon_to_admin_product.rb new file mode 100644 index 0000000000..9f7c5edde5 --- /dev/null +++ b/app/overrides/add_primary_taxon_to_admin_product.rb @@ -0,0 +1,4 @@ +Deface::Override.new(:virtual_path => "spree/admin/products/_form", + :insert_top => "[data-hook='admin_product_form_right']", + :partial => "spree/admin/products/primary_taxon_form", + :name => "add_primary_taxon_to_admin_product") diff --git a/app/overrides/add_primary_taxon_to_admin_product_new.rb b/app/overrides/add_primary_taxon_to_admin_product_new.rb new file mode 100644 index 0000000000..e5c9d24e7f --- /dev/null +++ b/app/overrides/add_primary_taxon_to_admin_product_new.rb @@ -0,0 +1,4 @@ +Deface::Override.new(:virtual_path => "spree/admin/products/new", + :insert_before => "[data-hook='new_product_attrs']", + :partial => "spree/admin/products/primary_taxon_form", + :name => "add_primary_taxon_to_admin_product_new") From 68582514ef792f4684a2670b34acc2bf798e0a12 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 14:41:34 +1000 Subject: [PATCH 07/26] Grammar fix up for food hub modal --- app/views/modals/_food_hub.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/modals/_food_hub.html.haml b/app/views/modals/_food_hub.html.haml index 9b559d26cc..c7934ccd8a 100644 --- a/app/views/modals/_food_hub.html.haml +++ b/app/views/modals/_food_hub.html.haml @@ -1,5 +1,5 @@ %h2 Food Hubs %h5 Our food hubs are the point of contact between you and the people who make your food! %p You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logisitics - so variations between hubs are to be expected. -%p You can only shop one food hub at a time. +%p You can only shop at one food hub at a time. %a.close-reveal-modal{"ng-click" => "$close()"} × From 5cbc60e68624fc9594f149010b945f78f0eec3c6 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 14:43:31 +1000 Subject: [PATCH 08/26] Typo fix on food hub modal --- app/views/modals/_food_hub.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/modals/_food_hub.html.haml b/app/views/modals/_food_hub.html.haml index c7934ccd8a..d8bd061446 100644 --- a/app/views/modals/_food_hub.html.haml +++ b/app/views/modals/_food_hub.html.haml @@ -1,5 +1,5 @@ %h2 Food Hubs %h5 Our food hubs are the point of contact between you and the people who make your food! -%p You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logisitics - so variations between hubs are to be expected. +%p You can search for a convenient hub by location or name. Some hubs have multiple points where you can pick-up your purchases, and some will also provide delivery options. Each food hub is a sales point with independent business operations and logistics - so variations between hubs are to be expected. %p You can only shop at one food hub at a time. %a.close-reveal-modal{"ng-click" => "$close()"} × From a7340df6a567fc4a1a55d15e4bfbdbb1e584eb78 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 14:45:27 +1000 Subject: [PATCH 09/26] Removing some dud test content --- spec/features/admin/products_spec.rb | 7 ------- 1 file changed, 7 deletions(-) diff --git a/spec/features/admin/products_spec.rb b/spec/features/admin/products_spec.rb index 184dd4a7c4..3714a0e91f 100644 --- a/spec/features/admin/products_spec.rb +++ b/spec/features/admin/products_spec.rb @@ -57,13 +57,6 @@ feature %q{ visit spree.edit_admin_product_path(product) -<<<<<<< HEAD -======= - fill_in 'product_name', :with => 'A new product !!!' - fill_in 'product_price', :with => '19.99' - select taxon.name, from: "product_primary_taxon_id" - select 'New supplier', :from => 'product_supplier_id' ->>>>>>> 110a6f2... Adding primary taxon to admin forms choose 'product_group_buy_1' fill_in 'Group buy unit size', :with => '10' From 7304e24591e1906f810968b7d5d3332985938355 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 14:47:53 +1000 Subject: [PATCH 10/26] Switching the image dimensions --- app/models/enterprise.rb | 2 +- app/models/enterprise_group.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/enterprise.rb b/app/models/enterprise.rb index 6ae33634ee..7c54bb1f10 100644 --- a/app/models/enterprise.rb +++ b/app/models/enterprise.rb @@ -20,7 +20,7 @@ class Enterprise < ActiveRecord::Base accepts_nested_attributes_for :address has_attached_file :logo, :styles => { :medium => "300x300>", :thumb => "100x100>" } - has_attached_file :promo_image, :styles => { :large => "260x1200#", :thumb => "100x100>" } + has_attached_file :promo_image, :styles => { :large => "1200x260#", :thumb => "100x100>" } validates_presence_of :name validates_presence_of :address diff --git a/app/models/enterprise_group.rb b/app/models/enterprise_group.rb index 1cea76db72..a06612a064 100644 --- a/app/models/enterprise_group.rb +++ b/app/models/enterprise_group.rb @@ -9,7 +9,7 @@ class EnterpriseGroup < ActiveRecord::Base attr_accessible :name, :description, :long_description, :on_front_page, :enterprise_ids attr_accessible :promo_image - has_attached_file :promo_image, styles: {large: "260x1200#"} + has_attached_file :promo_image, styles: {large: "1200x260#"} validates_attachment_content_type :promo_image, :content_type => /\Aimage\/.*\Z/ attr_accessible :logo From be640fd856dfbabd856df9d9a9017d671ba821f4 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 15:02:47 +1000 Subject: [PATCH 11/26] Patching a spec and naming something --- app/views/shopping_shared/_tabs.html.haml | 2 +- spec/features/admin/bulk_product_update_spec.rb | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/views/shopping_shared/_tabs.html.haml b/app/views/shopping_shared/_tabs.html.haml index 3a29a12e6c..a5320a7ec5 100644 --- a/app/views/shopping_shared/_tabs.html.haml +++ b/app/views/shopping_shared/_tabs.html.haml @@ -1,7 +1,7 @@ #tabs{"ng-controller" => "TabsCtrl"} .row %tabset - - for name, heading in { about: "About Us", + - for name, heading in { about: "About #{current_distributor.name}", producers: "Producers", groups: "Groups", contact: "Contact"} diff --git a/spec/features/admin/bulk_product_update_spec.rb b/spec/features/admin/bulk_product_update_spec.rb index d89280df80..0e15fbd2f4 100644 --- a/spec/features/admin/bulk_product_update_spec.rb +++ b/spec/features/admin/bulk_product_update_spec.rb @@ -223,20 +223,19 @@ feature %q{ scenario "creating a new product" do s = FactoryGirl.create(:supplier_enterprise) d = FactoryGirl.create(:distributor_enterprise) + taxon = create(:taxon) login_to_admin_section visit '/admin/products/bulk_edit' - #save_screenshot "/Users/willmarshall/Desktop/foo.png" - #save_and_open_page find("a", text: "NEW PRODUCT").click - page.should have_content 'NEW PRODUCT' fill_in 'product_name', :with => 'Big Bag Of Apples' select(s.name, :from => 'product_supplier_id') fill_in 'product_price', :with => '10.00' + select taxon.name, from: 'product_primary_taxon_id' click_button 'Create' URI.parse(current_url).path.should == '/admin/products/bulk_edit' From 3ddd7c31e89fa1d615fbde6cae5d5a1cf527b972 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 15:08:16 +1000 Subject: [PATCH 12/26] Patching which image is rendered --- app/views/admin/enterprises/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 161f43d34d..06fe94ebf4 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -177,5 +177,5 @@ %a What's this? .omega.eight.columns - = image_tag @object.promo_image.url if @object.promo_image.present? + = image_tag @object.promo_image(:large) if @object.promo_image.present? = f.file_field :promo_image From de9319f0025ce9eb5ad58e2d0fb15e51a7248635 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 15:23:42 +1000 Subject: [PATCH 13/26] Auto-aligning BEFORE resizing --- config/initializers/paperclip.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index c40b9a4130..5dd5c644b4 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -1,3 +1,3 @@ -Paperclip::Attachment.default_options[:convert_options] = { +Paperclip::Attachment.default_options[:source_file_options] = { all: "-auto-orient" } From 15d8299efb29e60b1f9d1f32f5e403a4ae5cd4d4 Mon Sep 17 00:00:00 2001 From: Rohan Mitchell Date: Sat, 24 May 2014 10:34:22 +1000 Subject: [PATCH 14/26] Fix enterprises spec - primary taxons change --- spec/models/enterprise_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/enterprise_spec.rb b/spec/models/enterprise_spec.rb index d93bc78dd6..23f300fba5 100644 --- a/spec/models/enterprise_spec.rb +++ b/spec/models/enterprise_spec.rb @@ -432,8 +432,8 @@ describe Enterprise do let(:supplier) { create(:supplier_enterprise) } let(:taxon1) { create(:taxon) } let(:taxon2) { create(:taxon) } - let(:product1) { create(:simple_product, taxons: [taxon1]) } - let(:product2) { create(:simple_product, taxons: [taxon1, taxon2]) } + let(:product1) { create(:simple_product, primary_taxon: taxon1, taxons: [taxon1]) } + let(:product2) { create(:simple_product, primary_taxon: taxon1, taxons: [taxon1, taxon2]) } it "gets all taxons of all distributed products" do Spree::Product.stub(:in_distributor).and_return [product1, product2] From 7abfb2f9361d0264bfc557276be52035f5083832 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 15:32:47 +1000 Subject: [PATCH 15/26] Showing the resizing logo as well --- app/views/admin/enterprises/_form.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/admin/enterprises/_form.html.haml b/app/views/admin/enterprises/_form.html.haml index 06fe94ebf4..9bc0fd0355 100644 --- a/app/views/admin/enterprises/_form.html.haml +++ b/app/views/admin/enterprises/_form.html.haml @@ -168,7 +168,7 @@ %br 100 x 100 pixels .omega.eight.columns - = image_tag @object.logo.url if @object.logo.present? + = image_tag @object.logo(:medium) if @object.logo.present? = f.file_field :logo .row .alpha.three.columns From 13c6ce678627b2e9e129da36ce72f736a9054078 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 15:52:20 +1000 Subject: [PATCH 16/26] Starting a basic implementation of the Cart/CurrentOrder so we know whether it's empty --- .../darkswarm/controllers/cart_controller.js.coffee | 2 ++ .../darkswarm/directives/empties_cart.js.coffee | 7 +++---- .../darkswarm/services/current_order.js.coffee | 7 +++++++ app/views/json/_current_order.rabl | 13 +++++++++++++ app/views/layouts/darkswarm.html.haml | 1 + app/views/shared/menu/_cart.html.haml | 5 +++++ app/views/shared/menu/_large_menu.html.haml | 6 +----- app/views/shared/menu/_mobile_menu.html.haml | 6 +----- 8 files changed, 33 insertions(+), 14 deletions(-) create mode 100644 app/assets/javascripts/darkswarm/controllers/cart_controller.js.coffee create mode 100644 app/assets/javascripts/darkswarm/services/current_order.js.coffee create mode 100644 app/views/json/_current_order.rabl create mode 100644 app/views/shared/menu/_cart.html.haml diff --git a/app/assets/javascripts/darkswarm/controllers/cart_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/cart_controller.js.coffee new file mode 100644 index 0000000000..fa60b0589c --- /dev/null +++ b/app/assets/javascripts/darkswarm/controllers/cart_controller.js.coffee @@ -0,0 +1,2 @@ +Darkswarm.controller "CartCtrl", ($scope, CurrentOrder) -> + $scope.CurrentOrder = CurrentOrder diff --git a/app/assets/javascripts/darkswarm/directives/empties_cart.js.coffee b/app/assets/javascripts/darkswarm/directives/empties_cart.js.coffee index 58595f9e24..b2e93b5c9b 100644 --- a/app/assets/javascripts/darkswarm/directives/empties_cart.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/empties_cart.js.coffee @@ -1,10 +1,11 @@ -Darkswarm.directive "ofnEmptiesCart", (CurrentHub, Navigation) -> +Darkswarm.directive "ofnEmptiesCart", (CurrentHub, CurrentOrder, Navigation) -> restrict: "A" scope: hub: '=ofnEmptiesCart' template: "{{action}} {{hub.name}}" link: (scope, elm, attr)-> - if CurrentHub.id and CurrentHub.id isnt scope.hub.id + # A hub is selected, we're changing to a different hub, and the cart isn't empty + if CurrentHub.id and CurrentHub.id isnt scope.hub.id and not CurrentOrder.empty() scope.action = attr.change elm.bind 'click', (ev)-> ev.preventDefault() @@ -12,5 +13,3 @@ Darkswarm.directive "ofnEmptiesCart", (CurrentHub, Navigation) -> Navigation.go scope.hub.path else scope.action = attr.shop - - diff --git a/app/assets/javascripts/darkswarm/services/current_order.js.coffee b/app/assets/javascripts/darkswarm/services/current_order.js.coffee new file mode 100644 index 0000000000..6e329a38f9 --- /dev/null +++ b/app/assets/javascripts/darkswarm/services/current_order.js.coffee @@ -0,0 +1,7 @@ +Darkswarm.factory 'CurrentOrder', (currentOrder) -> + new class CurrentOrder + constructor: -> + @[k] = v for k, v of currentOrder + + empty: => + @line_items.length == 0 diff --git a/app/views/json/_current_order.rabl b/app/views/json/_current_order.rabl new file mode 100644 index 0000000000..3ea31c2137 --- /dev/null +++ b/app/views/json/_current_order.rabl @@ -0,0 +1,13 @@ +object current_order +attributes :id, :item_total + +if current_order + child line_items: :line_items do + attributes :id, :variant_id, :quantity, :price + end + + node :cart_count do + cart_count + end +end + diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index edeffafeed..a7598e24a5 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -16,6 +16,7 @@ %body.off-canvas{"ng-app" => "Darkswarm"} = inject_json "currentHub", "current_hub" + = inject_json "currentOrder", "current_order" = inject_json "user", "current_user" .off-canvas-wrap{offcanvas: true} diff --git a/app/views/shared/menu/_cart.html.haml b/app/views/shared/menu/_cart.html.haml new file mode 100644 index 0000000000..d2854affb5 --- /dev/null +++ b/app/views/shared/menu/_cart.html.haml @@ -0,0 +1,5 @@ +%a.icon{href: cart_url, "ng-controller" => "CartCtrl"} + %i.fi-shopping-cart.nav-branded + %span + {{ CurrentOrder.cart_count }} + items diff --git a/app/views/shared/menu/_large_menu.html.haml b/app/views/shared/menu/_large_menu.html.haml index 7a72b80f60..44c1e03903 100644 --- a/app/views/shared/menu/_large_menu.html.haml +++ b/app/views/shared/menu/_large_menu.html.haml @@ -43,8 +43,4 @@ %span.nav-primary.nav-branded {{ CurrentHub.name }} %li.divider %li.cart - %a.icon{href: cart_url} - %i.fi-shopping-cart.nav-branded - %span - = cart_count - items + = render partial: "shared/menu/cart" diff --git a/app/views/shared/menu/_mobile_menu.html.haml b/app/views/shared/menu/_mobile_menu.html.haml index 5e9f22c597..b01671e6c4 100644 --- a/app/views/shared/menu/_mobile_menu.html.haml +++ b/app/views/shared/menu/_mobile_menu.html.haml @@ -3,11 +3,7 @@ %a.left-off-canvas-toggle.menu-icon %span %section.right - %a.nav-branded.icon{href: cart_url} - %i.fi-shopping-cart - %span - = cart_count - items + = render partial: "shared/menu/cart" %a{href: main_app.shop_path} {{ CurrentHub.name }} From 57b895b0c39431d5b6a89597bc91f3f8c43fbff4 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 15:50:39 +1000 Subject: [PATCH 17/26] Styling and layout for About Hub Name tab content on shopping page --- app/views/shopping_shared/_about.html.haml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/shopping_shared/_about.html.haml b/app/views/shopping_shared/_about.html.haml index 5c6ddd684b..0fbfc1cc11 100644 --- a/app/views/shopping_shared/_about.html.haml +++ b/app/views/shopping_shared/_about.html.haml @@ -1,3 +1,7 @@ .content#about - %img.about.right{src: current_distributor.promo_image.url(:large)} - %p= current_distributor.long_description.andand.html_safe + .row + .small-12.large-9.columns + %p= current_distributor.long_description.andand.html_safe + .small-12.large-3.columns + %img.about.right{src: current_distributor.promo_image.url(:large)} + From 87d58b639dab84e6a2ebba39ef2769461c30da73 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 15:52:46 +1000 Subject: [PATCH 18/26] Styling and layout and content updates to contact hub tab content --- app/views/shopping_shared/_contact.html.haml | 53 +++++++++++++++----- 1 file changed, 40 insertions(+), 13 deletions(-) diff --git a/app/views/shopping_shared/_contact.html.haml b/app/views/shopping_shared/_contact.html.haml index 9ef1801fba..6a949f9f9c 100644 --- a/app/views/shopping_shared/_contact.html.haml +++ b/app/views/shopping_shared/_contact.html.haml @@ -1,15 +1,42 @@ +/ Will for all the things: please add logic to include this /only/ if data is available + .content#contact .panel - %p - %strong E - %a{href: "mailto:#{current_distributor.email}"}= current_distributor.email - - unless current_distributor.website.blank? - %br - %strong W - %a{href: current_distributor.website}= current_distributor.website - %br - = [current_distributor.address.address1, current_distributor.address.address2].join ", " - %br - = current_distributor.address.city - = current_distributor.address.state - = current_distributor.address.zipcode + .row + .small-12.large-4.columns + %h4=current_distributor.name + %p + = current_distributor.address.address1 + %br + = current_distributor.address.address2 + %br + = current_distributor.address.city + = current_distributor.address.state + = current_distributor.address.zipcode + + .small-12.large-8.columns + %ul.small-block-grid-1.large-block-grid-2{bindonce: true} + %li + %a{href: "mailto:#{current_distributor.website}", target: "_blank" } + %i.fi-web + = current_distributor.website + %li + %a{href: "mailto:#{current_distributor.email}", target: "_blank" } + %i.fi-mail + = current_distributor.email + %li + %a{href: "mailto:#{current_distributor.twitter}", target: "_blank" } + %i.fi-social-twitter + = current_distributor.twitter + %li + %a{href: "mailto:#{current_distributor.facebook}", target: "_blank" } + %i.fi-social-facebook + = current_distributor.facebook + %li + %a{href: "mailto:#{current_distributor.linkedin}", target: "_blank" } + %i.fi-social-linkedin + = current_distributor.linkedin + %li + %a{href: "mailto:#{current_distributor.instagram}", target: "_blank" } + %i.fi-social-instagram + = current_distributor.instagram From 9f172af34c97a7e60310fdec51eb44062ad0960e Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 15:53:06 +1000 Subject: [PATCH 19/26] Styling and layout for groups tab content --- app/views/shopping_shared/_groups.html.haml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/app/views/shopping_shared/_groups.html.haml b/app/views/shopping_shared/_groups.html.haml index e9ebb219b3..194434dcb6 100644 --- a/app/views/shopping_shared/_groups.html.haml +++ b/app/views/shopping_shared/_groups.html.haml @@ -1,5 +1,10 @@ .content - %ul - - for group in current_distributor.groups - %li - %a{href: main_app.groups_path(anchor: "#/#group#{group.id}")}= group.name + .row + .small-12.columns + %h5 + =current_distributor.name + belongs to: + %ul.ofn-list + - for group in current_distributor.groups + %li + %a{href: main_app.groups_path(anchor: "#/#group#{group.id}")}= group.name From 06adca7462002388017b1b74c292b0aabcf51999 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 15:54:10 +1000 Subject: [PATCH 20/26] Producers tab content styling and layout for hub shopfront page --- app/views/shopping_shared/_producers.html.haml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/views/shopping_shared/_producers.html.haml b/app/views/shopping_shared/_producers.html.haml index 584d75ff35..894cd09d61 100644 --- a/app/views/shopping_shared/_producers.html.haml +++ b/app/views/shopping_shared/_producers.html.haml @@ -1,4 +1,9 @@ .content#producers{"ng-controller" => "ProducersTabCtrl"} - %ul - %li{"ng-repeat" => "producer in CurrentHub.producers"} - = render partial: "modals/producer" + .row + .small-12.columns + %h5 + =current_distributor.name + 's producers: + %ul.ofn-list + %li{"ng-repeat" => "producer in CurrentHub.producers"} + = render partial: "modals/producer" From 587cf1ac9bcc63a4082936455600601b87a2d994 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 15:54:29 +1000 Subject: [PATCH 21/26] Tabs styling for hub shopfront page --- app/views/shopping_shared/_tabs.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shopping_shared/_tabs.html.haml b/app/views/shopping_shared/_tabs.html.haml index a5320a7ec5..56fa48b8b5 100644 --- a/app/views/shopping_shared/_tabs.html.haml +++ b/app/views/shopping_shared/_tabs.html.haml @@ -1,6 +1,6 @@ #tabs{"ng-controller" => "TabsCtrl"} .row - %tabset + %tabset.small-12.columns - for name, heading in { about: "About #{current_distributor.name}", producers: "Producers", groups: "Groups", From ae310ff60645eb83f9fc926edc64379fa1983476 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 16:02:46 +1000 Subject: [PATCH 22/26] Refactor producers tab content for spacing of string --- app/views/shopping_shared/_producers.html.haml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/views/shopping_shared/_producers.html.haml b/app/views/shopping_shared/_producers.html.haml index 894cd09d61..2173b3b53f 100644 --- a/app/views/shopping_shared/_producers.html.haml +++ b/app/views/shopping_shared/_producers.html.haml @@ -2,8 +2,7 @@ .row .small-12.columns %h5 - =current_distributor.name - 's producers: + = "#{current_distributor.name}'s producers:" %ul.ofn-list %li{"ng-repeat" => "producer in CurrentHub.producers"} = render partial: "modals/producer" From 5f163eef1c7d2e8748d93d815a5547d9aa53c789 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 30 May 2014 16:10:28 +1000 Subject: [PATCH 23/26] Tweaking the contact thingy --- app/assets/stylesheets/darkswarm/footer.sass | 3 - .../stylesheets/darkswarm/typography.css.sass | 5 ++ app/views/shopping_shared/_contact.html.haml | 69 +++++++++++-------- 3 files changed, 46 insertions(+), 31 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/footer.sass b/app/assets/stylesheets/darkswarm/footer.sass index 80216af995..30f8caf8b4 100644 --- a/app/assets/stylesheets/darkswarm/footer.sass +++ b/app/assets/stylesheets/darkswarm/footer.sass @@ -15,6 +15,3 @@ footer &:hover, &:active, &:focus color: $clr-brick-bright @include textsoftpress - span.email - direction: rtl - unicode-bidi: bidi-override diff --git a/app/assets/stylesheets/darkswarm/typography.css.sass b/app/assets/stylesheets/darkswarm/typography.css.sass index 63d4efe13f..69d16aef9e 100644 --- a/app/assets/stylesheets/darkswarm/typography.css.sass +++ b/app/assets/stylesheets/darkswarm/typography.css.sass @@ -69,3 +69,8 @@ table tr th, table tr td color: #333333 table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td color: #333333 + + +span.email + direction: rtl + unicode-bidi: bidi-override diff --git a/app/views/shopping_shared/_contact.html.haml b/app/views/shopping_shared/_contact.html.haml index 6a949f9f9c..d4894357ad 100644 --- a/app/views/shopping_shared/_contact.html.haml +++ b/app/views/shopping_shared/_contact.html.haml @@ -7,36 +7,49 @@ %h4=current_distributor.name %p = current_distributor.address.address1 - %br + - if current_distributor.address.address2 + %br = current_distributor.address.address2 %br - = current_distributor.address.city - = current_distributor.address.state - = current_distributor.address.zipcode + = current_distributor.address.city + = current_distributor.address.state + = current_distributor.address.zipcode .small-12.large-8.columns %ul.small-block-grid-1.large-block-grid-2{bindonce: true} - %li - %a{href: "mailto:#{current_distributor.website}", target: "_blank" } - %i.fi-web - = current_distributor.website - %li - %a{href: "mailto:#{current_distributor.email}", target: "_blank" } - %i.fi-mail - = current_distributor.email - %li - %a{href: "mailto:#{current_distributor.twitter}", target: "_blank" } - %i.fi-social-twitter - = current_distributor.twitter - %li - %a{href: "mailto:#{current_distributor.facebook}", target: "_blank" } - %i.fi-social-facebook - = current_distributor.facebook - %li - %a{href: "mailto:#{current_distributor.linkedin}", target: "_blank" } - %i.fi-social-linkedin - = current_distributor.linkedin - %li - %a{href: "mailto:#{current_distributor.instagram}", target: "_blank" } - %i.fi-social-instagram - = current_distributor.instagram + - unless current_distributor.website.blank? + %li + %a{href: current_distributor.website, target: "_blank" } + %i.fi-web + = current_distributor.website + + - unless current_distributor.email.blank? + %li + %a{href: current_distributor.email.reverse, mailto: true } + %i.fi-mail + %span.email + = current_distributor.email.reverse + + - unless current_distributor.twitter.blank? + %li + %a{href: current_distributor.twitter, target: "_blank" } + %i.fi-social-twitter + = current_distributor.twitter + + - unless current_distributor.facebook.blank? + %li + %a{href: current_distributor.facebook, target: "_blank" } + %i.fi-social-facebook + = current_distributor.facebook + + - unless current_distributor.linkedin.blank? + %li + %a{href: current_distributor.linkedin, target: "_blank" } + %i.fi-social-linkedin + = current_distributor.linkedin + + - unless current_distributor.instagram.blank? + %li + %a{href: current_distributor.instagram, target: "_blank" } + %i.fi-social-instagram + = current_distributor.instagram From 31ae0cf2a9cecbda09af1f22f6d492ea80e630da Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 16:14:40 +1000 Subject: [PATCH 24/26] Tweak logic on contact us address line display --- app/views/shopping_shared/_contact.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/shopping_shared/_contact.html.haml b/app/views/shopping_shared/_contact.html.haml index d4894357ad..ab4d98a952 100644 --- a/app/views/shopping_shared/_contact.html.haml +++ b/app/views/shopping_shared/_contact.html.haml @@ -7,7 +7,7 @@ %h4=current_distributor.name %p = current_distributor.address.address1 - - if current_distributor.address.address2 + - unless current_distributor.address.address2.blank? %br = current_distributor.address.address2 %br From b19ca3b9c489b8cf44d3767b7c8ba5f0b392d771 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 16:38:27 +1000 Subject: [PATCH 25/26] Remove whitespace --- app/assets/stylesheets/darkswarm/typography.css.sass | 1 - 1 file changed, 1 deletion(-) diff --git a/app/assets/stylesheets/darkswarm/typography.css.sass b/app/assets/stylesheets/darkswarm/typography.css.sass index 69d16aef9e..9e5f80f585 100644 --- a/app/assets/stylesheets/darkswarm/typography.css.sass +++ b/app/assets/stylesheets/darkswarm/typography.css.sass @@ -70,7 +70,6 @@ table tr th, table tr td table thead tr th, table thead tr td, table tfoot tr th, table tfoot tr td color: #333333 - span.email direction: rtl unicode-bidi: bidi-override From ef5b36cddd3dd8275dab242bbd5edff8f2e923bc Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 30 May 2014 16:39:07 +1000 Subject: [PATCH 26/26] Styling producers --- .../stylesheets/darkswarm/images.css.sass | 1 + .../stylesheets/darkswarm/producers.css.sass | 2 +- app/views/modals/_producer.html.haml | 19 +++++++------------ 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/images.css.sass b/app/assets/stylesheets/darkswarm/images.css.sass index 927e906842..90207a2239 100644 --- a/app/assets/stylesheets/darkswarm/images.css.sass +++ b/app/assets/stylesheets/darkswarm/images.css.sass @@ -17,6 +17,7 @@ .producer-hero-img background-color: #999 width: 100% + min-height: 160px height: inherit max-height: 260px overflow: hidden diff --git a/app/assets/stylesheets/darkswarm/producers.css.sass b/app/assets/stylesheets/darkswarm/producers.css.sass index 96a42a3a6b..3ad4e7de3a 100644 --- a/app/assets/stylesheets/darkswarm/producers.css.sass +++ b/app/assets/stylesheets/darkswarm/producers.css.sass @@ -4,4 +4,4 @@ .producers @include fullwidthbg background-image: url("/assets/producers/producers-pg-bg.jpg") - background-repeat: no-repeat + background-repeat: no-repeat \ No newline at end of file diff --git a/app/views/modals/_producer.html.haml b/app/views/modals/_producer.html.haml index 13f8026195..a4dc687eee 100644 --- a/app/views/modals/_producer.html.haml +++ b/app/views/modals/_producer.html.haml @@ -1,39 +1,34 @@ %ofn-modal{title: "{{producer.name}}"} .row - .columns.small-12.producer-hero - %img.producer-hero-img{"ng-src" => "{{producer.promo_image}}"} - / Will - scale large images down to 1200px wide, crop in to img aspect ratio 60W:13H + .small-12.columns.producer-hero %h3.producer-name {{ producer.name }} + %img.producer-hero-img{"ng-src" => "{{producer.promo_image}}"} + .row - .columns.small-12.large-6{"ng-bind-html" => "producer.long_description"} - .columns.small-12.large-6 + .small-12.large-6.columns + %p{"ng-bind-html" => "producer.long_description"} + .small-12.large-6.columns %img.producer-logo{"ng-src" => "{{producer.logo}}", "ng-if" => "producer.logo"} - %h4 Stay in touch with {{ producer.name }} + %h5 Stay in touch with {{ producer.name }} %ul.small-block-grid-1{bindonce: true} %li{"ng-if" => "producer.website"} %a{"ng-href" => "http://{{producer.website | stripUrl}}", target: "_blank" } %i.fi-web {{ producer.website | stripUrl }} - %li{"ng-if" => "producer.twitter"} %a{"ng-href" => "http://twitter.com/{{producer.twitter}}", target: "_blank"} %i.fi-social-twitter {{ producer.twitter }} - %li{"ng-if" => "producer.facebook"} %a{"ng-href" => "http://{{producer.facebook | stripUrl}}", target: "_blank"} %i.fi-social-facebook {{ producer.facebook | stripUrl }} - %li{"ng-if" => "producer.linkedin"} %a{"ng-href" => "http://{{producer.linkedin | stripUrl}}", target: "_blank"} %i.fi-social-linkedin {{ producer.linkedin | stripUrl }} - %li{"ng-if" => "producer.instagram"} %a{"ng-href" => "http://instagram.com/{{producer.instagram}}", target: "_blank"} %i.fi-social-instagram {{ producer.instagram }} - - %a.close-reveal-modal{"ng-click" => "$close()"} ×