From b895e15d3c9bd4c7a1d420c99af9d1f2efca8a0b Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Fri, 4 Jan 2013 23:42:17 +0100 Subject: o Showing recent badges on the front page. --- src/main/webapp/apps/core/CoreResources.js | 6 ++++++ src/main/webapp/apps/frontPageApp/frontPage.html | 15 ++++++++++++--- src/main/webapp/apps/frontPageApp/frontPageApp.js | 5 +++-- 3 files changed, 21 insertions(+), 5 deletions(-) (limited to 'src/main/webapp/apps') diff --git a/src/main/webapp/apps/core/CoreResources.js b/src/main/webapp/apps/core/CoreResources.js index 74ac184..aec6a15 100644 --- a/src/main/webapp/apps/core/CoreResources.js +++ b/src/main/webapp/apps/core/CoreResources.js @@ -17,3 +17,9 @@ function BuildParticipant($resource) { } angular.module('buildParticipant', ['ngResource']).factory('BuildParticipant', BuildParticipant); + +function Badge($resource) { + return $resource('/resource/core/badge'); +} + +angular.module('badge', ['ngResource']).factory('Badge', Badge); diff --git a/src/main/webapp/apps/frontPageApp/frontPage.html b/src/main/webapp/apps/frontPageApp/frontPage.html index 3c433ee..8e067e1 100755 --- a/src/main/webapp/apps/frontPageApp/frontPage.html +++ b/src/main/webapp/apps/frontPageApp/frontPage.html @@ -1,10 +1,19 @@
- + +

Badges

+
+ + {{b.person.name}} + {{b.badge.name}} + +
+ +

Newcomers

@@ -14,7 +23,7 @@ - + diff --git a/src/main/webapp/apps/frontPageApp/frontPageApp.js b/src/main/webapp/apps/frontPageApp/frontPageApp.js index 624c484..d5af99f 100755 --- a/src/main/webapp/apps/frontPageApp/frontPageApp.js +++ b/src/main/webapp/apps/frontPageApp/frontPageApp.js @@ -1,10 +1,11 @@ 'use strict'; -var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'person', 'pagingTableService', 'core.directives']).config(function ($routeProvider, $locationProvider) { +var frontPageApp = angular.module('frontPageApp', ['ngGrid', 'person', 'badge', 'pagingTableService', 'core.directives']).config(function ($routeProvider, $locationProvider) { $routeProvider. when('/', {controller: FrontPageCtrl, templateUrl: '/apps/frontPageApp/frontPage.html?noCache=' + noCache}); }); -function FrontPageCtrl($scope, Person, PagingTableService) { +function FrontPageCtrl($scope, Person, Badge, PagingTableService) { $scope.persons = PagingTableService.create($scope, PagingTableService.defaultCallback(Person)); + $scope.recentBadges = Badge.query(); } -- cgit v1.2.3
{{person.name}}{{person.person.name}} {{person.badges.length}}