diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-05 16:35:06 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-05 16:35:06 +0100 |
commit | 7880fd60bb6ba5237d269a1b840a412c4438dd39 (patch) | |
tree | 4162d2826c79dde8955b9197bb8be9e27ca82b3f | |
parent | c688292feaae9005644c83a14a26a420a570fae1 (diff) | |
download | esper-testing-7880fd60bb6ba5237d269a1b840a412c4438dd39.tar.gz esper-testing-7880fd60bb6ba5237d269a1b840a412c4438dd39.tar.bz2 esper-testing-7880fd60bb6ba5237d269a1b840a412c4438dd39.tar.xz esper-testing-7880fd60bb6ba5237d269a1b840a412c4438dd39.zip |
o Integrating the separate person app into the front page app.
-rwxr-xr-x | src/main/webapp/WEB-INF/urlrewrite.xml | 2 | ||||
-rw-r--r-- | src/main/webapp/apps/core/navbar.html | 2 | ||||
-rwxr-xr-x | src/main/webapp/apps/frontPageApp/frontPage.html | 4 | ||||
-rwxr-xr-x | src/main/webapp/apps/frontPageApp/frontPageApp.js | 39 | ||||
-rwxr-xr-x | src/main/webapp/apps/frontPageApp/person.html (renamed from src/main/webapp/apps/personApp/person.html) | 0 | ||||
-rwxr-xr-x | src/main/webapp/apps/personApp/personApp.js | 36 |
6 files changed, 42 insertions, 41 deletions
diff --git a/src/main/webapp/WEB-INF/urlrewrite.xml b/src/main/webapp/WEB-INF/urlrewrite.xml index a4834c9..cc02ca8 100755 --- a/src/main/webapp/WEB-INF/urlrewrite.xml +++ b/src/main/webapp/WEB-INF/urlrewrite.xml @@ -15,6 +15,7 @@ <to type="forward">/index.jspx</to> </rule> + <!-- <rule match-type="regex"> <from>^/person/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/?$</from> <set type="parameter" name="uuid">$1</set> @@ -26,6 +27,7 @@ <set type="parameter" name="uuid">$1</set> <to type="forward">/person/person.jspx</to> </rule> + --> <rule match-type="regex"> <from>^/build/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$</from> diff --git a/src/main/webapp/apps/core/navbar.html b/src/main/webapp/apps/core/navbar.html index fa0074c..4ae715b 100644 --- a/src/main/webapp/apps/core/navbar.html +++ b/src/main/webapp/apps/core/navbar.html @@ -4,7 +4,7 @@ <span class="brand">Wat</span> <div class="nav-collapse collapse"> <ul class="nav"> - <li class=""><a href="/">Home</a></li> + <li class=""><a href="#/">Home</a></li> <li class=""><a href="/jenkins">Jenkins</a></li> <!-- <li class=""><a href="./getting-started.html">Get started</a></li> diff --git a/src/main/webapp/apps/frontPageApp/frontPage.html b/src/main/webapp/apps/frontPageApp/frontPage.html index 64c97ad..b121935 100755 --- a/src/main/webapp/apps/frontPageApp/frontPage.html +++ b/src/main/webapp/apps/frontPageApp/frontPage.html @@ -9,7 +9,7 @@ <div> <ul class="inline"> <li ng-repeat="b in recentBadges"> - <a href="/person/{{b.person.uuid}}/"> {{b.person.name}} </a> + <a href="#/person/{{b.person.uuid}}"> {{b.person.name}} </a> <span class="badge-level-{{badge.level}} badge">{{b.badge.name}}</span> </li> </ul> @@ -25,7 +25,7 @@ </thead> <tbody> <tr ng-repeat="person in persons.rows"> - <td><a href="/person/{{person.person.uuid}}/">{{person.person.name}}</a></td> + <td><a href="#/person/{{person.person.uuid}}">{{person.person.name}}</a></td> <td>{{person.badges.length}}</td> </tr> </tbody> diff --git a/src/main/webapp/apps/frontPageApp/frontPageApp.js b/src/main/webapp/apps/frontPageApp/frontPageApp.js index d5af99f..7678f0d 100755 --- a/src/main/webapp/apps/frontPageApp/frontPageApp.js +++ b/src/main/webapp/apps/frontPageApp/frontPageApp.js @@ -1,11 +1,46 @@ 'use strict'; -var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'person', 'badge', 'pagingTableService', 'core.directives']).config(function ($routeProvider, $locationProvider) { +var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'person', 'badge', 'build', 'pagingTableService', 'core.directives']).config(function ($routeProvider, $locationProvider) { $routeProvider. - when('/', {controller: FrontPageCtrl, templateUrl: '/apps/frontPageApp/frontPage.html?noCache=' + noCache}); + when('/', {controller: FrontPageCtrl, templateUrl: '/apps/frontPageApp/frontPage.html?noCache=' + noCache}). + when('/person/:personUuid', {controller: PersonCtrl, templateUrl: '/apps/frontPageApp/person.html?noCache=' + noCache}); }); function FrontPageCtrl($scope, Person, Badge, PagingTableService) { $scope.persons = PagingTableService.create($scope, PagingTableService.defaultCallback(Person)); $scope.recentBadges = Badge.query(); } + +function PersonCtrl($scope, $routeParams, Person, Badge, Build, PagingTableService) { + var personUuid = $routeParams.personUuid; + + $scope.mode = 'overview'; + + $scope.builds = PagingTableService.create($scope, PagingTableService.defaultCallback(Build, {person: personUuid})); + + $scope.setMode = function(mode) { + $scope.mode = mode; + switch(mode) { + case 'builds': + var builds = $scope.builds; + + console.log("$scope.builds.length=" + builds.rows.length); + if (builds.rows.length == 0) { + $scope.builds.first(); + } + break; + } + }; + + Person.get({uuid: personUuid}, function (person) { + $scope.person = person; + }); + + Build.query({person: personUuid}, function (builds) { + $scope.recentBuilds = builds; + }); + + Badge.query({person: personUuid}, function (badges) { + $scope.badges = badges; + }); +} diff --git a/src/main/webapp/apps/personApp/person.html b/src/main/webapp/apps/frontPageApp/person.html index 3544221..3544221 100755 --- a/src/main/webapp/apps/personApp/person.html +++ b/src/main/webapp/apps/frontPageApp/person.html diff --git a/src/main/webapp/apps/personApp/personApp.js b/src/main/webapp/apps/personApp/personApp.js deleted file mode 100755 index 363e498..0000000 --- a/src/main/webapp/apps/personApp/personApp.js +++ /dev/null @@ -1,36 +0,0 @@ -'use strict'; - -var personApp = angular.module('personApp', ['person', 'build', 'pagingTableService', 'core.directives']).config(function ($routeProvider, $locationProvider) { - $routeProvider. - when('/', {controller: PersonCtrl, templateUrl: '/apps/personApp/person.html?noCache=' + noCache}); -}); - -function PersonCtrl($scope, $routeParams, Person, Build, PagingTableService) { - var personUuid = uuid; - - $scope.mode = 'overview'; - - $scope.builds = PagingTableService.create($scope, PagingTableService.defaultCallback(Build, {person: personUuid})); - - $scope.setMode = function(mode) { - $scope.mode = mode; - switch(mode) { - case 'builds': - var builds = $scope.builds; - - console.log("$scope.builds.length=" + builds.rows.length); - if (builds.rows.length == 0) { - $scope.builds.first(); - } - break; - } - }; - - Person.get({uuid: uuid}, function (person) { - $scope.person = person; - }); - - Build.query({person: uuid}, function (builds) { - $scope.recentBuilds = builds; - }); -} |