diff --git a/app/assets/javascripts/controllers/admin/plans.coffee.erb b/app/assets/javascripts/controllers/admin/plans.coffee.erb index 8551fed4e..303c30575 100644 --- a/app/assets/javascripts/controllers/admin/plans.coffee.erb +++ b/app/assets/javascripts/controllers/admin/plans.coffee.erb @@ -234,7 +234,7 @@ Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'p ## # Retrieve the machine from its ID # @param machine_id {number} machine identifier - # @returns {object} Machine + # @returns {Object} Machine ## $scope.getMachine = (machine_id) -> for machine in $scope.machines @@ -244,14 +244,14 @@ Application.Controllers.controller 'EditPlanController', ['$scope', 'groups', 'p ## - # Retrieve the name of a space from its ID + # Retrieve the space from its ID # @param space_id {number} space identifier - # @returns {string} Space's name + # @returns {Object} Space ## - $scope.getSpaceName = (space_id) -> + $scope.getSpace = (space_id) -> for space in $scope.spaces if space.id == space_id - return space.name + return space diff --git a/app/assets/javascripts/controllers/admin/pricing.coffee.erb b/app/assets/javascripts/controllers/admin/pricing.coffee.erb index 578f131d5..73c7a158e 100644 --- a/app/assets/javascripts/controllers/admin/pricing.coffee.erb +++ b/app/assets/javascripts/controllers/admin/pricing.coffee.erb @@ -35,13 +35,14 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state", ## List of machines $scope.machines = machinesPromise - $scope.enabledMachines = machinesPromise.filter (t) -> !t.disabled + $scope.enabledMachines = machinesPromise.filter (m) -> !m.disabled ## List of coupons $scope.coupons = couponsPromise ## List of spaces $scope.spaces = spacesPromise + $scope.enabledSpaces = spacesPromise.filter (s) -> !s.disabled ## Associate free space hours with subscriptions $scope.spaceCredits = spacesCreditsPromise diff --git a/app/assets/templates/admin/plans/edit.html.erb b/app/assets/templates/admin/plans/edit.html.erb index 4b6bd7791..509b4c626 100644 --- a/app/assets/templates/admin/plans/edit.html.erb +++ b/app/assets/templates/admin/plans/edit.html.erb @@ -83,8 +83,8 @@
-