aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-01-06 11:46:23 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2013-01-06 11:46:23 +0100
commita9543bd5570b7435b760a8eb3c8b457c889a5fca (patch)
tree5428adaf101805ff7a5aaacc891b28e7fc007537 /src
parent15d61bce4cc56b2ee6b87e46eaff2afcf0b7cdaa (diff)
downloadesper-testing-a9543bd5570b7435b760a8eb3c8b457c889a5fca.tar.gz
esper-testing-a9543bd5570b7435b760a8eb3c8b457c889a5fca.tar.bz2
esper-testing-a9543bd5570b7435b760a8eb3c8b457c889a5fca.tar.xz
esper-testing-a9543bd5570b7435b760a8eb3c8b457c889a5fca.zip
o Better front page.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/main/java/io/trygvis/esper/testing/core/db/PersonDao.java1
-rwxr-xr-xsrc/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java10
-rw-r--r--src/main/webapp/apps/app.css6
-rw-r--r--src/main/webapp/apps/app.js31
-rw-r--r--src/main/webapp/apps/core/navbar.html15
-rwxr-xr-xsrc/main/webapp/apps/frontPageApp/frontPage.html55
6 files changed, 63 insertions, 55 deletions
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<BadgeJson> getBadges(@MagicParam final PageRequest page, @MagicParam(query = "person") final Uuid person) throws Exception {
- return da.inTransaction(new CoreDaosCallback<List<BadgeJson>>() {
- protected List<BadgeJson> run() throws SQLException {
+ public List<BadgeDetailJson> getBadges(@MagicParam final PageRequest page, @MagicParam(query = "person") final Uuid person) throws Exception {
+ return da.inTransaction(new CoreDaosCallback<List<BadgeDetailJson>>() {
+ protected List<BadgeDetailJson> run() throws SQLException {
List<PersonalBadgeDto> badgeDtos = daos.personDao.selectBadges(fromNull(person), Option.<PersonalBadgeDto.BadgeType>none(), Option.<Integer>none(), page);
- List<BadgeJson> list = new ArrayList<>();
+ List<BadgeDetailJson> 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: '<span class="badge-inverse badge-level-{{badgeDetail.badge.level}} badge"><strong style="padding-right: 0.3em">{{badgeDetail.badge.name}}</strong>' +
+ '<i class="icon-user"></i></span>' +
+ ' awarded to ' +
+ '<a href="/#/person/{{badgeDetail.person.uuid}}">{{badgeDetail.person.name}}</a>'
+ }
+});
+
+/*
+ <!--
+ <span class="badge-level-{{badge.level}} badge">{{badge.name}}</span>
+ -->
+ <strong>{{badge.name}}</strong>
+ <!--
+ <i class="icon-user ng-class: {{{1: 'badge-level-1', 2: 'badge-level-2', 3: 'badge-level-3'}[badge.level]}}"></i>
+ -->
+ <span class="badge-level-{{badge.level}} badge">
+ <i class="icon-user"></i>
+ </span>
+
+ {{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 @@
<div class="navbar">
<div class="navbar-inner">
<div class="container">
- <span class="brand">Wat</span>
+ <span class="brand"><a href="/">Wat</a></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="/#/badge">Badged</a></li>
+ <li class=""><a href="/#/person">People</a></li>
+ <li class="divider-vertical"></li>
<li class=""><a href="/jenkins">Jenkins</a></li>
- <!--
- <li class=""><a href="./getting-started.html">Get started</a></li>
- <li class=""><a href="./scaffolding.html">Scaffolding</a></li>
- <li class=""><a href="./base-css.html">Base CSS</a></li>
- <li class="active"><a href="./components.html">Components</a></li>
- <li class=""><a href="./javascript.html">JavaScript</a></li>
- <li class=""><a href="./customize.html">Customize</a></li>
- -->
</ul>
</div>
</div>
diff --git a/src/main/webapp/apps/frontPageApp/frontPage.html b/src/main/webapp/apps/frontPageApp/frontPage.html
index b121935..84e991b 100755
--- a/src/main/webapp/apps/frontPageApp/frontPage.html
+++ b/src/main/webapp/apps/frontPageApp/frontPage.html
@@ -5,44 +5,27 @@
<h1>Recent</h1>
</div>
- <h3>Badges</h3>
- <div>
- <ul class="inline">
- <li ng-repeat="b in recentBadges">
- <a href="#/person/{{b.person.uuid}}"> {{b.person.name}} </a>
- <span class="badge-level-{{badge.level}} badge">{{b.badge.name}}</span>
- </li>
- </ul>
- </div>
+ <div class="row">
+ <div class="span6">
+ <h3>Badges</h3>
- <h3>Newcomers</h3>
- <table class="table">
- <thead>
- <tr>
- <th>Name</th>
- <th>Badges</th>
- </tr>
- </thead>
- <tbody>
- <tr ng-repeat="person in persons.rows">
- <td><a href="#/person/{{person.person.uuid}}">{{person.person.name}}</a></td>
- <td>{{person.badges.length}}</td>
- </tr>
- </tbody>
- <tfoot>
- <tr>
- <td colspan="2">
- <ul class="pager">
- <li class="previous" ng-class="{disabled: persons.startIndex == 0}">
- <a ng-click="persons.prev()">&larr; Older</a>
- </li>
- <li class="next">
- <a ng-click="persons.next()">Newer &rarr;</a>
+ <div>
+ <ul class="unstyled">
+ <li ng-repeat="b in recentBadges">
+ <badge badge-detail="b"/>
</li>
</ul>
- </td>
- </tr>
- </tfoot>
- </table>
+ </div>
+ </div>
+ <div class="span6">
+ <h3>Newcomers</h3>
+
+ <ul class="unstyled">
+ <li ng-repeat="person in persons.rows">
+ <a href="#/person/{{person.person.uuid}}">{{person.person.name}}</a>
+ </li>
+ </ul>
+ </div>
+ </div>
</div>