From a9543bd5570b7435b760a8eb3c8b457c889a5fca Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 6 Jan 2013 11:46:23 +0100 Subject: o Better front page. --- .../trygvis/esper/testing/core/db/PersonDao.java | 1 + .../esper/testing/web/resource/CoreResource.java | 10 ++-- src/main/webapp/apps/app.css | 6 +-- src/main/webapp/apps/app.js | 31 +++++++++++- src/main/webapp/apps/core/navbar.html | 15 ++---- src/main/webapp/apps/frontPageApp/frontPage.html | 55 ++++++++-------------- 6 files changed, 63 insertions(+), 55 deletions(-) (limited to 'src/main') diff --git a/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java b/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java index 7a682dc..ec460ec 100755 --- a/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java +++ b/src/main/java/io/trygvis/esper/testing/core/db/PersonDao.java @@ -194,6 +194,7 @@ public class PersonDao { sql += " AND level=?"; } + sql += " ORDER BY created_date"; sql += " LIMIT ? OFFSET ?"; try (PreparedStatement s = c.prepareStatement(sql)) { diff --git a/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java index a129cf3..c58bc13 100755 --- a/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java +++ b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java @@ -124,14 +124,14 @@ public class CoreResource extends AbstractResource { @GET @Path("/badge") - public List getBadges(@MagicParam final PageRequest page, @MagicParam(query = "person") final Uuid person) throws Exception { - return da.inTransaction(new CoreDaosCallback>() { - protected List run() throws SQLException { + public List getBadges(@MagicParam final PageRequest page, @MagicParam(query = "person") final Uuid person) throws Exception { + return da.inTransaction(new CoreDaosCallback>() { + protected List run() throws SQLException { List badgeDtos = daos.personDao.selectBadges(fromNull(person), Option.none(), Option.none(), page); - List list = new ArrayList<>(); + List list = new ArrayList<>(); for (PersonalBadgeDto badge : badgeDtos) { - list.add(getBadgeJson.apply(badge)); + list.add(getBadgeDetailJson.apply(badge)); } return list; } diff --git a/src/main/webapp/apps/app.css b/src/main/webapp/apps/app.css index 761b765..5ffd104 100644 --- a/src/main/webapp/apps/app.css +++ b/src/main/webapp/apps/app.css @@ -3,9 +3,9 @@ bronze ii = #a67d3d */ -.badge-level-1 { background-color: #a67d3d; } -.badge-level-2 { background-color: silver; } -.badge-level-3 { background-color: #ffd700; } +.badge-level-1 { background-color: #a67d3d; color: #000000 } +.badge-level-2 { background-color: silver; color: #000000 } +.badge-level-3 { background-color: #ffd700; color: #000000 } #content { background-color: #ffffff; diff --git a/src/main/webapp/apps/app.js b/src/main/webapp/apps/app.js index c1ea158..3e01e9e 100644 --- a/src/main/webapp/apps/app.js +++ b/src/main/webapp/apps/app.js @@ -3,6 +3,35 @@ var directives = angular.module('core.directives', []); directives.directive('navbar', function () { return { restrict: 'E', - templateUrl: '/apps/core/navbar.html' + templateUrl: '/apps/core/navbar.html?noCache=' + noCache }; }); + +directives.directive('badge', function() { + return { + restrict: 'E', + scope: { + badgeDetail: '=badgeDetail' + }, + template: '{{badgeDetail.badge.name}}' + + '' + + ' awarded to ' + + '{{badgeDetail.person.name}}' + } +}); + +/* + + {{badge.name}} + + + + + + {{badge.createdDate | date:'medium'}} + +*/ \ No newline at end of file diff --git a/src/main/webapp/apps/core/navbar.html b/src/main/webapp/apps/core/navbar.html index 4ae715b..eb1f798 100644 --- a/src/main/webapp/apps/core/navbar.html +++ b/src/main/webapp/apps/core/navbar.html @@ -1,19 +1,14 @@ -- cgit v1.2.3