diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-10 07:32:02 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2013-01-10 07:32:02 +0100 |
commit | 7838a06e5521db39aee8b3b87785fcb5e32cd7ad (patch) | |
tree | f10592e5f062d17522dcf08c11faa6ad166254e1 /src/main/webapp | |
parent | bc54871dac7ef10102edecf91a747d6595a4640f (diff) | |
download | esper-testing-7838a06e5521db39aee8b3b87785fcb5e32cd7ad.tar.gz esper-testing-7838a06e5521db39aee8b3b87785fcb5e32cd7ad.tar.bz2 esper-testing-7838a06e5521db39aee8b3b87785fcb5e32cd7ad.tar.xz esper-testing-7838a06e5521db39aee8b3b87785fcb5e32cd7ad.zip |
o Creating a single (awarded) badge view.
Diffstat (limited to 'src/main/webapp')
-rwxr-xr-x | src/main/webapp/apps/app.js | 3 | ||||
-rw-r--r-- | src/main/webapp/apps/core/CoreResources.js | 2 | ||||
-rwxr-xr-x | src/main/webapp/apps/frontPageApp/badge.html | 30 | ||||
-rwxr-xr-x | src/main/webapp/apps/frontPageApp/frontPageApp.js | 8 |
4 files changed, 41 insertions, 2 deletions
diff --git a/src/main/webapp/apps/app.js b/src/main/webapp/apps/app.js index 8c683b6..068f454 100755 --- a/src/main/webapp/apps/app.js +++ b/src/main/webapp/apps/app.js @@ -55,7 +55,8 @@ directives.directive('badge', function () { ' <i class="icon-user"></i>' + '</span>' + ' awarded to ' + - '<a href="/#/person/{{badgeDetail.person.uuid}}">{{badgeDetail.person.name}}</a>' + '<a href="/#/person/{{badgeDetail.person.uuid}}">{{badgeDetail.person.name}}</a>. ' + + '<a href="/#/badge/{{badgeDetail.badge.uuid}}">More</a>' } }); diff --git a/src/main/webapp/apps/core/CoreResources.js b/src/main/webapp/apps/core/CoreResources.js index aec6a15..b258c85 100644 --- a/src/main/webapp/apps/core/CoreResources.js +++ b/src/main/webapp/apps/core/CoreResources.js @@ -19,7 +19,7 @@ function BuildParticipant($resource) { angular.module('buildParticipant', ['ngResource']).factory('BuildParticipant', BuildParticipant); function Badge($resource) { - return $resource('/resource/core/badge'); + return $resource('/resource/core/badge/:uuid', {uuid: '@uuid'}); } angular.module('badge', ['ngResource']).factory('Badge', Badge); diff --git a/src/main/webapp/apps/frontPageApp/badge.html b/src/main/webapp/apps/frontPageApp/badge.html new file mode 100755 index 0000000..92fc7ae --- /dev/null +++ b/src/main/webapp/apps/frontPageApp/badge.html @@ -0,0 +1,30 @@ +<div class="container"> + + <navbar/> + + <div class="page-header"> + <h1>Badge</h1> + </div> + + <div class="row"> + <div class="span12"> + The badge <badge-span badge="badge.badge"></badge-span> was awarded to <person-link person="badge.person"></person-link> at + {{badge.badge.createdDate | date:'medium'}}. + </div> + </div> + + <div class="row" ng-switch="badge.badge.name"> + <div class="span12" ng-switch-when="UNBREAKABLE"> + <h2>Details</h2> + <p> + The badge was awarded for having {{badge.personalBadge.builds.length}} successful builds in a row: + </p> + <ul class="unstyled"> + <li ng-repeat="b in badge.personalBadge.builds"> + <a class="btn" href="/build/{{b}}">{{$index + 1}} <i class="icon-chevron-right"></i></a> + </li> + </ul> + </div> + </div> + +</div> diff --git a/src/main/webapp/apps/frontPageApp/frontPageApp.js b/src/main/webapp/apps/frontPageApp/frontPageApp.js index a67e2dc..6f80d0f 100755 --- a/src/main/webapp/apps/frontPageApp/frontPageApp.js +++ b/src/main/webapp/apps/frontPageApp/frontPageApp.js @@ -4,6 +4,7 @@ var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'person', 'badge', $routeProvider. when('/', {controller: FrontPageCtrl, templateUrl: '/apps/frontPageApp/frontPage.html?noCache=' + noCache}). when('/badge/', {controller: BadgeListCtrl, templateUrl: '/apps/frontPageApp/badgeList.html?noCache=' + noCache}). + when('/badge/:badgeUuid', {controller: BadgeCtrl, templateUrl: '/apps/frontPageApp/badge.html?noCache=' + noCache}). when('/person/', {controller: PersonListCtrl, templateUrl: '/apps/frontPageApp/personList.html?noCache=' + noCache}). when('/person/:personUuid', {controller: PersonCtrl, templateUrl: '/apps/frontPageApp/person.html?noCache=' + noCache}). when('/build/', {controller: BuildListCtrl, templateUrl: '/apps/frontPageApp/buildList.html?noCache=' + noCache}); @@ -56,6 +57,13 @@ function BadgeListCtrl($scope, Badge, PagingTableService) { $scope.badgeGroups = []; } +function BadgeCtrl($scope, $routeParams, Badge) { + var badgeUuid = $routeParams.badgeUuid; + Badge.get({uuid: badgeUuid}, function (badge) { + $scope.badge = badge; + }); +} + function PersonListCtrl($scope, Person, PagingTableService) { var groupSize = 4; var personsWatcher = function () { |