When viewing enterprise fees, only show those for the enterprise I select

This commit is contained in:
Rohan Mitchell
2013-10-18 14:44:01 +11:00
parent 91f14dcd4c
commit ea17e475a6
4 changed files with 39 additions and 6 deletions

View File

@@ -1,6 +1,17 @@
angular.module('enterprise_fees', [])
.controller('AdminEnterpriseFeesCtrl', ['$scope', '$http', function($scope, $http) {
$http.get('/admin/enterprise_fees.json?include_calculators=1').success(function(data) {
.controller('AdminEnterpriseFeesCtrl', ['$scope', '$http', '$window', function($scope, $http, $window) {
$scope.enterpriseFeesUrl = function() {
var url = '/admin/enterprise_fees.json?include_calculators=1';
var match = $window.location.search.match(/enterprise_id=(\d+)/);
if(match) {
url += "&"+match[0];
}
return url;
};
$http.get($scope.enterpriseFeesUrl()).success(function(data) {
$scope.enterprise_fees = data;
for(i=0; i<3; i++) {