Move templates, improve inclusion.

This commit is contained in:
Alexis Lahouze 2017-06-10 22:06:36 +02:00
parent 12414a9dc7
commit 9eed69363f
8 changed files with 12 additions and 13 deletions

View File

@ -28,8 +28,7 @@ var ngResource = require('angular-resource'),
// Note: ngBootbox seems to have no module.exports. // Note: ngBootbox seems to have no module.exports.
ngBootbox = 'ngBootbox'; ngBootbox = 'ngBootbox';
// FIXME Alexis Lahouze 2017-06-06 move into templates.js. var accountFormTmpl = require('./account.form.tmpl.html');
require('../../views/account.form.tmpl.html');
var accountModule = angular.module('accountant.accounts', [ var accountModule = angular.module('accountant.accounts', [
ngResource, ngResource,
@ -240,7 +239,7 @@ var accountModule = angular.module('accountant.accounts', [
$ngBootbox.customDialog({ $ngBootbox.customDialog({
scope: scope, scope: scope,
title: title, title: title,
templateUrl: '/views/account.form.tmpl.html', templateUrl: accountFormTmpl,
onEscape: true, onEscape: true,
buttons: { buttons: {
save: { save: {

View File

@ -39,11 +39,11 @@ var accountModule = require('./accounts'),
require('bootstrap-webpack!./bootstrap.config.js'); require('bootstrap-webpack!./bootstrap.config.js');
require('../views/operations.html'); var operationsTmpl = require('./operations/operations.html');
require('../views/accounts.html'); var accountsTmpl = require('./accounts/accounts.html');
require('../views/scheduler.html'); var schedulerTmpl = require('./scheduler/scheduler.html');
require('../views/login.tmpl.html'); var loginTmpl = require('../views/login.tmpl.html');
var app = angular.module('accountant', [ var app = angular.module('accountant', [
accountModule.name, accountModule.name,
@ -83,17 +83,17 @@ var app = angular.module('accountant', [
// Defining template and controller in function of route. // Defining template and controller in function of route.
$routeProvider $routeProvider
.when('/account/:accountId/operations', { .when('/account/:accountId/operations', {
templateUrl: '/views/operations.html', templateUrl: operationsTmpl,
controller: 'OperationController', controller: 'OperationController',
controllerAs: 'operationsCtrl' controllerAs: 'operationsCtrl'
}) })
.when('/account/:accountId/scheduler', { .when('/account/:accountId/scheduler', {
templateUrl: '/views/scheduler.html', templateUrl: schedulerTmpl,
controller: 'SchedulerController', controller: 'SchedulerController',
controllerAs: 'schedulerCtrl' controllerAs: 'schedulerCtrl'
}) })
.when('/accounts', { .when('/accounts', {
templateUrl: '/views/accounts.html', templateUrl: accountsTmpl,
controller: 'AccountController', controller: 'AccountController',
controllerAs: 'accountsCtrl' controllerAs: 'accountsCtrl'
}) })
@ -153,7 +153,7 @@ var app = angular.module('accountant', [
$ngBootbox.customDialog({ $ngBootbox.customDialog({
title: 'Authentification requise', title: 'Authentification requise',
templateUrl: '/views/login.tmpl.html', templateUrl: loginTmpl,
buttons: { buttons: {
login: { login: {
label: 'Login', label: 'Login',

View File

@ -23,7 +23,7 @@ var moment = require('moment'),
var angular = require('angular'); var angular = require('angular');
require('../../views/operation.form.tmpl.html'); var operationFormTmpl = require('./operation.form.tmpl.html');
var ngResource = require('angular-resource'), var ngResource = require('angular-resource'),
ngMessages = require('angular-messages'), ngMessages = require('angular-messages'),
@ -531,7 +531,7 @@ var operationModule = angular.module('accountant.operations', [
$ngBootbox.customDialog({ $ngBootbox.customDialog({
scope: scope, scope: scope,
title: title, title: title,
templateUrl: '/views/operation.form.tmpl.html', templateUrl: operationFormTmpl,
onEscape: true, onEscape: true,
buttons: { buttons: {
save: { save: {