mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
18 lines
593 B
CoffeeScript
18 lines
593 B
CoffeeScript
angular.module("admin.customers").controller "customersCtrl", ($scope, Customers, Columns, pendingChanges, shops) ->
|
|
$scope.shop = null
|
|
$scope.shops = shops
|
|
$scope.submitAll = pendingChanges.submitAll
|
|
|
|
$scope.columns = Columns.setColumns
|
|
email: { name: "Email", visible: true }
|
|
code: { name: "Code", visible: true }
|
|
tags: { name: "Tags", visible: true }
|
|
|
|
$scope.$watch "shop", ->
|
|
if $scope.shop?
|
|
Customers.loaded = false
|
|
$scope.customers = Customers.index(enterprise_id: $scope.shop.id)
|
|
|
|
$scope.loaded = ->
|
|
Customers.loaded
|