diff --git a/app/assets/javascripts/controllers/admin/pricing.coffee.erb b/app/assets/javascripts/controllers/admin/pricing.coffee.erb
index 8144075bd..35b69d1c9 100644
--- a/app/assets/javascripts/controllers/admin/pricing.coffee.erb
+++ b/app/assets/javascripts/controllers/admin/pricing.coffee.erb
@@ -3,8 +3,8 @@
##
# Controller used in the prices edition page
##
-Application.Controllers.controller "EditPricingController", ["$scope", "$state", '$uibModal', '$filter', 'TrainingsPricing', 'Credit', 'Pricing', 'Plan', 'Coupon', 'plans', 'groups', 'growl', 'machinesPricesPromise', 'Price', 'dialogs', 'trainingsPricingsPromise', 'trainingsPromise', 'machineCreditsPromise', 'machinesPromise', 'trainingCreditsPromise', 'couponsPromise', '_t'
-, ($scope, $state, $uibModal, $filter, TrainingsPricing, Credit, Pricing, Plan, Coupon, plans, groups, growl, machinesPricesPromise, Price, dialogs, trainingsPricingsPromise, trainingsPromise, machineCreditsPromise, machinesPromise, trainingCreditsPromise, couponsPromise, _t) ->
+Application.Controllers.controller "EditPricingController", ["$scope", "$state", '$uibModal', '$filter', 'TrainingsPricing', 'Credit', 'Pricing', 'Plan', 'Coupon', 'plans', 'groups', 'growl', 'machinesPricesPromise', 'Price', 'dialogs', 'trainingsPricingsPromise', 'trainingsPromise', 'machineCreditsPromise', 'machinesPromise', 'trainingCreditsPromise', 'couponsPromise', 'spacesPromise', 'spacesPricesPromise', '_t'
+, ($scope, $state, $uibModal, $filter, TrainingsPricing, Credit, Pricing, Plan, Coupon, plans, groups, growl, machinesPricesPromise, Price, dialogs, trainingsPricingsPromise, trainingsPromise, machineCreditsPromise, machinesPromise, trainingCreditsPromise, couponsPromise, spacesPromise, spacesPricesPromise, _t) ->
### PUBLIC SCOPE ###
## List of machines prices (not considering any plan)
@@ -37,6 +37,12 @@ Application.Controllers.controller "EditPricingController", ["$scope", "$state",
## List of coupons
$scope.coupons = couponsPromise
+ ## List of spaces
+ $scope.spaces = spacesPromise
+
+ ## List of spaces prices (not considering any plan)
+ $scope.spacesPrices = spacesPricesPromise
+
## The plans list ordering. Default: by group
$scope.orderPlans = 'group_id'
diff --git a/app/assets/javascripts/router.coffee.erb b/app/assets/javascripts/router.coffee.erb
index a7426eb8c..197a60fdc 100644
--- a/app/assets/javascripts/router.coffee.erb
+++ b/app/assets/javascripts/router.coffee.erb
@@ -824,6 +824,12 @@ angular.module('application.router', ['ui.router']).
couponsPromise: ['Coupon', (Coupon) ->
Coupon.query().$promise
]
+ spacesPromise: ['Space', (Space) ->
+ Space.query().$promise
+ ]
+ spacesPricesPromise: ['Price', (Price)->
+ Price.query(priceable_type: 'Space', plan_id: 'null').$promise
+ ]
# plans
.state 'app.admin.plans',
diff --git a/app/assets/templates/admin/pricing/index.html.erb b/app/assets/templates/admin/pricing/index.html.erb
index bad193f0f..aa90fd967 100644
--- a/app/assets/templates/admin/pricing/index.html.erb
+++ b/app/assets/templates/admin/pricing/index.html.erb
@@ -33,6 +33,10 @@
{{ 'pricing.spaces' }} | ++ {{group.name}} + | +
---|---|
+ {{ space.name }} + | ++ + {{ findPriceBy(spacesPrices, space.id, group.id).amount | currency}} + + | +