Skip to content

Commit 15f79bb

Browse files
committed
Merge branch 'master' of github.com:arrking/austack
2 parents 9ca3317 + 82a644e commit 15f79bb

Some content is hidden

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

65 files changed

+1016
-1535
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(function () {
2+
'use strict';
3+
4+
angular
5+
.module('austackApp.account')
6+
.controller('ProfileController', ProfileController);
7+
8+
ProfileController.$inject = ['$mdDialog'];
9+
10+
function ProfileController($mdDialog) {
11+
var vm = this;
12+
13+
vm.hide = function () {
14+
$mdDialog.hide();
15+
};
16+
vm.cancel = function () {
17+
$mdDialog.cancel();
18+
};
19+
vm.answer = function (answer) {
20+
$mdDialog.hide(answer);
21+
};
22+
}
23+
24+
})();

client/app/account/profile/profile.service.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
angular
55
.module('austackApp.account')
6-
.service('ProfileService', ProfileService)
7-
.controller('ProfileController', ProfileController);
6+
.service('ProfileService', ProfileService);
87

98
ProfileService.$inject = ['$mdDialog', '$log'];
109

@@ -34,20 +33,4 @@
3433
}
3534
}
3635

37-
ProfileController.$inject = ['$mdDialog'];
38-
39-
function ProfileController($mdDialog) {
40-
var vm = this;
41-
42-
vm.hide = function () {
43-
$mdDialog.hide();
44-
};
45-
vm.cancel = function () {
46-
$mdDialog.cancel();
47-
};
48-
vm.answer = function (answer) {
49-
$mdDialog.hide(answer);
50-
};
51-
}
52-
5336
})();
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
(function () {
2+
'use strict';
3+
4+
angular
5+
.module('austackApp.account')
6+
.controller('SettingsController', SettingsController);
7+
8+
SettingsController.$inject = ['$mdDialog'];
9+
10+
function SettingsController($mdDialog) {
11+
var vm = this;
12+
13+
vm.hide = function () {
14+
$mdDialog.hide();
15+
};
16+
vm.cancel = function () {
17+
$mdDialog.cancel();
18+
};
19+
vm.answer = function (answer) {
20+
$mdDialog.hide(answer);
21+
};
22+
}
23+
24+
})();

client/app/account/settings/settings.service.js

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33

44
angular
55
.module('austackApp.account')
6-
.service('SettingsService', SettingsService)
7-
.controller('SettingsController', SettingsController);
6+
.service('SettingsService', SettingsService);
87

98
SettingsService.$inject = ['$mdDialog', '$log'];
109

@@ -34,20 +33,4 @@
3433
}
3534
}
3635

37-
SettingsController.$inject = ['$mdDialog'];
38-
39-
function SettingsController($mdDialog) {
40-
var vm = this;
41-
42-
vm.hide = function () {
43-
$mdDialog.hide();
44-
};
45-
vm.cancel = function () {
46-
$mdDialog.cancel();
47-
};
48-
vm.answer = function (answer) {
49-
$mdDialog.hide(answer);
50-
};
51-
}
52-
5336
})();

client/app/admin/user/list/detail/detail.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
])
2222
.config(configureUserListDetail);
2323

24-
2524
/**
2625
* Route configuration function configuring the passed $stateProvider.
2726
* Register the 'user.detail' state with the detail template
@@ -45,7 +44,7 @@
4544
authenticate: true,
4645
role: 'admin',
4746
views: {
48-
'detail@root': {
47+
'content@admin.user.list': {
4948
templateUrl: 'app/admin/user/list/detail/detail.html',
5049
controller: 'UserDetailController',
5150
controllerAs: 'detail',

client/app/admin/user/list/edit/edit.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
])
3333
.config(configureUserListEdit);
3434

35-
3635
/**
3736
* Route configuration function configuring the passed $stateProvider.
3837
* Register the admin.user.list.edit state with the edit template
@@ -56,7 +55,7 @@
5655
role: 'admin',
5756
onEnter: onEnterUserListEdit,
5857
views: {
59-
'detail@root': {
58+
'content@admin.user.list': {
6059
templateUrl: 'app/admin/user/list/edit/edit.html',
6160
controller: 'UserEditController',
6261
controllerAs: 'edit',
@@ -70,7 +69,6 @@
7069
$stateProvider.state(editState);
7170
}
7271

73-
7472
/**
7573
* Executed when entering the admin.user.list.detail state. Open the component
7674
* registered with the component id 'user.detailView'.

client/app/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
angular
1212
.module('austackApp', [
1313
// Add modules below
14-
'austackApp.app',
14+
'austackApp.application',
1515
'ngCookies',
1616
'ngResource',
1717
'ngSanitize',
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
(function () {
2+
'use strict';
3+
4+
// register the controller as ApplicationController
5+
angular
6+
.module('austackApp.application')
7+
.controller('ApplicationController', ApplicationController);
8+
9+
// add ApplicationController dependencies to inject
10+
ApplicationController.$inject = ['$mdDialog'];
11+
12+
/**
13+
* ApplicationController constructor. Main controller for the austackApp.application
14+
* module.
15+
*
16+
* @param {$scope} $scope - The scope to listen for events
17+
* @param {socket.io} socket - The socket to register updates
18+
*/
19+
function ApplicationController($mdDialog) {
20+
var vm = this;
21+
22+
vm.create = createApplication;
23+
24+
function createApplication() {
25+
$mdDialog.show({
26+
controller: 'ApplicationCreateController',
27+
controllerAs: 'create',
28+
templateUrl: 'app/application/create/create.html',
29+
clickOutsideToClose: false
30+
});
31+
}
32+
}
33+
34+
})();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<section id="application-content" layout="column" layout-fill flex>
2+
<div ui-view layout="column" layout-fill flex></div>
3+
</section>
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
(function () {
2+
'use strict';
3+
4+
/**
5+
* Introduce the austackApp.application module
6+
* and configure it.
7+
*
8+
* @requires ui.router
9+
* @requires ngResource
10+
* @requires austackApp.application.main
11+
* @requires austackApp.application.list
12+
* @requires austackApp.application.create
13+
*/
14+
angular
15+
.module('austackApp.application', [
16+
'ngResource',
17+
'ui.router',
18+
'austackApp.application.list',
19+
'austackApp.application.detail',
20+
'austackApp.application.edit',
21+
'austackApp.application.create'
22+
])
23+
.config(configApplicationRoutes);
24+
25+
// inject configApplicationRoutes dependencies
26+
configApplicationRoutes.$inject = ['$urlRouterProvider', '$stateProvider'];
27+
28+
/**
29+
* Route configuration function configuring the passed $stateProvider.
30+
* Register the abstract application state with the application template
31+
* paired with the ApplicationController as 'index'.
32+
* The injectable 'applications' is resolved as a list of all applications
33+
* and can be injected in all sub controllers.
34+
*
35+
* @param {$stateProvider} $stateProvider - The state provider to configure
36+
*/
37+
function configApplicationRoutes($urlRouterProvider, $stateProvider) {
38+
// The application state configuration
39+
var applicationState = {
40+
name: 'application',
41+
parent: 'root',
42+
url: '/applications',
43+
abstract: true,
44+
resolve: {
45+
applications: resolveApplications
46+
},
47+
templateUrl: 'app/application/application.html',
48+
controller: 'ApplicationController',
49+
controllerAs: 'index'
50+
};
51+
52+
//$urlRouterProvider.when('/application', '/application/');
53+
$stateProvider.state(applicationState);
54+
}
55+
56+
// inject resolveApplications dependencies
57+
resolveApplications.$inject = ['Application'];
58+
59+
/**
60+
* Resolve dependencies for the application.list state
61+
*
62+
* @params {Application} Application - The service to query applications
63+
* @returns {Promise} A promise that, when fullfilled, returns an array of applications
64+
*/
65+
function resolveApplications(Application) {
66+
return Application.query().$promise;
67+
}
68+
69+
})();

0 commit comments

Comments
 (0)