diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-06 14:33:40 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-06 14:33:40 +0100 |
commit | 7663c88dba4da60afde4691fc925e2f4cf6e3c4b (patch) | |
tree | 0cc5625b3b837cd7f8e4c52acf016de80c41225e /src/main/webapp/apps/frontPageApp/frontPageApp.js | |
parent | 37207267bf3a1149f78a5022ed8e016cac6b85ca (diff) | |
download | esper-testing-7663c88dba4da60afde4691fc925e2f4cf6e3c4b.tar.gz esper-testing-7663c88dba4da60afde4691fc925e2f4cf6e3c4b.tar.bz2 esper-testing-7663c88dba4da60afde4691fc925e2f4cf6e3c4b.tar.xz esper-testing-7663c88dba4da60afde4691fc925e2f4cf6e3c4b.zip |
o Much better person list.
Diffstat (limited to 'src/main/webapp/apps/frontPageApp/frontPageApp.js')
-rwxr-xr-x | src/main/webapp/apps/frontPageApp/frontPageApp.js | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/src/main/webapp/apps/frontPageApp/frontPageApp.js b/src/main/webapp/apps/frontPageApp/frontPageApp.js index c973983..39dbc9d 100755 --- a/src/main/webapp/apps/frontPageApp/frontPageApp.js +++ b/src/main/webapp/apps/frontPageApp/frontPageApp.js @@ -13,14 +13,35 @@ function FrontPageCtrl($scope, Person, Badge) { } function PersonListCtrl($scope, Person, PagingTableService) { - $scope.persons = PagingTableService.create($scope, PagingTableService.defaultCallback(Person, {orderBy: "name"})); + var personsWatcher = function () { + var array = $scope.persons.rows; + + var group = []; + var groups = []; + angular.forEach(array, function(element) { + group.push(element); + if(group.length == 4) { + groups.push(group); + group = []; + } + }); + + if(group.length != 0) { + groups.push(group); + } + + $scope.personGroups = groups; + }; + + $scope.persons = PagingTableService.create($scope, PagingTableService.defaultCallback(Person, {orderBy: "name"}), {count: 4 * 6, watcher: personsWatcher}); + + $scope.personGroups = []; } function PersonCtrl($scope, $routeParams, Person, Build, PagingTableService) { var personUuid = $routeParams.personUuid; $scope.mode = 'overview'; - $scope.builds = PagingTableService.create($scope, PagingTableService.defaultCallback(Build, {person: personUuid})); $scope.setMode = function(mode) { @@ -44,8 +65,4 @@ function PersonCtrl($scope, $routeParams, Person, Build, PagingTableService) { Build.query({person: personUuid}, function (builds) { $scope.recentBuilds = builds; }); - -// Badge.query({person: personUuid}, function (badges) { -// $scope.badges = badges; -// }); } |