mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-04 02:31:33 +00:00
Replace darker-background angular directive
This commit is contained in:
committed by
Filipe
parent
7e9c5ea58b
commit
23c9410a25
@@ -1,11 +0,0 @@
|
||||
angular.module('Darkswarm').directive "darkerBackground", ->
|
||||
restrict: "A"
|
||||
link: (scope, elm, attr)->
|
||||
toggleClass = (value) ->
|
||||
elm.closest('.page-view').toggleClass("with-darker-background", value)
|
||||
|
||||
toggleClass(true)
|
||||
|
||||
# if an OrderCycle is selected, disable darker background
|
||||
scope.$watch 'order_cycle.order_cycle_id', (newvalue, oldvalue) ->
|
||||
toggleClass(false) if newvalue
|
||||
@@ -62,6 +62,12 @@ module ShopHelper
|
||||
true
|
||||
end
|
||||
|
||||
def shop_tab_class(tab)
|
||||
return unless (tab == "home" && show_home_tab?) || current_order(false)&.order_cycle.nil?
|
||||
|
||||
"with-darker-background"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def show_groups_tabs?
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.closed-shop-header
|
||||
.row
|
||||
.small-12.columns
|
||||
.content{ "darker-background" => true }
|
||||
.content
|
||||
%h4
|
||||
.warning-sign
|
||||
.rectangle
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.content{ "darker-background" => true }
|
||||
.content
|
||||
.row.footer-pad
|
||||
.small-12.columns{ "data-controller": "login-modal" }
|
||||
%strong
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
.content.footer-pad{ "darker-background" => true, "ng-show" => "order_cycle.order_cycle_id == null" }
|
||||
.content.footer-pad{ "ng-show" => "order_cycle.order_cycle_id == null" }
|
||||
.row
|
||||
.small-12.columns
|
||||
.select-oc-message
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
.columns.large-4.show-for-large-up
|
||||
= render partial: "shopping_shared/order_cycles"
|
||||
- shop_tabs.each do |tab|
|
||||
%div{id: "#{tab[:name]}_panel", "data-tabs-and-panels-target": "panel #{'default' if tab[:default]} #{'shop' if tab[:shop]}" }
|
||||
.page-view
|
||||
%div{id: "#{tab[:name]}_panel", "data-tabs-and-panels-target": "panel #{'default' if tab[:default]} #{'shop' if tab[:shop]}" }
|
||||
.page-view{ class: shop_tab_class(tab[:name]) }
|
||||
- if tab[:custom]
|
||||
= render "shopping_shared/tabs/custom"
|
||||
- else
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
.darkswarm {
|
||||
products {
|
||||
background-color: white;
|
||||
|
||||
product {
|
||||
@import "shop_partials/shop-product-rows";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user