Skip to content

Commit 176d331

Browse files
committed
Beautified client/app
1 parent 1075352 commit 176d331

77 files changed

Lines changed: 1499 additions & 1254 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

client/app/js/app.js

Lines changed: 62 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,51 +8,71 @@
88
* Main module of the application.
99
*/
1010
angular.module('loopbackApp', [
11-
'angular-loading-bar',
12-
'angular.filter',
13-
'angularBootstrapNavTree',
14-
'angularFileUpload',
15-
'btford.markdown',
16-
'oitozero.ngSweetAlert',
17-
'config',
18-
'formly',
19-
'lbServices',
20-
'monospaced.elastic',
21-
'ngAnimate',
22-
'ngCookies',
23-
'ngResource',
24-
'ngRoute',
25-
'ngSanitize',
26-
'ngTouch',
27-
'ui.bootstrap',
28-
'ui.codemirror',
29-
'ui.gravatar',
30-
'ui.grid',
31-
'ui.router',
32-
'toasty',
33-
'autofields',
34-
'gettext',
35-
'com.module.core',
36-
'com.module.about',
37-
'com.module.events',
38-
'com.module.files',
39-
'com.module.notes',
40-
'com.module.pages',
41-
'com.module.posts',
42-
'com.module.products',
43-
'com.module.sandbox',
44-
'com.module.settings',
45-
'com.module.users'
46-
])
47-
.run(function ($rootScope, $cookies, gettextCatalog) {
11+
'angular-loading-bar',
12+
'angular.filter',
13+
'angularBootstrapNavTree',
14+
'angularFileUpload',
15+
'btford.markdown',
16+
'oitozero.ngSweetAlert',
17+
'config',
18+
'formly',
19+
'lbServices',
20+
'monospaced.elastic',
21+
'ngAnimate',
22+
'ngCookies',
23+
'ngResource',
24+
'ngRoute',
25+
'ngSanitize',
26+
'ngTouch',
27+
'ui.bootstrap',
28+
'ui.codemirror',
29+
'ui.gravatar',
30+
'ui.grid',
31+
'ui.router',
32+
'toasty',
33+
'autofields',
34+
'gettext',
35+
'com.module.core',
36+
'com.module.about',
37+
'com.module.events',
38+
'com.module.files',
39+
'com.module.notes',
40+
'com.module.pages',
41+
'com.module.posts',
42+
'com.module.products',
43+
'com.module.sandbox',
44+
'com.module.settings',
45+
'com.module.users'
46+
])
47+
.run(function($rootScope, $cookies, gettextCatalog) {
4848

4949
$rootScope.locales = {
5050

51-
'en': {lang: 'en', country: 'US', name: gettextCatalog.getString('English')},
52-
'pt-BR': {lang: 'pt_BR', country: 'BR', name: gettextCatalog.getString('Portuguese Brazil')},
53-
'nl': {lang: 'nl', country: 'NL', name: gettextCatalog.getString('Dutch')},
54-
'de': {lang: 'de', country: 'DE', name: gettextCatalog.getString('German')},
55-
'fr': {lang: 'fr', country: 'FR', name: gettextCatalog.getString('Français')}
51+
'en': {
52+
lang: 'en',
53+
country: 'US',
54+
name: gettextCatalog.getString('English')
55+
},
56+
'pt-BR': {
57+
lang: 'pt_BR',
58+
country: 'BR',
59+
name: gettextCatalog.getString('Portuguese Brazil')
60+
},
61+
'nl': {
62+
lang: 'nl',
63+
country: 'NL',
64+
name: gettextCatalog.getString('Dutch')
65+
},
66+
'de': {
67+
lang: 'de',
68+
country: 'DE',
69+
name: gettextCatalog.getString('German')
70+
},
71+
'fr': {
72+
lang: 'fr',
73+
country: 'FR',
74+
name: gettextCatalog.getString('Français')
75+
}
5676
}
5777

5878
var lang = $cookies.lang || navigator.language || navigator.userLanguage;

client/app/modules/about/app.about.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
* the models exposed by the LoopBack server via the REST API.
1111
*
1212
*/
13-
angular.module ('com.module.about',[]);
13+
angular.module('com.module.about', []);
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
'use strict';
22
angular.module('com.module.about')
3-
.run(function ($rootScope, gettextCatalog) {
3+
.run(function($rootScope, gettextCatalog) {
44

5-
$rootScope.addDashboardBox(gettextCatalog.getString('About'), 'bg-maroon', 'ion-information', 0, 'app.about.index');
5+
$rootScope.addDashboardBox(gettextCatalog.getString('About'), 'bg-maroon',
6+
'ion-information', 0, 'app.about.index');
67

78
});
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict';
22
angular.module('com.module.about')
3-
/**
4-
* @ngdoc function
5-
* @name com.module.about.controller:AboutCtrl
6-
* @description
7-
* # AboutCtrl
8-
* Controller of the clientApp
9-
*/
10-
.controller('AboutCtrl', function ($scope) {
3+
/**
4+
* @ngdoc function
5+
* @name com.module.about.controller:AboutCtrl
6+
* @description
7+
* # AboutCtrl
8+
* Controller of the clientApp
9+
*/
10+
.controller('AboutCtrl', function($scope) {
1111
$scope.angular = angular;
1212
});
Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
'use strict';
22
angular.module('com.module.about')
3-
.config(function ($stateProvider) {
4-
$stateProvider
5-
.state('app.about', {
6-
abstract: true,
7-
url: '/about',
8-
templateUrl: 'modules/about/views/main.html'
9-
})
10-
.state('app.about.index', {
11-
url: '',
12-
templateUrl: 'modules/about/views/about.html',
13-
controller: 'AboutCtrl'
3+
.config(function($stateProvider) {
4+
$stateProvider
5+
.state('app.about', {
6+
abstract: true,
7+
url: '/about',
8+
templateUrl: 'modules/about/views/main.html'
9+
})
10+
.state('app.about.index', {
11+
url: '',
12+
templateUrl: 'modules/about/views/about.html',
13+
controller: 'AboutCtrl'
14+
});
1415
});
15-
});

client/app/modules/core/app.core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
* the models exposed by the LoopBack server via the REST API.
1111
*
1212
*/
13-
angular.module ('com.module.core',['gettext']);
13+
angular.module('com.module.core', ['gettext']);

client/app/modules/core/config/core.config.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict';
22
var app = angular.module('com.module.core');
3-
app.run(function ($rootScope, Setting, gettextCatalog) {
3+
app.run(function($rootScope, Setting, gettextCatalog) {
44

55
// Left Sidemenu
66
$rootScope.menu = [];
77

88
// Add Sidebar Menu
9-
$rootScope.addMenu = function (name, uisref, icon) {
9+
$rootScope.addMenu = function(name, uisref, icon) {
1010
$rootScope.menu.push({
1111
name: name,
1212
sref: uisref,
@@ -15,13 +15,14 @@ app.run(function ($rootScope, Setting, gettextCatalog) {
1515
};
1616

1717
// Add Menu Dashboard
18-
$rootScope.addMenu(gettextCatalog.getString('Dashboard'), 'app.home', 'fa-dashboard');
18+
$rootScope.addMenu(gettextCatalog.getString('Dashboard'), 'app.home',
19+
'fa-dashboard');
1920

2021
// Dashboard
2122
$rootScope.dashboardBox = [];
2223

2324
// Add Dashboard Box
24-
$rootScope.addDashboardBox = function (name, color, icon, quantity, href) {
25+
$rootScope.addDashboardBox = function(name, color, icon, quantity, href) {
2526
$rootScope.dashboardBox.push({
2627
name: name,
2728
color: color,
@@ -32,15 +33,15 @@ app.run(function ($rootScope, Setting, gettextCatalog) {
3233
};
3334

3435
// Get Settings for Database
35-
$rootScope.setSetting = function (key, value) {
36+
$rootScope.setSetting = function(key, value) {
3637

3738
Setting.find({
3839
filter: {
3940
where: {
4041
key: key
4142
}
4243
}
43-
}, function (data) {
44+
}, function(data) {
4445

4546
if (data.length) {
4647
data[0].value = value;
@@ -49,7 +50,7 @@ app.run(function ($rootScope, Setting, gettextCatalog) {
4950
Setting.create({
5051
key: key,
5152
value: value
52-
}, function (data) {
53+
}, function(data) {
5354
console.log(data);
5455
});
5556
}
@@ -61,15 +62,15 @@ app.run(function ($rootScope, Setting, gettextCatalog) {
6162
$rootScope.settings = {};
6263

6364
// Get Settings for Loopback Service
64-
$rootScope.loadSettings = function () {
65-
Setting.find(function (settings) {
65+
$rootScope.loadSettings = function() {
66+
Setting.find(function(settings) {
6667
$rootScope.settings.data = settings;
6768
});
6869
};
6970

7071
});
7172

72-
app.config(function (formlyConfigProvider) {
73+
app.config(function(formlyConfigProvider) {
7374
var templates = 'modules/core/views/elements/fields/';
7475
var formly = templates + 'formly-field-';
7576
var fields = [
@@ -84,7 +85,7 @@ app.config(function (formlyConfigProvider) {
8485
'textarea'
8586
];
8687

87-
angular.forEach(fields, function (val) {
88+
angular.forEach(fields, function(val) {
8889
formlyConfigProvider.setTemplateUrl(val, formly + val + '.html');
8990
});
9091

@@ -93,6 +94,6 @@ app.config(function (formlyConfigProvider) {
9394

9495
});
9596

96-
app.config(['cfpLoadingBarProvider', function (cfpLoadingBarProvider) {
97+
app.config(['cfpLoadingBarProvider', function(cfpLoadingBarProvider) {
9798
cfpLoadingBarProvider.includeSpinner = false;
9899
}]);
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
'use strict';
2-
angular.module ('com.module.core')
3-
.config (function ($stateProvider, $urlRouterProvider) {
4-
$stateProvider
5-
.state ('router', {
6-
url: '/router',
7-
template: '<div class="lockscreen" style="height: 100%"></div>',
8-
controller: 'RouteCtrl'
9-
})
10-
.state ('app', {
11-
abstract: true,
12-
url: '/app',
13-
templateUrl: 'modules/core/views/app.html',
14-
controller: 'MainCtrl'
15-
})
16-
.state ('app.home', {
17-
url: '',
18-
templateUrl: 'modules/core/views/home.html',
19-
controller: 'HomeCtrl'
2+
angular.module('com.module.core')
3+
.config(function($stateProvider, $urlRouterProvider) {
4+
$stateProvider
5+
.state('router', {
6+
url: '/router',
7+
template: '<div class="lockscreen" style="height: 100%"></div>',
8+
controller: 'RouteCtrl'
9+
})
10+
.state('app', {
11+
abstract: true,
12+
url: '/app',
13+
templateUrl: 'modules/core/views/app.html',
14+
controller: 'MainCtrl'
15+
})
16+
.state('app.home', {
17+
url: '',
18+
templateUrl: 'modules/core/views/home.html',
19+
controller: 'HomeCtrl'
20+
});
21+
$urlRouterProvider.otherwise('/router');
2022
});
21-
$urlRouterProvider.otherwise ('/router');
22-
});

client/app/modules/core/controllers/home.ctrl.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
* @requires $rootScope
88
**/
99
angular.module('com.module.core')
10-
.controller('HomeCtrl', function ($scope, $rootScope) {
10+
.controller('HomeCtrl', function($scope, $rootScope) {
1111

12-
$scope.count = {};
12+
$scope.count = {};
1313

14-
$scope.boxes = $rootScope.dashboardBox;
14+
$scope.boxes = $rootScope.dashboardBox;
1515

16-
});
16+
});

client/app/modules/core/controllers/layout.ctrl.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
'use strict';
22
angular.module('com.module.core')
3-
/**
4-
* @ngdoc function
5-
* @name com.module.core.controller:LayoutCtrl
6-
* @description Layout controller
7-
* @requires $scope
8-
* @requires $rootScope
9-
* @requires CoreService
10-
* @requires gettextCatalog
11-
**/
12-
.controller('LayoutCtrl', function ($scope, $rootScope, $cookies, CoreService, gettextCatalog) {
3+
/**
4+
* @ngdoc function
5+
* @name com.module.core.controller:LayoutCtrl
6+
* @description Layout controller
7+
* @requires $scope
8+
* @requires $rootScope
9+
* @requires CoreService
10+
* @requires gettextCatalog
11+
**/
12+
.controller('LayoutCtrl', function($scope, $rootScope, $cookies, CoreService,
13+
gettextCatalog) {
1314

1415
// angular translate
1516
$scope.locale = {
@@ -19,7 +20,7 @@ angular.module('com.module.core')
1920
$scope.locales = $rootScope.locales;
2021
$scope.selectLocale = $rootScope.locale;
2122

22-
$scope.setLocale = function (locale) {
23+
$scope.setLocale = function(locale) {
2324
// set the current lang
2425
$scope.locale = $scope.locales[locale];
2526
$scope.selectLocale = $scope.locale;
@@ -51,7 +52,7 @@ angular.module('com.module.core')
5152
'class': 'not-fixed'
5253
}];
5354

54-
$scope.toggleSidebar = function () {
55+
$scope.toggleSidebar = function() {
5556
var $ = angular.element;
5657
if ($(window).width() <= 992) {
5758
$('.row-offcanvas').toggleClass('active');

0 commit comments

Comments
 (0)