Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/shopfront-filters'
Browse files Browse the repository at this point in the history
  • Loading branch information
oeoeaio committed Dec 19, 2014
2 parents 170b14d + b944030 commit 6f95fa8
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ Darkswarm.controller "ProductsCtrl", ($scope, $rootScope, Products, OrderCycle,
$scope.clearAll = FilterSelectorsService.clearAll
$scope.filterText = FilterSelectorsService.filterText
$scope.FilterSelectorsService = FilterSelectorsService
$scope.filtersActive = true
$scope.limit = 3
$scope.order_cycle = OrderCycle.order_cycle

Expand Down
26 changes: 20 additions & 6 deletions app/assets/stylesheets/darkswarm/active_table_search.css.sass
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,36 @@
@import big-input
@import animations

// OVERRIDES
// Filter-box
.row .row.filter-box
margin-left: 0
margin-right: 0

.row.filter-box:first-child
.row.filter-box:first-child, .row.filter-box.filter-box-shopfront
border: 1px solid $clr-blue-light
@include border-radius(0.25em)
margin-top: 2px
@media all and (max-width: 640px)
margin-bottom: 1em

.row.filter-box:last-child
.row.filter-box.clear-filters
background: transparent
margin-top: 1em

.row.filter-box.filter-box-shopfront
margin-top: 0

products .filter-box
background: #f7f7f7


.filter-box
background: rgba(245,245,245,0.6)

.tdhead
padding: 0.25rem 0.5rem
margin-top: 0.9rem
color: $clr-blue
border-bottom: 1px solid $clr-blue-light
border-bottom: 1px solid $clr-blue-light

// OVERRIDES
[class*="block-grid-"]
Expand Down Expand Up @@ -89,7 +94,6 @@ products .filter-box
svg
path
fill: $clr-brick


render-svg
display: block
Expand All @@ -103,6 +107,16 @@ products .filter-box
path
fill: #666

.filter-box.filter-box-shopfront
.tdhead
margin-top: 0rem
margin-bottom: 0.75rem
padding: 0.5rem 0
h5
color: $clr-blue
.button.tiny
margin-bottom: 0rem

.button.filterbtn
margin-bottom: 0 !important
min-width: 160px
Expand Down
2 changes: 2 additions & 0 deletions app/views/producers/_filters.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@
%ul.small-block-grid-2.medium-block-grid-4.large-block-grid-6
%taxon-selector{objects: "Enterprises.producers | searchEnterprises:query ",
results: "activeTaxons"}
= render partial: 'shared/components/filter_box'
2 changes: 1 addition & 1 deletion app/views/shared/components/_filter_box.html.haml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.row.filter-box.animate-show{"ng-show" => "filtersActive && totalActive() > 0"}
.row.filter-box.clear-filters.animate-show{"ng-show" => "filtersActive && totalActive() > 0"}
.small-12.columns
%a.button.secondary.small.expand{"ng-click" => "clearAll()"}
%i.ofn-i_009-close
Expand Down
4 changes: 4 additions & 0 deletions app/views/shared/components/_filter_box_shopfront.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
%span.animate-show{"ng-show" => "filtersActive && totalActive() > 0"}
%a.button.secondary.tiny{"ng-click" => "clearAll()"}
%i.ofn-i_009-close
Clear all filters
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
%a.button.success.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
24 changes: 14 additions & 10 deletions app/views/shop/products/_filters.html.haml
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
.row
= render partial: 'shared/components/filter_controls'
.small-12.medium-6.columns.text-right
 
.row.animate-show{"ng-hide" => "filtersActive"}
.small-12.columns
= render partial: 'shared/components/filter_controls_shopfront'
.row.animate-show{"ng-show" => "filtersActive"}
.row.filter-box.filter-box-shopfront.animate-hide{"ng-show" => "filtersActive"}
.small-12.columns
.row.filter-box
.small-12.columns
%h5.tdhead
.row.tdhead
.small-12.medium-6.columns
%h5
.light Filter by
Type
Category
.small-12.medium-6.columns.text-right
= render partial: 'shared/components/filter_box_shopfront'
= render partial: 'shared/components/filter_controls_shopfront'
.row
.small-12.columns
%ul.small-block-grid-2.medium-block-grid-3.large-block-grid-4
%taxon-selector{objects: "Products.products | products:query | products:showProfiles",
results: "activeTaxons"}
= render partial: 'shared/components/filter_box'

0 comments on commit 6f95fa8

Please sign in to comment.