Cleanup account frontend.
This commit is contained in:
parent
0b0ca57042
commit
e18009b0dd
@ -29,8 +29,8 @@ accountantApp
|
|||||||
|
|
||||||
.controller(
|
.controller(
|
||||||
"AccountController", [
|
"AccountController", [
|
||||||
"$scope", "$rootScope", "$window", "$routeParams", "Accounts",
|
"$scope", "$rootScope", "$routeParams", "Accounts",
|
||||||
function($scope, $rootScope, $window, $routeParams, Accounts) {
|
function($scope, $rootScope, $routeParams, Accounts) {
|
||||||
|
|
||||||
$scope.accountClass = function(account) {
|
$scope.accountClass = function(account) {
|
||||||
if(account == $scope.selectedAccount) {
|
if(account == $scope.selectedAccount) {
|
||||||
@ -56,7 +56,7 @@ accountantApp
|
|||||||
$scope.createAccount = function(account) {
|
$scope.createAccount = function(account) {
|
||||||
account.$save(function(account) {
|
account.$save(function(account) {
|
||||||
// Reset new account.
|
// Reset new account.
|
||||||
$scope.resetAccount(account);
|
$scope.cancelEditAccount(account);
|
||||||
|
|
||||||
$scope.$emit("accountCreatedEvent", account);
|
$scope.$emit("accountCreatedEvent", account);
|
||||||
});
|
});
|
||||||
@ -84,7 +84,7 @@ accountantApp
|
|||||||
* Start account edition.
|
* Start account edition.
|
||||||
*/
|
*/
|
||||||
$scope.editAccount = function(account) {
|
$scope.editAccount = function(account) {
|
||||||
account.editing = true;
|
account.edit = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr id="account_[[account.id]]" class="form-inline" ng-repeat="account in accounts">
|
<tr id="account_[[account.id]]" class="form-inline" ng-if="!account.edit" ng-repeat-start="account in accounts">
|
||||||
<td><a href="account/[[ account.id ]]/entries">[[ account.name ]]</a></td>
|
<td><a href="account/[[ account.id ]]/entries">[[ account.name ]]</a></td>
|
||||||
<td>[[ account.current ]]</td>
|
<td>[[ account.current ]]</td>
|
||||||
<td>[[ account.pointed ]]</td>
|
<td>[[ account.pointed ]]</td>
|
||||||
@ -84,6 +84,34 @@
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr id="account_[[account.id]]" class="form-inline" ng-if="account.edit" ng-repeat-end>
|
||||||
|
<td>
|
||||||
|
<input type="text" class="form-control" ng-model="account.name" />
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>[[ account.current ]]</td>
|
||||||
|
<td>[[ account.pointed ]]</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<input type="text" class="form-control"
|
||||||
|
ng-model="account.authorized_overdraft" />
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<td>
|
||||||
|
<div class="btn-group">
|
||||||
|
<button class="btn btn-xs btn-success"
|
||||||
|
ng-click="saveAccount(account)">
|
||||||
|
<span class="fa fa-floppy-o"></span>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button class="btn btn-xs btn-default"
|
||||||
|
ng-click="cancelEditAccount(account)">
|
||||||
|
<span class="fa fa-times"></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user