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 }}"
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>
<a href="#/account/{{ account.id }}/operations">{{ account.name }}</a>
</td>
<td>
<span ng-class="valueClass(account, account.solds.current)">
<span ng-class="accountsCtrl.valueClass(account, account.solds.current)">
{{ account.solds.current | currency : "€" }}
</span>
</td>
<td>
<span ng-class="valueClass(account, account.solds.pointed)">
<span ng-class="accountsCtrl.valueClass(account, account.solds.pointed)">
{{ account.solds.pointed | currency : "€" }}
</span>
</td>
@ -63,19 +63,19 @@
<div class="btn-group btn-group-xs">
<!-- Edit account. -->
<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>
</button>
<!-- Cancel account edition. -->
<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>
</button>
<!-- Delete account, with confirm. -->
<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>
</button>

View File

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

View File

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