mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Refactoring filter feature for shopfront page - show by default, hide on click. WIP.
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
@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
|
||||
@@ -17,17 +17,20 @@
|
||||
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-"]
|
||||
@@ -89,7 +92,6 @@ products .filter-box
|
||||
svg
|
||||
path
|
||||
fill: $clr-brick
|
||||
|
||||
|
||||
render-svg
|
||||
display: block
|
||||
@@ -103,6 +105,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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -1,17 +1,20 @@
|
||||
.row
|
||||
= render partial: 'shared/components/filter_controls'
|
||||
.small-12.medium-6.columns.text-right
|
||||
|
||||
|
||||
.row.animate-show{"ng-show" => "filtersActive"}
|
||||
.small-12.columns
|
||||
.row.filter-box
|
||||
.small-12.columns
|
||||
%h5.tdhead
|
||||
= render partial: 'shared/components/filter_controls_shopfront'
|
||||
|
||||
.row.filter-box.filter-box-shopfront.animate-hide{"ng-hide" => "filtersActive"}
|
||||
.small-12.columns
|
||||
.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_controls_shopfront'
|
||||
= render partial: 'shared/components/filter_box_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'
|
||||
|
||||
Reference in New Issue
Block a user