72 lines
2.3 KiB
JavaScript
72 lines
2.3 KiB
JavaScript
// vim: set tw=80 ts=4 sw=4 sts=4:
|
|
/*
|
|
This file is part of Accountant.
|
|
|
|
Accountant is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU Affero General Public License as published by
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Accountant is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU Affero General Public License for more details.
|
|
|
|
You should have received a copy of the GNU Affero General Public License
|
|
along with Accountant. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
/* jshint node: true */
|
|
'use strict';
|
|
|
|
var angular = require('angular');
|
|
|
|
var ngRoute = require('angular-route');
|
|
|
|
var accountModule = require('./accounts'),
|
|
loginModule = require('./login'),
|
|
operationModule = require('./operations'),
|
|
schedulerModule = require('./scheduler');
|
|
|
|
require('bootstrap-webpack!./bootstrap.config.js');
|
|
|
|
var operationsTmpl = require('./operations/operations.html');
|
|
var accountsTmpl = require('./accounts/accounts.html');
|
|
var schedulerTmpl = require('./scheduler/scheduler.html');
|
|
|
|
var app = angular.module('accountant', [
|
|
accountModule.name,
|
|
loginModule.name,
|
|
operationModule.name,
|
|
schedulerModule.name,
|
|
ngRoute,
|
|
])
|
|
|
|
.config(function($routeProvider) {
|
|
// Defining template and controller in function of route.
|
|
$routeProvider
|
|
.when('/account/:accountId/operations', {
|
|
templateUrl: operationsTmpl,
|
|
controller: 'OperationController',
|
|
controllerAs: 'operationsCtrl'
|
|
})
|
|
.when('/account/:accountId/scheduler', {
|
|
templateUrl: schedulerTmpl,
|
|
controller: 'SchedulerController',
|
|
controllerAs: 'schedulerCtrl'
|
|
})
|
|
.when('/accounts', {
|
|
templateUrl: accountsTmpl,
|
|
controller: 'AccountController',
|
|
controllerAs: 'accountsCtrl'
|
|
})
|
|
.otherwise({
|
|
redirectTo: '/accounts'
|
|
});
|
|
})
|
|
|
|
.run(function(editableOptions) {
|
|
editableOptions.theme = 'bs3'; // bootstrap3 theme. Can be also 'bs2', 'default'
|
|
});
|
|
|
|
module.exports = app;
|