mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-26 05:55:15 +00:00
First cut at an interface for updating tag rules
This commit is contained in:
@@ -17,8 +17,9 @@ angular.module("admin.enterprises")
|
||||
{ name: t('shipping_methods'), icon_class: "icon-truck", show: "showShippingMethods()" }
|
||||
{ name: t('payment_methods'), icon_class: "icon-money", show: "showPaymentMethods()" }
|
||||
{ name: t('enterprise_fees'), icon_class: "icon-tasks", show: "showEnterpriseFees()" }
|
||||
{ name: t('inventory_settings'), icon_class: "icon-list-ol", show: "showInventorySettings()" }
|
||||
{ name: t('shop_preferences'), icon_class: "icon-shopping-cart", show: "showShopPreferences()" }
|
||||
{ name: t('inventory_settings'), icon_class: "icon-list-ol", show: "enterpriseIsShop()" }
|
||||
{ name: t('tag_rules'), icon_class: "icon-random", show: "enterpriseIsShop()" }
|
||||
{ name: t('shop_preferences'), icon_class: "icon-shopping-cart", show: "enterpriseIsShop()" }
|
||||
]
|
||||
|
||||
$scope.select(0)
|
||||
@@ -42,8 +43,5 @@ angular.module("admin.enterprises")
|
||||
$scope.showEnterpriseFees = ->
|
||||
enterprisePermissions.can_manage_enterprise_fees && ($scope.Enterprise.sells != "none" || $scope.Enterprise.is_primary_producer)
|
||||
|
||||
$scope.showInventorySettings = ->
|
||||
$scope.Enterprise.sells != "none"
|
||||
|
||||
$scope.showShopPreferences = ->
|
||||
$scope.enterpriseIsShop = ->
|
||||
$scope.Enterprise.sells != "none"
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
angular.module("admin.enterprises").controller "TagRulesCtrl", ($scope) ->
|
||||
$scope.groupedTagRules = $scope.Enterprise.tag_rules.reduce (groupedTagRules, rule) ->
|
||||
key = rule.preferred_customer_tags
|
||||
groupedTagRules[key] ||= []
|
||||
groupedTagRules[key].push rule
|
||||
groupedTagRules
|
||||
, {}
|
||||
@@ -0,0 +1,4 @@
|
||||
angular.module("admin.enterprises").directive "discountOrder", ->
|
||||
restrict: "E"
|
||||
replace: true
|
||||
templateUrl: "admin/tag_rules/discount_order.html"
|
||||
Reference in New Issue
Block a user