Fix controller names in views.

This commit is contained in:
Alexis Lahouze 2016-10-14 08:52:10 +02:00
parent bff2d826dc
commit e39d2813df
3 changed files with 26 additions and 23 deletions

View File

@ -38,19 +38,19 @@
<tr id="{{ account.id }}" <tr id="{{ account.id }}"
class="form-inline" ng-class="rowClass(account)" class="form-inline" ng-class="rowClass(account)"
ng-repeat="account in accounts | orderBy:'name'" ng-init="account.getSolds()"> ng-repeat="account in accountsCtrl.accounts | orderBy:'name'" ng-init="account.getSolds()">
<td> <td>
<a href="#/account/{{ account.id }}/operations">{{ account.name }}</a> <a href="#/account/{{ account.id }}/operations">{{ account.name }}</a>
</td> </td>
<td> <td>
<span ng-class="valueClass(account, account.solds.current)"> <span ng-class="accountsCtrl.valueClass(account, account.solds.current)">
{{ account.solds.current | currency : "€" }} {{ account.solds.current | currency : "€" }}
</span> </span>
</td> </td>
<td> <td>
<span ng-class="valueClass(account, account.solds.pointed)"> <span ng-class="accountsCtrl.valueClass(account, account.solds.pointed)">
{{ account.solds.pointed | currency : "€" }} {{ account.solds.pointed | currency : "€" }}
</span> </span>
</td> </td>
@ -63,19 +63,19 @@
<div class="btn-group btn-group-xs"> <div class="btn-group btn-group-xs">
<!-- Edit account. --> <!-- Edit account. -->
<button type="button" class="btn btn-success" <button type="button" class="btn btn-success"
account-form-dialog ng-model="account"> account-form-dialog ng-model="accountsCtrl.account">
<span class="fa fa-pencil-square-o"></span> <span class="fa fa-pencil-square-o"></span>
</button> </button>
<!-- Cancel account edition. --> <!-- Cancel account edition. -->
<button type="button" class="btn btn-default" <button type="button" class="btn btn-default"
ng-click="cancelEdit(rowform, account, $index)"> ng-click="accountsCtrl.cancelEdit(rowform, account, $index)">
<span class="fa fa-times"></span> <span class="fa fa-times"></span>
</button> </button>
<!-- Delete account, with confirm. --> <!-- Delete account, with confirm. -->
<button type="button" class="btn btn-default" <button type="button" class="btn btn-default"
ng-click="delete(account, $index)"> ng-click="accountsCtrl.delete(account, $index)">
<span class="fa fa-trash-o"></span> <span class="fa fa-trash-o"></span>
</button> </button>

View File

@ -14,18 +14,19 @@
You should have received a copy of the GNU Affero General Public License You should have received a copy of the GNU Affero General Public License
along with Accountant. If not, see <http://www.gnu.org/licenses/>. along with Accountant. If not, see <http://www.gnu.org/licenses/>.
--> -->
<!-- vim: set tw=80 ts=2 sw=2 sts=2: -->
<div> <div>
<!-- Chart row --> <!-- Chart row -->
<div class="row"> <div class="row">
<!-- Sold evolution chart placeholder --> <!-- Sold evolution chart placeholder -->
<div class="col-md-8" ng-controller="SoldChartController"> <div class="col-md-8"
<highchart id="sold-chart" config="config"></highchart> ng-controller="SoldChartController as soldChartCtrl">
<highchart id="sold-chart" config="soldChartCtrl.config"></highchart>
</div> </div>
<!-- Category piechart --> <!-- Category piechart -->
<div class="col-md-4" ng-controller="CategoryChartController"> <div class="col-md-4"
<highchart id="categories-chart" config="config"></highchart> ng-controller="CategoryChartController as categoryChartCtrl">
<highchart id="categories-chart" config="categoryChartCtrl.config"></highchart>
</div> </div>
</div> </div>
@ -45,15 +46,16 @@
<tbody> <tbody>
<tr> <tr>
<td colspan="6"> <td colspan="6">
<button class="btn btn-success" ng-click="add()"> <button class="btn btn-success" ng-click="operationsCtrl.add()">
Ajouter Ajouter
</button> </button>
</td> </td>
</tr> </tr>
<tr id="{{ operation.id }}" class="form-inline" <tr id="{{ operation.id }}" class="form-inline"
ng-class="{stroke: operation.canceled, italic: !operation.confirmed, warning: operation.sold < 0, danger: operation.sold < account.authorized_overdraft}" ng-class="{stroke: operation.canceled, italic: !operation.confirmed,
ng-repeat="operation in operations | orderBy:['-operation_date', '-value', 'label']"> warning: operation.sold < 0, danger: operation.sold < operationsCtrl.account.authorized_overdraft}"
ng-repeat="operation in operationsCtrl.operations | orderBy:['-operation_date', '-value', 'label']">
<td> <td>
{{ operation.operation_date | date:"yyyy-MM-dd" }} {{ operation.operation_date | date:"yyyy-MM-dd" }}
</td> </td>
@ -66,7 +68,8 @@
{{ operation.value | currency:"€" }} {{ operation.value | currency:"€" }}
</td> </td>
<td ng-class="{'text-warning': operation.sold < 0, 'text-danger': operation.sold < account.authorized_overdraft}"> <td ng-class="{'text-warning': operation.sold < 0, 'text-danger':
operation.sold < operationsCtrl.account.authorized_overdraft}">
{{ operation.sold | currency:"€" }} {{ operation.sold | currency:"€" }}
</td> </td>
@ -86,14 +89,14 @@
<!-- Toggle pointed operation, for non-canceled operations. --> <!-- Toggle pointed operation, for non-canceled operations. -->
<button type="button" class="btn btn-default" <button type="button" class="btn btn-default"
ng-if="!operation.canceled" ng-if="!operation.canceled"
ng-click="togglePointed(operation, rowform)" ng-click="operationsCtrl.togglePointed(operation, rowform)"
ng-class="{active: operation.pointed}" title="point"> ng-class="{active: operation.pointed}" title="point">
<span ng-class="{'fa fa-check-square-o': operation.pointed, 'fa fa-square-o': !operation.pointed}"></span> <span ng-class="{'fa fa-check-square-o': operation.pointed, 'fa fa-square-o': !operation.pointed}"></span>
</button> </button>
<!-- Toggle canceled operation. --> <!-- Toggle canceled operation. -->
<button type="button" class="btn btn-default" <button type="button" class="btn btn-default"
ng-click="toggleCanceled(operation)" ng-click="operationsCtrl.toggleCanceled(operation)"
ng-if="operation.scheduled_operation_id && !rowform.$visible" ng-if="operation.scheduled_operation_id && !rowform.$visible"
ng-class="{active: operation.canceled}" title="cancel"> ng-class="{active: operation.canceled}" title="cancel">
<span class="fa fa-remove"></span> <span class="fa fa-remove"></span>
@ -102,7 +105,7 @@
<!-- Delete operation, with confirm. --> <!-- Delete operation, with confirm. -->
<button type="button" class="btn btn-default" <button type="button" class="btn btn-default"
ng-if="operation.id && !operation.scheduled_operation_id" ng-if="operation.id && !operation.scheduled_operation_id"
ng-click="delete(operation, $index)"> ng-click="operationsCtrl.delete(operation, $index)">
<span class="fa fa-trash-o"></span> <span class="fa fa-trash-o"></span>
</button> </button>
</div> </div>

View File

@ -33,14 +33,14 @@
<tbody> <tbody>
<tr> <tr>
<td colspan="8"> <td colspan="8">
<button class="btn btn-success" ng-click="add()"> <button class="btn btn-success" ng-click="schedulerCtrl.add()">
Ajouter Ajouter
</button> </button>
</td> </td>
</tr> </tr>
<tr id="{{ operation.id }}" class="form-inline" <tr id="{{ operation.id }}" class="form-inline"
ng-repeat="operation in operations"> ng-repeat="operation in schedulerCtrl.operations">
<td class="col-md-1"> <td class="col-md-1">
<span editable-text="operation.start_date" <span editable-text="operation.start_date"
e-style="width: 100%" e-style="width: 100%"
@ -102,7 +102,7 @@
<td> <td>
<form editable-form name="rowform" <form editable-form name="rowform"
onbeforesave="save($data, $index)" onbeforesave="schedulerCtrl.save($data, $index)"
shown="!operation.id"> shown="!operation.id">
<div class="btn-group btn-group-xs"> <div class="btn-group btn-group-xs">
<!-- Save current operation --> <!-- Save current operation -->
@ -121,7 +121,7 @@
<!-- Cancel edit. --> <!-- Cancel edit. -->
<button type="button" class="btn btn-default" <button type="button" class="btn btn-default"
ng-if="rowform.$visible" ng-if="rowform.$visible"
ng-click="cancelEdit(operation, rowform, $index)" ng-click="schedulerCtrl.cancelEdit(operation, rowform, $index)"
title="Cancel"> title="Cancel">
<span class="fa fa-times"></span> <span class="fa fa-times"></span>
</button> </button>
@ -129,7 +129,7 @@
<!-- Remove operation. --> <!-- Remove operation. -->
<button type="button" class="btn btn-default" <button type="button" class="btn btn-default"
ng-if="operation.id" ng-if="operation.id"
ng-click="delete(operation, $index)" ng-click="schedulerCtrl.delete(operation, $index)"
title="remove"> title="remove">
<span class="fa fa-trash"></span> <span class="fa fa-trash"></span>
</button> </button>