From 7dde7214860a177e6312ed2f8afac27149b99864 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Thu, 10 Jul 2014 15:26:35 +1000 Subject: [PATCH 01/25] Adding taxon filtering --- .../controllers/products_controller.js.coffee | 5 ++++- .../directives/taxon_selector.js.coffee | 5 ++++- app/views/shop/products/_filters.html.haml | 17 +++++++++++++++++ app/views/shop/products/_form.html.haml | 7 +++++-- 4 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 app/views/shop/products/_filters.html.haml diff --git a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee index 3860a2d56e..e29797e4e8 100644 --- a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee @@ -1,5 +1,8 @@ -Darkswarm.controller "ProductsCtrl", ($scope, $rootScope, Product, OrderCycle) -> +Darkswarm.controller "ProductsCtrl", ($scope, $rootScope, Product, OrderCycle, FilterSelectorsService) -> $scope.Product = Product + $scope.totalActive = FilterSelectorsService.totalActive + $scope.clearAll = FilterSelectorsService.clearAll + $scope.filterText = FilterSelectorsService.filterText $scope.limit = 3 $scope.ordering = {order: "name"} $scope.order_cycle = OrderCycle.order_cycle diff --git a/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee b/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee index 88dbe919a2..bf665bb23d 100644 --- a/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee @@ -19,8 +19,11 @@ Darkswarm.directive "taxonSelector", (FilterSelectorsService)-> taxons = {} selectors = [] for object in scope.objects() - for taxon in (object.taxons.concat object?.supplied_taxons) + for taxon in object.taxons taxons[taxon.id] = taxon + if object.supplied_taxons + for taxon in object.supplied_taxons + taxons[taxon.id] = taxon for id, taxon of taxons if selector = selectors_by_id[id] selectors.push selector diff --git a/app/views/shop/products/_filters.html.haml b/app/views/shop/products/_filters.html.haml new file mode 100644 index 0000000000..3e7a24a44c --- /dev/null +++ b/app/views/shop/products/_filters.html.haml @@ -0,0 +1,17 @@ += render partial: 'shared/components/filter_controls' + +.row.animate-show{"ng-show" => "filtersActive"} + .small-12.columns + .row.filter-box + .small-12.columns + %h5.tdhead + .light Filter by + Type + %taxon-selector{objects: "Product.products | products:query", + results: "activeTaxons"} + + .row.filter-box.animate-show{"ng-show" => "filtersActive && totalActive() > 0"} + .small-12.columns + %a.button.secondary.small.expand{"ng-click" => "clearAll()"} + %i.ofn-i_009-close + Clear all filters diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index 391ad83227..c3f3911f5a 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -1,6 +1,7 @@ %products.small-12.columns{"ng-controller" => "ProductsCtrl", "ng-show" => "order_cycle.order_cycle_id != null", "infinite-scroll" => "incrementLimit()", "infinite-scroll-distance" => "1"} + = form_for :order, :url => populate_orders_path, html: {:class => "custom"} do .row .small-6.columns @@ -8,12 +9,14 @@ placeholder: "Search products", "ng-debounce" => "150", "ofn-disable-enter" => true} + .small-6.columns %input.button.primary.right{type: :submit, value: "Add to Cart"} - + = render partial: "shop/products/filters" + %div{bindonce: true} %product.animate-repeat{"ng-controller" => "ProductNodeCtrl", - "ng-repeat" => "product in Product.products | products:query | orderBy:ordering.order"} + "ng-repeat" => "product in Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order"} %div = render partial: "shop/products/summary" %div{"bo-if" => "hasVariants"} From 46017be45cde5fa3887d218563861c0ce951e003 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 12:27:17 +1000 Subject: [PATCH 02/25] Make big input fill out all width available --- app/assets/stylesheets/darkswarm/big-input.sass | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/darkswarm/big-input.sass b/app/assets/stylesheets/darkswarm/big-input.sass index 70cb3bd4f9..133097a5ac 100644 --- a/app/assets/stylesheets/darkswarm/big-input.sass +++ b/app/assets/stylesheets/darkswarm/big-input.sass @@ -17,6 +17,7 @@ box-shadow: 0 padding: 0.75rem 1rem 0.35rem 1rem height: auto + width: 100% margin-bottom: 0.5rem box-shadow: none color: $inputactv From 6adc056ce08ee889389955bc54b3c543cbfcad53 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 12:27:35 +1000 Subject: [PATCH 03/25] Styling filters and search on shopfront --- app/assets/stylesheets/darkswarm/shop.css.sass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/shop.css.sass b/app/assets/stylesheets/darkswarm/shop.css.sass index 9011f99a7f..595c900386 100644 --- a/app/assets/stylesheets/darkswarm/shop.css.sass +++ b/app/assets/stylesheets/darkswarm/shop.css.sass @@ -6,10 +6,10 @@ .darkswarm // #search - @include placeholder(rgba(0,0,0,0.3), #999) + @include placeholder(rgba(0,0,0,0.4), #777) input#search - @include big-input(rgba(0,0,0,0.2), #999, #000) + @include big-input(rgba(0,0,0,0.3), #777, $clr-brick) @include big-input-static color: #666 From 88b1b8b104c55b7d48de939f3a9833453bb22fca Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 12:27:51 +1000 Subject: [PATCH 04/25] Styling search for shopfront page --- .../darkswarm/active_table_search.css.sass | 3 +++ app/views/shop/products/_form.html.haml | 15 +++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/active_table_search.css.sass b/app/assets/stylesheets/darkswarm/active_table_search.css.sass index d8f253ee28..8bb131e9a9 100644 --- a/app/assets/stylesheets/darkswarm/active_table_search.css.sass +++ b/app/assets/stylesheets/darkswarm/active_table_search.css.sass @@ -14,6 +14,9 @@ .filter-box background: rgba(255,255,255,0.65) +products .filter-box + background: #f7f7f7 + .tdhead padding: 0.25rem 0.5rem margin-top: 0.9rem diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index c3f3911f5a..891a903fa5 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -4,17 +4,20 @@ = form_for :order, :url => populate_orders_path, html: {:class => "custom"} do .row - .small-6.columns + .small-12.medium-8.large-8.columns %input#search.text{"ng-model" => "query", - placeholder: "Search products", + placeholder: "Search by product or producer", "ng-debounce" => "150", "ofn-disable-enter" => true} - .small-6.columns - %input.button.primary.right{type: :submit, value: "Add to Cart"} - = render partial: "shop/products/filters" + = render partial: "shop/products/filters" - %div{bindonce: true} + .small-12.medium-4.large-4.columns + %input.button.primary.right{type: :submit, value: "Add to Cart"} + + + + %div.pad-top{bindonce: true} %product.animate-repeat{"ng-controller" => "ProductNodeCtrl", "ng-repeat" => "product in Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order"} %div From 40b858306b1a409af7e8724fa4b7ddc5e5e01558 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 12:36:27 +1000 Subject: [PATCH 05/25] Make all taxons sentence case. ALl of them! for reals yo. --- .../stylesheets/darkswarm/active_table_search.css.sass | 7 ++++--- app/assets/stylesheets/darkswarm/taxons.css.sass | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/active_table_search.css.sass b/app/assets/stylesheets/darkswarm/active_table_search.css.sass index 8bb131e9a9..5b36c0da1f 100644 --- a/app/assets/stylesheets/darkswarm/active_table_search.css.sass +++ b/app/assets/stylesheets/darkswarm/active_table_search.css.sass @@ -11,12 +11,12 @@ .row.filter-box:first-child border-top: 1px solid $clr-brick -.filter-box - background: rgba(255,255,255,0.65) - products .filter-box background: #f7f7f7 +.filter-box + background: rgba(255,255,255,0.65) + .tdhead padding: 0.25rem 0.5rem margin-top: 0.9rem @@ -48,6 +48,7 @@ products .filter-box @include csstrans display: table table-layout: fixed + text-transform: capitalize overflow: visible // width: 100% // height: 2rem diff --git a/app/assets/stylesheets/darkswarm/taxons.css.sass b/app/assets/stylesheets/darkswarm/taxons.css.sass index 160d2ce002..32ba3aba1b 100644 --- a/app/assets/stylesheets/darkswarm/taxons.css.sass +++ b/app/assets/stylesheets/darkswarm/taxons.css.sass @@ -6,7 +6,7 @@ line-height: 1 margin-right: 0.5rem margin-bottom: 0.35rem - text-transform: uppercase + text-transform: capitalize font-weight: 300 font-size: 0.875rem background: rgba(235,235,235,0.5) From d4a6624c28b792886508e5ddbe8dbcd7096b0a25 Mon Sep 17 00:00:00 2001 From: Rob H Date: Thu, 10 Jul 2014 17:04:35 +1000 Subject: [PATCH 06/25] Prevent display_as and display_name from being used when blank --- app/models/spree/variant_decorator.rb | 6 ++++-- spec/models/spree/variant_spec.rb | 7 ++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/models/spree/variant_decorator.rb b/app/models/spree/variant_decorator.rb index 81977bc05a..12593215ba 100644 --- a/app/models/spree/variant_decorator.rb +++ b/app/models/spree/variant_decorator.rb @@ -51,11 +51,13 @@ Spree::Variant.class_eval do end def name_to_display - display_name || product.name + return product.name if display_name.blank? + display_name end def unit_to_display - display_as || options_text + return options_text if display_as.blank? + display_as end diff --git a/spec/models/spree/variant_spec.rb b/spec/models/spree/variant_spec.rb index bf13cf978c..0abf9ea431 100644 --- a/spec/models/spree/variant_spec.rb +++ b/spec/models/spree/variant_spec.rb @@ -133,6 +133,8 @@ module Spree it "returns product name if display_name is empty" do v = create(:variant, product: create(:product)) v.name_to_display.should == v.product.name + v1 = create(:variant, display_name: "", product: create(:product)) + v1.name_to_display.should == v1.product.name end end @@ -142,10 +144,13 @@ module Spree v.unit_to_display.should == "foo" end - it "returns options_text if display_as is empty" do + it "returns options_text if display_as is blank" do v = create(:variant) + v1 = create(:variant, display_as: "") v.stub(:options_text).and_return "ponies" + v1.stub(:options_text).and_return "ponies" v.unit_to_display.should == "ponies" + v1.unit_to_display.should == "ponies" end end From ef55bf97c6f433925b7e74d879e3300d24a74cef Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 12:37:04 +1000 Subject: [PATCH 07/25] Bunch of small fixes for Laura --- .../darkswarm/controllers/hubs_controller.js.coffee | 1 + .../darkswarm/controllers/producers_controller.js.coffee | 1 + .../darkswarm/controllers/products_controller.js.coffee | 1 + .../darkswarm/directives/taxon_selector.js.coffee | 1 + app/views/shared/components/_filter_controls.html.haml | 6 +++++- app/views/shop/products.rabl | 2 +- app/views/shop/products/_form.html.haml | 8 +++++++- 7 files changed, 17 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/hubs_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/hubs_controller.js.coffee index 769b47cbe8..98053daebf 100644 --- a/app/assets/javascripts/darkswarm/controllers/hubs_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/hubs_controller.js.coffee @@ -4,6 +4,7 @@ Darkswarm.controller "HubsCtrl", ($scope, Hubs, Search, $document, $rootScope, H $scope.totalActive = FilterSelectorsService.totalActive $scope.clearAll = FilterSelectorsService.clearAll $scope.filterText = FilterSelectorsService.filterText + $scope.FilterSelectorsService = FilterSelectorsService $scope.query = Search.search() $scope.$watch "query", (query)-> diff --git a/app/assets/javascripts/darkswarm/controllers/producers_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/producers_controller.js.coffee index 6fdb589529..d88af1e53d 100644 --- a/app/assets/javascripts/darkswarm/controllers/producers_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/producers_controller.js.coffee @@ -3,6 +3,7 @@ Darkswarm.controller "ProducersCtrl", ($scope, Producers, $filter, FilterSelecto $scope.totalActive = FilterSelectorsService.totalActive $scope.clearAll = FilterSelectorsService.clearAll $scope.filterText = FilterSelectorsService.filterText + $scope.FilterSelectorsService = FilterSelectorsService $scope.filtersActive = false $scope.activeTaxons = [] $scope.query = Search.search() diff --git a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee index e29797e4e8..361c1ebca4 100644 --- a/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products_controller.js.coffee @@ -3,6 +3,7 @@ Darkswarm.controller "ProductsCtrl", ($scope, $rootScope, Product, OrderCycle, F $scope.totalActive = FilterSelectorsService.totalActive $scope.clearAll = FilterSelectorsService.clearAll $scope.filterText = FilterSelectorsService.filterText + $scope.FilterSelectorsService = FilterSelectorsService $scope.limit = 3 $scope.ordering = {order: "name"} $scope.order_cycle = OrderCycle.order_cycle diff --git a/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee b/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee index bf665bb23d..9c05de3c8f 100644 --- a/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee @@ -24,6 +24,7 @@ Darkswarm.directive "taxonSelector", (FilterSelectorsService)-> if object.supplied_taxons for taxon in object.supplied_taxons taxons[taxon.id] = taxon + for id, taxon of taxons if selector = selectors_by_id[id] selectors.push selector diff --git a/app/views/shared/components/_filter_controls.html.haml b/app/views/shared/components/_filter_controls.html.haml index 7fe95c324a..c8fccb0558 100644 --- a/app/views/shared/components/_filter_controls.html.haml +++ b/app/views/shared/components/_filter_controls.html.haml @@ -1,6 +1,10 @@ .row .small-12.columns - %a.button.primary.tiny.filterbtn{{"ng-click" => "filtersActive = !filtersActive"}} + %a.button.primary.tiny.filterbtn{"ng-click" => "filtersActive = !filtersActive", + "ng-show" => "FilterSelectorsService.selectors.length > 0"} {{ filterText(filtersActive) }} %i.ofn-i_005-caret-down{"ng-show" => "!filtersActive"} %i.ofn-i_006-caret-up{"ng-show" => "filtersActive"} + + %a.button.secondary.tiny.filterbtn.disabled{"ng-show" => "FilterSelectorsService.selectors.length == 0"} + No filters diff --git a/app/views/shop/products.rabl b/app/views/shop/products.rabl index b934272b9a..dca5ea1673 100644 --- a/app/views/shop/products.rabl +++ b/app/views/shop/products.rabl @@ -43,7 +43,7 @@ node :variants do |product| end child :taxons => :taxons do |taxon| - attributes :name + attributes :name, :id end child :properties => :properties do |property| diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index 891a903fa5..ecd693d8ad 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -19,7 +19,7 @@ %div.pad-top{bindonce: true} %product.animate-repeat{"ng-controller" => "ProductNodeCtrl", - "ng-repeat" => "product in Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order"} + "ng-repeat" => "product in filteredProducts = (Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order)"} %div = render partial: "shop/products/summary" %div{"bo-if" => "hasVariants"} @@ -31,6 +31,12 @@ .row.summary .small-12.columns.text-center Loading products + + %product{"ng-show" => "filteredProducts.length == 0 && !Product.loading"} + .row.summary + .small-12.columns.text-center + No results for {{ query }} + .row .small-12.columns %input.button.primary.right.add_to_cart{type: :submit, value: "Add to Cart"} From fecc68cff8102e09df0f5fb4ec776fb2f010236b Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 12:40:49 +1000 Subject: [PATCH 08/25] Dereferencing product Taxons --- app/assets/javascripts/darkswarm/services/product.js.coffee | 4 +++- app/views/shop/products.rabl | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/darkswarm/services/product.js.coffee b/app/assets/javascripts/darkswarm/services/product.js.coffee index 2c57512bff..e33a037a61 100644 --- a/app/assets/javascripts/darkswarm/services/product.js.coffee +++ b/app/assets/javascripts/darkswarm/services/product.js.coffee @@ -1,4 +1,4 @@ -Darkswarm.factory 'Product', ($resource, Enterprises) -> +Darkswarm.factory 'Product', ($resource, Enterprises, Dereferencer, Taxons) -> new class Product constructor: -> @update() @@ -18,3 +18,5 @@ Darkswarm.factory 'Product', ($resource, Enterprises) -> dereference: -> for product in @products product.supplier = Enterprises.enterprises_by_id[product.supplier.id] + Dereferencer.dereference product.taxons, Taxons.taxons_by_id + diff --git a/app/views/shop/products.rabl b/app/views/shop/products.rabl index dca5ea1673..a337ec3b16 100644 --- a/app/views/shop/products.rabl +++ b/app/views/shop/products.rabl @@ -43,7 +43,7 @@ node :variants do |product| end child :taxons => :taxons do |taxon| - attributes :name, :id + attributes :id end child :properties => :properties do |property| From 190e320bad67bf3ee9bf1d201814c1fdcbd3314a Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 12:45:08 +1000 Subject: [PATCH 09/25] Pulling some structure out of directives --- .../templates/shipping_type_selector.html.haml | 7 +++---- app/assets/javascripts/templates/taxon_selector.html.haml | 7 +++---- app/views/home/_filters.html.haml | 8 +++++--- app/views/producers/_filters.html.haml | 5 +++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/app/assets/javascripts/templates/shipping_type_selector.html.haml b/app/assets/javascripts/templates/shipping_type_selector.html.haml index cdbe702f32..8feb23e59f 100644 --- a/app/assets/javascripts/templates/shipping_type_selector.html.haml +++ b/app/assets/javascripts/templates/shipping_type_selector.html.haml @@ -1,4 +1,3 @@ -%ul.small-block-grid-2.large-block-grid-1 - %active-selector{"ng-repeat" => "(name, selector) in selectors"} - %i{"ng-class" => "selector.icon"} - {{ name | capitalize }} +%active-selector{"ng-repeat" => "(name, selector) in selectors"} + %i{"ng-class" => "selector.icon"} + {{ name | capitalize }} diff --git a/app/assets/javascripts/templates/taxon_selector.html.haml b/app/assets/javascripts/templates/taxon_selector.html.haml index dd40453e3f..02450c8d12 100644 --- a/app/assets/javascripts/templates/taxon_selector.html.haml +++ b/app/assets/javascripts/templates/taxon_selector.html.haml @@ -1,4 +1,3 @@ -%ul.small-block-grid-2.large-block-grid-5 - %active-selector{"ng-repeat" => "selector in selectors()"} - %render-svg{path: "{{selector.taxon.icon}}"} - %span {{ selector.taxon.name }} +%active-selector{"ng-repeat" => "selector in selectors()"} + %render-svg{path: "{{selector.taxon.icon}}"} + %span {{ selector.taxon.name }} diff --git a/app/views/home/_filters.html.haml b/app/views/home/_filters.html.haml index ab98389e82..19976cbe34 100644 --- a/app/views/home/_filters.html.haml +++ b/app/views/home/_filters.html.haml @@ -7,13 +7,15 @@ %h5.tdhead .light Filter by Type - %taxon-selector{objects: "hubs | hubs:query", - results: "activeTaxons"} + %ul.small-block-grid-2.large-block-grid-5 + %taxon-selector{objects: "hubs | hubs:query", + results: "activeTaxons"} .small-12.large-3.columns %h5.tdhead .light Filter by Delivery - %shipping-type-selector{results: "shippingTypes"} + %ul.small-block-grid-2.large-block-grid-1 + %shipping-type-selector{results: "shippingTypes"} .row.filter-box.animate-show{"ng-show" => "filtersActive && totalActive() > 0"} .small-12.columns %a.button.secondary.small.expand{"ng-click" => "clearAll()"} diff --git a/app/views/producers/_filters.html.haml b/app/views/producers/_filters.html.haml index 2419e0478d..a0667a4373 100644 --- a/app/views/producers/_filters.html.haml +++ b/app/views/producers/_filters.html.haml @@ -7,8 +7,9 @@ %h5.tdhead .light Filter by Type - %taxon-selector{objects: "Producers.visible | filterProducers:query", - results: "activeTaxons"} + %ul.small-block-grid-2.large-block-grid-5 + %taxon-selector{objects: "Producers.visible | filterProducers:query", + results: "activeTaxons"} .row.filter-box.animate-show{"ng-show" => "filtersActive && totalActive() > 0"} .small-12.columns From 21d1d2d1c184583892f28d1b345e0abaaeeba2ca Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 12:53:32 +1000 Subject: [PATCH 10/25] Replacing taxon directive --- .../javascripts/darkswarm/directives/taxon_selector.js.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee b/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee index 9c05de3c8f..a682176d77 100644 --- a/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/taxon_selector.js.coffee @@ -1,5 +1,6 @@ Darkswarm.directive "taxonSelector", (FilterSelectorsService)-> restrict: 'E' + replace: true scope: objects: "&" results: "=" From 61dbc2cd636b947a4df87f582ce925ff2317643e Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 12:54:40 +1000 Subject: [PATCH 11/25] Replace for shipping selector --- .../darkswarm/directives/shipping_type_selector.js.coffee | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/javascripts/darkswarm/directives/shipping_type_selector.js.coffee b/app/assets/javascripts/darkswarm/directives/shipping_type_selector.js.coffee index 856b6dcac2..3f752f8a3d 100644 --- a/app/assets/javascripts/darkswarm/directives/shipping_type_selector.js.coffee +++ b/app/assets/javascripts/darkswarm/directives/shipping_type_selector.js.coffee @@ -1,5 +1,6 @@ Darkswarm.directive "shippingTypeSelector", (FilterSelectorsService)-> restrict: 'E' + replace: true templateUrl: 'shipping_type_selector.html' link: (scope, elem, attr)-> scope.shippingTypes = From c907e35834103d8c9556263aa5ccbc40be20b144 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 12:44:43 +1000 Subject: [PATCH 12/25] More styling on search and filters --- app/assets/stylesheets/darkswarm/active_table_search.css.sass | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/stylesheets/darkswarm/active_table_search.css.sass b/app/assets/stylesheets/darkswarm/active_table_search.css.sass index 5b36c0da1f..6c411b9d40 100644 --- a/app/assets/stylesheets/darkswarm/active_table_search.css.sass +++ b/app/assets/stylesheets/darkswarm/active_table_search.css.sass @@ -22,9 +22,12 @@ products .filter-box margin-top: 0.9rem // OVERRIDES + [class*="block-grid-"] + margin: 0 0 0.5rem 0 [class*="block-grid-"] > li padding-bottom: 0.5rem !important + li @include border-radius(12px) padding-top: 0.5rem From 068e3cce1c724d5c5acdc2d555a5e872c7d25385 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 13:09:42 +1000 Subject: [PATCH 13/25] More tweaks to filters styling --- app/assets/stylesheets/darkswarm/active_table_search.css.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/darkswarm/active_table_search.css.sass b/app/assets/stylesheets/darkswarm/active_table_search.css.sass index 6c411b9d40..9920dc1d87 100644 --- a/app/assets/stylesheets/darkswarm/active_table_search.css.sass +++ b/app/assets/stylesheets/darkswarm/active_table_search.css.sass @@ -15,7 +15,7 @@ products .filter-box background: #f7f7f7 .filter-box - background: rgba(255,255,255,0.65) + background: rgba(245,245,245,0.6) .tdhead padding: 0.25rem 0.5rem From 23182a90260277fac7fdd0529d1eff2b62cb66e5 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 13:10:22 +1000 Subject: [PATCH 14/25] Grid system layout for filter buttons for all sizes and breakpoints --- app/views/home/_filters.html.haml | 4 ++-- app/views/producers/_filters.html.haml | 2 +- app/views/shop/products/_filters.html.haml | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/views/home/_filters.html.haml b/app/views/home/_filters.html.haml index 19976cbe34..78d755f1bc 100644 --- a/app/views/home/_filters.html.haml +++ b/app/views/home/_filters.html.haml @@ -7,14 +7,14 @@ %h5.tdhead .light Filter by Type - %ul.small-block-grid-2.large-block-grid-5 + %ul.small-block-grid-2.medium-block-grid-4.large-block-grid-5 %taxon-selector{objects: "hubs | hubs:query", results: "activeTaxons"} .small-12.large-3.columns %h5.tdhead .light Filter by Delivery - %ul.small-block-grid-2.large-block-grid-1 + %ul.small-block-grid-2.medium-block-grid-4.large-block-grid-2 %shipping-type-selector{results: "shippingTypes"} .row.filter-box.animate-show{"ng-show" => "filtersActive && totalActive() > 0"} .small-12.columns diff --git a/app/views/producers/_filters.html.haml b/app/views/producers/_filters.html.haml index a0667a4373..63ccef2f0c 100644 --- a/app/views/producers/_filters.html.haml +++ b/app/views/producers/_filters.html.haml @@ -7,7 +7,7 @@ %h5.tdhead .light Filter by Type - %ul.small-block-grid-2.large-block-grid-5 + %ul.small-block-grid-2.medium-block-grid-4.large-block-grid-6 %taxon-selector{objects: "Producers.visible | filterProducers:query", results: "activeTaxons"} diff --git a/app/views/shop/products/_filters.html.haml b/app/views/shop/products/_filters.html.haml index 3e7a24a44c..7879bcc5d1 100644 --- a/app/views/shop/products/_filters.html.haml +++ b/app/views/shop/products/_filters.html.haml @@ -7,8 +7,9 @@ %h5.tdhead .light Filter by Type - %taxon-selector{objects: "Product.products | products:query", - results: "activeTaxons"} + %ul.small-block-grid-2.medium-block-grid-3.large-block-grid-4 + %taxon-selector{objects: "Product.products | products:query", + results: "activeTaxons"} .row.filter-box.animate-show{"ng-show" => "filtersActive && totalActive() > 0"} .small-12.columns From 13cc9ba44d32ef26fe7832140c0ad84444554bc3 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 14:41:18 +1000 Subject: [PATCH 15/25] Remove line-height stuff which was making the animation in juddery --- app/assets/stylesheets/darkswarm/animations.sass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/animations.sass b/app/assets/stylesheets/darkswarm/animations.sass index ff51d36199..966f2a2d48 100644 --- a/app/assets/stylesheets/darkswarm/animations.sass +++ b/app/assets/stylesheets/darkswarm/animations.sass @@ -84,7 +84,7 @@ opacity: .5 .animate-repeat - line-height: 40px + // line-height: 40px list-style: none box-sizing: border-box @@ -104,7 +104,7 @@ .animate-repeat.ng-move.ng-move-active, .animate-repeat.ng-enter.ng-enter-active opacity: 1 - max-height: 40px + max-height: inherit .animate-show From 16d39aeacc7fba8aceaafba68919571c3859dd8d Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 14:41:46 +1000 Subject: [PATCH 16/25] Tweak line-height on product row in shopfront --- app/assets/stylesheets/darkswarm/shop.css.sass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/stylesheets/darkswarm/shop.css.sass b/app/assets/stylesheets/darkswarm/shop.css.sass index 595c900386..6e6001ce6e 100644 --- a/app/assets/stylesheets/darkswarm/shop.css.sass +++ b/app/assets/stylesheets/darkswarm/shop.css.sass @@ -115,7 +115,7 @@ .columns padding-top: 1em padding-bottom: 1em - line-height: 2.4em + line-height: 1em .row.summary, .row.variants margin-left: 0 From 1eb18e84787751fc4388a2b5aeca380c977dbf3f Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 14:42:44 +1000 Subject: [PATCH 17/25] Add some padding to first child in active table - should not be styled from animation classes --- app/assets/stylesheets/darkswarm/active_table.css.sass | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/darkswarm/active_table.css.sass b/app/assets/stylesheets/darkswarm/active_table.css.sass index a386328a5a..fffc6d9347 100644 --- a/app/assets/stylesheets/darkswarm/active_table.css.sass +++ b/app/assets/stylesheets/darkswarm/active_table.css.sass @@ -9,6 +9,7 @@ display: block &:first-child cursor: pointer + padding: 1rem 0 .no-results font-size: 1.875rem From 26d6ac5a8d619a7a60ebef8ac149a83092fb7014 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 14:50:40 +1000 Subject: [PATCH 18/25] Styling no results message for shopfront --- app/assets/stylesheets/darkswarm/active_table.css.sass | 7 ++++--- app/views/shop/products/_form.html.haml | 10 ++++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/active_table.css.sass b/app/assets/stylesheets/darkswarm/active_table.css.sass index fffc6d9347..a08f2c794b 100644 --- a/app/assets/stylesheets/darkswarm/active_table.css.sass +++ b/app/assets/stylesheets/darkswarm/active_table.css.sass @@ -2,6 +2,10 @@ @import mixins @import "compass/css3/user-interface" + +.no-results + font-size: 1.875rem + .active_table margin: 2em 0em @include user-select(none) @@ -10,9 +14,6 @@ &:first-child cursor: pointer padding: 1rem 0 - - .no-results - font-size: 1.875rem .active_table .active_table_node display: block diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index ecd693d8ad..37ae4e61d6 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -32,11 +32,13 @@ .small-12.columns.text-center Loading products - %product{"ng-show" => "filteredProducts.length == 0 && !Product.loading"} + %div{"ng-show" => "filteredProducts.length == 0 && !Product.loading"} .row.summary - .small-12.columns.text-center - No results for {{ query }} - + .small-12.columns + %p.no-results + Sorry, no results found for + %strong {{query}}. + Try another search? .row .small-12.columns %input.button.primary.right.add_to_cart{type: :submit, value: "Add to Cart"} From d67992eb7b4972b87d2948c5b8842cde6cec05b7 Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 15:07:29 +1000 Subject: [PATCH 19/25] Tweak animation stylings --- app/assets/stylesheets/darkswarm/animations.sass | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/animations.sass b/app/assets/stylesheets/darkswarm/animations.sass index 966f2a2d48..27df090ebc 100644 --- a/app/assets/stylesheets/darkswarm/animations.sass +++ b/app/assets/stylesheets/darkswarm/animations.sass @@ -91,20 +91,25 @@ .animate-repeat.ng-move, .animate-repeat.ng-enter, .animate-repeat.ng-leave - -webkit-transition: all linear 0.2s - transition: all linear 0.2s + -webkit-transition: all linear 300ms + transition: all linear 300ms + + -webkit-transition: border linear 500ms ease-in + transition : border 500ms ease-in .animate-repeat.ng-leave.ng-leave-active, .animate-repeat.ng-move, .animate-repeat.ng-enter opacity: 0 max-height: 0 + border-color: transparent .animate-repeat.ng-leave, .animate-repeat.ng-move.ng-move-active, .animate-repeat.ng-enter.ng-enter-active opacity: 1 max-height: inherit + border-color: inherit .animate-show From c852eefdbc898a0d58c34df041d70ba9fd3f726a Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 13:05:14 +1000 Subject: [PATCH 20/25] Re-enabling infinite scroll --- app/views/shop/products/_form.html.haml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index 37ae4e61d6..940df58b29 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -7,19 +7,17 @@ .small-12.medium-8.large-8.columns %input#search.text{"ng-model" => "query", placeholder: "Search by product or producer", - "ng-debounce" => "150", + "ng-debounce" => "100", "ofn-disable-enter" => true} = render partial: "shop/products/filters" .small-12.medium-4.large-4.columns %input.button.primary.right{type: :submit, value: "Add to Cart"} - - %div.pad-top{bindonce: true} %product.animate-repeat{"ng-controller" => "ProductNodeCtrl", - "ng-repeat" => "product in filteredProducts = (Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order)"} + "ng-repeat" => "product in filteredProducts = (Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order | limitTo:limit) track by product.id "} %div = render partial: "shop/products/summary" %div{"bo-if" => "hasVariants"} From 7bd65d78549dab137b9e0cdf055cd44fb32d30d0 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 15:09:20 +1000 Subject: [PATCH 21/25] Performance improvements --- .../products/product_node_controller.js.coffee | 14 +++++--------- .../darkswarm/directives/product_modal.js.coffee | 9 --------- .../darkswarm/services/product.js.coffee | 12 +++++++++--- app/views/shop/products/_form.html.haml | 2 +- app/views/shop/products/_summary.html.haml | 7 +++---- app/views/shop/products/_variants.html.haml | 2 +- 6 files changed, 19 insertions(+), 27 deletions(-) delete mode 100644 app/assets/javascripts/darkswarm/directives/product_modal.js.coffee diff --git a/app/assets/javascripts/darkswarm/controllers/products/product_node_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products/product_node_controller.js.coffee index 73406e072b..08797080e8 100644 --- a/app/assets/javascripts/darkswarm/controllers/products/product_node_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products/product_node_controller.js.coffee @@ -1,11 +1,7 @@ -Darkswarm.controller "ProductNodeCtrl", ($scope) -> - - $scope.price = -> - if $scope.product.variants.length > 0 - prices = (v.price for v in $scope.product.variants) - Math.min.apply(null, prices) - else - $scope.product.price - +Darkswarm.controller "ProductNodeCtrl", ($scope, $modal) -> $scope.enterprise = $scope.product.supplier # For the modal, so it's consistent $scope.hasVariants = $scope.product.variants.length > 0 + + $scope.triggerProductModal = -> + $modal.open(templateUrl: "product_modal.html", scope: $scope) + diff --git a/app/assets/javascripts/darkswarm/directives/product_modal.js.coffee b/app/assets/javascripts/darkswarm/directives/product_modal.js.coffee deleted file mode 100644 index 428fde3633..0000000000 --- a/app/assets/javascripts/darkswarm/directives/product_modal.js.coffee +++ /dev/null @@ -1,9 +0,0 @@ -Darkswarm.directive "productModal", ($modal)-> - restrict: 'E' - replace: true - template: "" - transclude: true - link: (scope, elem, attrs, ctrl)-> - elem.on "click", => - scope.modalInstance = $modal.open(controller: ctrl, templateUrl: 'product_modal.html', scope: scope) - diff --git a/app/assets/javascripts/darkswarm/services/product.js.coffee b/app/assets/javascripts/darkswarm/services/product.js.coffee index e33a037a61..478647d2db 100644 --- a/app/assets/javascripts/darkswarm/services/product.js.coffee +++ b/app/assets/javascripts/darkswarm/services/product.js.coffee @@ -1,5 +1,5 @@ Darkswarm.factory 'Product', ($resource, Enterprises, Dereferencer, Taxons) -> - new class Product + new class Products constructor: -> @update() @@ -10,7 +10,8 @@ Darkswarm.factory 'Product', ($resource, Enterprises, Dereferencer, Taxons) -> update: => @loading = true - @products = $resource("/shop/products").query => + @products = $resource("/shop/products").query (products)=> + @extend() @dereference() @loading = false @ @@ -19,4 +20,9 @@ Darkswarm.factory 'Product', ($resource, Enterprises, Dereferencer, Taxons) -> for product in @products product.supplier = Enterprises.enterprises_by_id[product.supplier.id] Dereferencer.dereference product.taxons, Taxons.taxons_by_id - + + extend: -> + for product in @products + if product.variants.length > 0 + prices = (v.price for v in product.variants) + product.price = Math.min.apply(null, prices) diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index 940df58b29..fc43f05e9b 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -17,7 +17,7 @@ %div.pad-top{bindonce: true} %product.animate-repeat{"ng-controller" => "ProductNodeCtrl", - "ng-repeat" => "product in filteredProducts = (Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order | limitTo:limit) track by product.id "} + "ng-repeat" => "product in filteredProducts = (Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order) track by product.id "} %div = render partial: "shop/products/summary" %div{"bo-if" => "hasVariants"} diff --git a/app/views/shop/products/_summary.html.haml b/app/views/shop/products/_summary.html.haml index b21b535315..b1cd7b0e78 100644 --- a/app/views/shop/products/_summary.html.haml +++ b/app/views/shop/products/_summary.html.haml @@ -1,11 +1,10 @@ .row.summary .small-1.columns - %product-modal - %img{"bo-src" => "product.master.images[0].small_url"} + %img{"bo-src" => "product.master.images[0].small_url", "ng-click" => "triggerProductModal()"} .small-4.columns.summary-header %render-svg{path: "{{product.primary_taxon.icon}}"} - %product-modal {{ product.name }} + %a{"ng-click" => "triggerProductModal()"}{{ product.name }} .small-5.columns %i.ofn-i_036-producers @@ -14,4 +13,4 @@ .small-2.columns.summary-price.text-right.price %span{"ng-if" => "hasVariants"} %em from - {{ price() | currency }} + {{ product.price | currency }} diff --git a/app/views/shop/products/_variants.html.haml b/app/views/shop/products/_variants.html.haml index 5d6a59535e..2d281dafe8 100644 --- a/app/views/shop/products/_variants.html.haml +++ b/app/views/shop/products/_variants.html.haml @@ -1,5 +1,5 @@ .row.variants{bindonce: true, - "ng-repeat" => "variant in product.variants"} + "ng-repeat" => "variant in product.variants track by variant.id"} .small-1.columns %i.ofn-i_056-bulk{"bo-if" => "product.group_buy"} From 500e067cfb2f7812fae2f39c02744177ea84d88e Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 16:14:44 +1000 Subject: [PATCH 22/25] Performance enhancements --- .../controllers/products/product_node_controller.js.coffee | 1 - app/assets/javascripts/darkswarm/services/product.js.coffee | 2 ++ app/views/shop/products/_form.html.haml | 4 ++-- app/views/shop/products/_summary.html.haml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/darkswarm/controllers/products/product_node_controller.js.coffee b/app/assets/javascripts/darkswarm/controllers/products/product_node_controller.js.coffee index 08797080e8..07ddb4bc61 100644 --- a/app/assets/javascripts/darkswarm/controllers/products/product_node_controller.js.coffee +++ b/app/assets/javascripts/darkswarm/controllers/products/product_node_controller.js.coffee @@ -1,6 +1,5 @@ Darkswarm.controller "ProductNodeCtrl", ($scope, $modal) -> $scope.enterprise = $scope.product.supplier # For the modal, so it's consistent - $scope.hasVariants = $scope.product.variants.length > 0 $scope.triggerProductModal = -> $modal.open(templateUrl: "product_modal.html", scope: $scope) diff --git a/app/assets/javascripts/darkswarm/services/product.js.coffee b/app/assets/javascripts/darkswarm/services/product.js.coffee index 478647d2db..48cdd6ae33 100644 --- a/app/assets/javascripts/darkswarm/services/product.js.coffee +++ b/app/assets/javascripts/darkswarm/services/product.js.coffee @@ -26,3 +26,5 @@ Darkswarm.factory 'Product', ($resource, Enterprises, Dereferencer, Taxons) -> if product.variants.length > 0 prices = (v.price for v in product.variants) product.price = Math.min.apply(null, prices) + + product.hasVariants = product.variants.length > 0 diff --git a/app/views/shop/products/_form.html.haml b/app/views/shop/products/_form.html.haml index fc43f05e9b..2aaf7a4f5f 100644 --- a/app/views/shop/products/_form.html.haml +++ b/app/views/shop/products/_form.html.haml @@ -20,9 +20,9 @@ "ng-repeat" => "product in filteredProducts = (Product.products | products:query | taxons:activeTaxons | orderBy:ordering.order) track by product.id "} %div = render partial: "shop/products/summary" - %div{"bo-if" => "hasVariants"} + %div{"bo-if" => "product.hasVariants"} = render partial: "shop/products/variants" - .variants.row{"bo-if" => "!hasVariants"} + .variants.row{"bo-if" => "!product.hasVariants"} = render partial: "shop/products/master" %product{"ng-show" => "Product.loading"} diff --git a/app/views/shop/products/_summary.html.haml b/app/views/shop/products/_summary.html.haml index b1cd7b0e78..bded87c50c 100644 --- a/app/views/shop/products/_summary.html.haml +++ b/app/views/shop/products/_summary.html.haml @@ -11,6 +11,6 @@ %producer-modal {{ enterprise.name }} .small-2.columns.summary-price.text-right.price - %span{"ng-if" => "hasVariants"} + %span{"ng-if" => "product.hasVariants"} %em from {{ product.price | currency }} From d43fa7eed54528efe2d19e0d553f21d744adaa1a Mon Sep 17 00:00:00 2001 From: summerscope Date: Fri, 11 Jul 2014 16:16:56 +1000 Subject: [PATCH 23/25] Fixing animations for shopfront --- .../stylesheets/darkswarm/animations.sass | 48 ++++++++++--------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/animations.sass b/app/assets/stylesheets/darkswarm/animations.sass index 27df090ebc..bf80c681a0 100644 --- a/app/assets/stylesheets/darkswarm/animations.sass +++ b/app/assets/stylesheets/darkswarm/animations.sass @@ -83,33 +83,37 @@ filter: alpha(opacity = 50) opacity: .5 + .animate-repeat - // line-height: 40px - list-style: none - box-sizing: border-box -.animate-repeat.ng-move, -.animate-repeat.ng-enter, -.animate-repeat.ng-leave - -webkit-transition: all linear 300ms - transition: all linear 300ms + &.ng-move, &.ng-enter, &.ng-leave + // -webkit-transition: border 0s + -webkit-transform: translateZ(0) + transform: translateZ(0) + -webkit-transition: all 300ms ease-in + // transition: border 0s + transition: all 300ms ease-in - -webkit-transition: border linear 500ms ease-in - transition : border 500ms ease-in + &.ng-leave + opacity: 1 + max-height: 1000px + border-color: transparent + &.ng-leave-active + opacity: 0 + max-height: 0px + border-color: transparent -.animate-repeat.ng-leave.ng-leave-active, -.animate-repeat.ng-move, -.animate-repeat.ng-enter - opacity: 0 - max-height: 0 - border-color: transparent + &.ng-enter + opacity: 0 + max-height: 0px + border-color: transparent + &.ng-enter-active + opacity: 1 + max-height: 1000px + border-color: transparent -.animate-repeat.ng-leave, -.animate-repeat.ng-move.ng-move-active, -.animate-repeat.ng-enter.ng-enter-active - opacity: 1 - max-height: inherit - border-color: inherit + &.ng-move + &.ng-move-active .animate-show From e940777ede78fd9ec19e9c7a2e16a909950a3c62 Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 16:33:23 +1000 Subject: [PATCH 24/25] Few more animation fixes --- .../stylesheets/darkswarm/animations.sass | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/animations.sass b/app/assets/stylesheets/darkswarm/animations.sass index bf80c681a0..944e2320ed 100644 --- a/app/assets/stylesheets/darkswarm/animations.sass +++ b/app/assets/stylesheets/darkswarm/animations.sass @@ -85,32 +85,32 @@ .animate-repeat - + border-color: rgba(153, 153, 153, 1) + -webkit-transform: translateZ(0) + transform: translateZ(0) &.ng-move, &.ng-enter, &.ng-leave // -webkit-transition: border 0s - -webkit-transform: translateZ(0) - transform: translateZ(0) - -webkit-transition: all 300ms ease-in + -webkit-transition: all 300ms linear // transition: border 0s - transition: all 300ms ease-in + transition: all 300ms linear &.ng-leave opacity: 1 - max-height: 1000px - border-color: transparent + border-color: rgba(153, 153, 153, 1) + max-height: 200px &.ng-leave-active opacity: 0 max-height: 0px - border-color: transparent + border-color: rgba(153, 153, 153, 0) &.ng-enter opacity: 0 + border-color: rgba(153, 153, 153, 0) max-height: 0px - border-color: transparent &.ng-enter-active + max-height: 200px opacity: 1 - max-height: 1000px - border-color: transparent + border-color: rgba(153, 153, 153, 1) &.ng-move &.ng-move-active From 06047a380ee0f2f543df69da3bf02f10d03c858c Mon Sep 17 00:00:00 2001 From: Will Marshall Date: Fri, 11 Jul 2014 16:40:44 +1000 Subject: [PATCH 25/25] Provisional animations --- app/assets/stylesheets/darkswarm/animations.sass | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/app/assets/stylesheets/darkswarm/animations.sass b/app/assets/stylesheets/darkswarm/animations.sass index 944e2320ed..d1952d1c4c 100644 --- a/app/assets/stylesheets/darkswarm/animations.sass +++ b/app/assets/stylesheets/darkswarm/animations.sass @@ -89,26 +89,24 @@ -webkit-transform: translateZ(0) transform: translateZ(0) &.ng-move, &.ng-enter, &.ng-leave - // -webkit-transition: border 0s - -webkit-transition: all 300ms linear - // transition: border 0s - transition: all 300ms linear + -webkit-transition: all 1s linear + transition: all 1s linear &.ng-leave opacity: 1 border-color: rgba(153, 153, 153, 1) - max-height: 200px + //max-height: 200px &.ng-leave-active opacity: 0 - max-height: 0px + //max-height: 0px border-color: rgba(153, 153, 153, 0) &.ng-enter opacity: 0 border-color: rgba(153, 153, 153, 0) - max-height: 0px + //max-height: 0px &.ng-enter-active - max-height: 200px + //max-height: 200px opacity: 1 border-color: rgba(153, 153, 153, 1)