account selection via GET parameter
This commit is contained in:
@@ -33,8 +33,9 @@
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<!-- meta name="apple-mobile-web-app-capable" content="yes" -->
|
||||
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
||||
<link rel="icon" href="/apple-touch-icon.png">
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
@@ -16,7 +16,7 @@ function numberToAmount(number) {
|
||||
return amount;
|
||||
}
|
||||
|
||||
transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location', '$resource', '$q', '$uibModal', '$log', 'Transaction', function($scope, $location, $resource, $q, $uibModal, $log, Transaction) {
|
||||
transactionControllers.controller('TransactionListCtrl', [ '$scope', '$routeParams', '$resource', '$q', '$uibModal', '$log', 'Transaction', function($scope, $routeParams, $resource, $q, $uibModal, $log, Transaction) {
|
||||
|
||||
function refreshExpenses() {
|
||||
var accountUsers = $resource($scope.account._links.users.href).get();
|
||||
@@ -134,8 +134,15 @@ transactionControllers.controller('TransactionListCtrl', [ '$scope', '$location'
|
||||
var accountInfo = $resource('/accounts/search/findByUserName', { username: $scope.userid }).get();
|
||||
accountInfo.$promise.then(function(data) {
|
||||
$scope.accounts = accountInfo._embedded.accounts;
|
||||
if ($scope.account == undefined)
|
||||
if ($scope.account == undefined) {
|
||||
$scope.account = $scope.accounts[0];
|
||||
if ($routeParams.account != undefined) {
|
||||
for (i = 0; i < $scope.accounts.length; i++) {
|
||||
if ($scope.accounts[i].name == $routeParams.account)
|
||||
$scope.account = $scope.accounts[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var categories = $resource('/categories/search/listForAccount', { accountId: $scope.account.id }).get();
|
||||
categories.$promise.then(function(data) {
|
||||
|
||||
Reference in New Issue
Block a user