diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-12-28 13:13:14 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-12-28 13:13:14 +0100 |
commit | c9ff3d5495b0229d837fa0ec23486cc7b6b191d0 (patch) | |
tree | b978427f431aa41c59115978c6a017db84b9f2ec /src/main/webapp/apps | |
parent | 422b1caeaa9f7d069a9208ecb0d0249485b1a05e (diff) | |
download | esper-testing-c9ff3d5495b0229d837fa0ec23486cc7b6b191d0.tar.gz esper-testing-c9ff3d5495b0229d837fa0ec23486cc7b6b191d0.tar.bz2 esper-testing-c9ff3d5495b0229d837fa0ec23486cc7b6b191d0.tar.xz esper-testing-c9ff3d5495b0229d837fa0ec23486cc7b6b191d0.zip |
o Listing builds on the person view.
Diffstat (limited to 'src/main/webapp/apps')
-rw-r--r-- | src/main/webapp/apps/core/CoreResources.js | 17 | ||||
-rw-r--r-- | src/main/webapp/apps/core/PersonService.js | 9 | ||||
-rw-r--r-- | src/main/webapp/apps/frontPageApp/frontPageApp.js | 21 | ||||
-rw-r--r-- | src/main/webapp/apps/personApp/person.html | 7 | ||||
-rw-r--r-- | src/main/webapp/apps/personApp/personApp.js | 10 |
5 files changed, 43 insertions, 21 deletions
diff --git a/src/main/webapp/apps/core/CoreResources.js b/src/main/webapp/apps/core/CoreResources.js new file mode 100644 index 0000000..96d4b24 --- /dev/null +++ b/src/main/webapp/apps/core/CoreResources.js @@ -0,0 +1,17 @@ +'use strict'; + +function Person($resource) { + return $resource('/resource/core/person/:uuid', {uuid: '@uuid'}); +} + +angular. + module('person', ['ngResource']). + factory('Person', Person); + +function Build($resource) { + return $resource('/resource/core/build/:uuid', {uuid: '@uuid'}); +} + +angular. + module('build', ['ngResource']). + factory('Build', Build); diff --git a/src/main/webapp/apps/core/PersonService.js b/src/main/webapp/apps/core/PersonService.js deleted file mode 100644 index 75265a8..0000000 --- a/src/main/webapp/apps/core/PersonService.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -function PersonService($resource) { - return $resource('/resource/core/person/:uuid', {uuid: '@uuid'}); -} - -angular. - module('personService', ['ngResource']). - factory('PersonService', PersonService); diff --git a/src/main/webapp/apps/frontPageApp/frontPageApp.js b/src/main/webapp/apps/frontPageApp/frontPageApp.js index d92a163..c4fa0cc 100644 --- a/src/main/webapp/apps/frontPageApp/frontPageApp.js +++ b/src/main/webapp/apps/frontPageApp/frontPageApp.js @@ -1,11 +1,11 @@ 'use strict'; -var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'personService']).config(function ($routeProvider, $locationProvider) { +var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'person']).config(function ($routeProvider, $locationProvider) { $routeProvider. when('/', {controller: FrontPageCtrl, templateUrl: '/apps/frontPageApp/frontPage.html?noCache=' + noCache}); }); -function FrontPageCtrl($scope, $http, PersonService) { +function FrontPageCtrl($scope, $http, Person) { $scope.persons = []; $scope.pagingOptions = { @@ -19,6 +19,8 @@ function FrontPageCtrl($scope, $http, PersonService) { data: 'persons', displayFooter: true, enablePaging: true, + enableRowReordering: false, + enableColumnReordering: false, showFilter: false, showColumnMenu: false, canSelectRows: false, @@ -41,7 +43,8 @@ function FrontPageCtrl($scope, $http, PersonService) { $scope.setPagingData = function(data, page, pageSize){ // $scope.persons = data.slice((page - 1) * pageSize, page * pageSize); $scope.persons = data; - $scope.personsGridOptions.totalServerItems = data.length; +// $scope.personsGridOptions.totalServerItems = data.length; + window.x = $scope.personsGridOptions; if (!$scope.$$phase) { $scope.$apply(); } @@ -50,7 +53,7 @@ function FrontPageCtrl($scope, $http, PersonService) { $scope.getPagedDataAsync = function (pageSize, page/*, searchText*/) { setTimeout(function () { - PersonService.query({startIndex: page * pageSize, count: pageSize}, function (persons) { + Person.query({startIndex: page * pageSize, count: pageSize}, function (persons) { $scope.setPagingData(persons, page, pageSize); }); }, 100); @@ -60,9 +63,9 @@ function FrontPageCtrl($scope, $http, PersonService) { $scope.getPagedDataAsync($scope.pagingOptions.pageSize, $scope.pagingOptions.currentPage); }, true); - $http.get('/resource/core/person-count').success(function(count) { - $scope.pagingOptions.totalServerItems = count; - - $scope.getPagedDataAsync($scope.pagingOptions.pageSize, $scope.pagingOptions.currentPage); - }); +// $http.get('/resource/core/person-count').success(function(count) { +// $scope.pagingOptions.totalServerItems = count; +// +// $scope.getPagedDataAsync($scope.pagingOptions.pageSize, $scope.pagingOptions.currentPage); +// }); } diff --git a/src/main/webapp/apps/personApp/person.html b/src/main/webapp/apps/personApp/person.html index 4189f20..2c0c3e7 100644 --- a/src/main/webapp/apps/personApp/person.html +++ b/src/main/webapp/apps/personApp/person.html @@ -14,4 +14,11 @@ <span class="badge badge-level-{{badge.level}}">{{badge.name}}</span> progress: {{badge.progress}} of {{badge.goal}} </p> + <h3>Builds</h3> + <ul> + <li ng-repeat="build in builds"> + {{build.uuid}} + </li> + </ul> + </div> diff --git a/src/main/webapp/apps/personApp/personApp.js b/src/main/webapp/apps/personApp/personApp.js index 59f5a7d..8323c45 100644 --- a/src/main/webapp/apps/personApp/personApp.js +++ b/src/main/webapp/apps/personApp/personApp.js @@ -1,12 +1,16 @@ 'use strict'; -var personApp = angular.module('personApp', ['personService']).config(function ($routeProvider, $locationProvider) { +var personApp = angular.module('personApp', ['person', 'build']).config(function ($routeProvider, $locationProvider) { $routeProvider. when('/', {controller: PersonCtrl, templateUrl: '/apps/personApp/person.html?noCache=' + noCache}); }); -function PersonCtrl($scope, $location, PersonService) { - PersonService.get({uuid: uuid}, function (person) { +function PersonCtrl($scope, $location, Person, Build) { + Person.get({uuid: uuid}, function (person) { $scope.person = person; }); + + Build.query({person: uuid}, function (builds) { + $scope.builds = builds; + }); } |