mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-01 21:47:16 +00:00
OrderCycle can fetch the direction of an exchange (incoming/outgoing)
This commit is contained in:
@@ -21,6 +21,9 @@ angular.module('order_cycle', ['ngResource'])
|
||||
$scope.incomingExchangesVariants = ->
|
||||
OrderCycle.incomingExchangesVariants()
|
||||
|
||||
$scope.exchangeDirection = (exchange) ->
|
||||
OrderCycle.exchangeDirection(exchange)
|
||||
|
||||
$scope.participatingEnterprises = ->
|
||||
$scope.enterprises[id] for id in OrderCycle.participatingEnterpriseIds()
|
||||
|
||||
@@ -82,6 +85,9 @@ angular.module('order_cycle', ['ngResource'])
|
||||
$scope.incomingExchangesVariants = ->
|
||||
OrderCycle.incomingExchangesVariants()
|
||||
|
||||
$scope.exchangeDirection = (exchange) ->
|
||||
OrderCycle.exchangeDirection(exchange)
|
||||
|
||||
$scope.participatingEnterprises = ->
|
||||
$scope.enterprises[id] for id in OrderCycle.participatingEnterpriseIds()
|
||||
|
||||
@@ -141,6 +147,9 @@ angular.module('order_cycle', ['ngResource'])
|
||||
numActiveVariants++ for id, active of exchange.variants when active
|
||||
numActiveVariants
|
||||
|
||||
exchangeDirection: (exchange) ->
|
||||
if this.order_cycle.incoming_exchanges.indexOf(exchange) == -1 then 'outgoing' else 'incoming'
|
||||
|
||||
toggleProducts: (exchange) ->
|
||||
exchange.showProducts = !exchange.showProducts
|
||||
|
||||
|
||||
Reference in New Issue
Block a user