aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java14
-rw-r--r--src/main/webapp/WEB-INF/tags/common/head.tagx1
-rw-r--r--src/main/webapp/apps/app.js0
-rw-r--r--src/main/webapp/apps/personApp/person.html31
4 files changed, 31 insertions, 15 deletions
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 98b32bb..2f4b77b 100644
--- a/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java
+++ b/src/main/java/io/trygvis/esper/testing/web/resource/CoreResource.java
@@ -6,6 +6,7 @@ import io.trygvis.esper.testing.core.badge.*;
import io.trygvis.esper.testing.core.db.*;
import io.trygvis.esper.testing.util.sql.*;
import io.trygvis.esper.testing.web.*;
+import org.joda.time.*;
import javax.servlet.http.*;
import javax.ws.rs.*;
@@ -98,10 +99,9 @@ public class CoreResource extends AbstractResource {
public List<BuildJson> run(Daos daos) throws SQLException {
List<BuildDto> buildDtos;
- if(person != null) {
+ if (person != null) {
buildDtos = daos.buildDao.selectBuildsByPerson(person, page);
- }
- else {
+ } else {
buildDtos = daos.buildDao.selectBuilds(page);
}
@@ -130,14 +130,18 @@ public class CoreResource extends AbstractResource {
}
private BuildJson getBuildJson(Daos daos, BuildDto build) {
- return new BuildJson(build.uuid);
+ return new BuildJson(build.uuid, build.createdDate, build.success);
}
public static class BuildJson {
public final UUID uuid;
+ public final DateTime date;
+ public final boolean success;
- public BuildJson(UUID uuid) {
+ public BuildJson(UUID uuid, DateTime date, boolean success) {
this.uuid = uuid;
+ this.date = date;
+ this.success = success;
}
}
}
diff --git a/src/main/webapp/WEB-INF/tags/common/head.tagx b/src/main/webapp/WEB-INF/tags/common/head.tagx
index 2384b20..f5b27a4 100644
--- a/src/main/webapp/WEB-INF/tags/common/head.tagx
+++ b/src/main/webapp/WEB-INF/tags/common/head.tagx
@@ -16,6 +16,7 @@
<script type="text/javascript" src="/external/headjs-0.99/head.min.js"><!-- --></script>
<script type="text/javascript">
head.js(
+ {app: "/apps/app.js"},
{jquery: "/external/jquery-1.8.3/jquery-1.8.3.js"},
{angularjs: "/external/angular-1.0.3/angular.js"},
{angularjsResource: "/external/angular-1.0.3/angular-resource.js"},
diff --git a/src/main/webapp/apps/app.js b/src/main/webapp/apps/app.js
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/main/webapp/apps/app.js
diff --git a/src/main/webapp/apps/personApp/person.html b/src/main/webapp/apps/personApp/person.html
index 2c0c3e7..5a8395e 100644
--- a/src/main/webapp/apps/personApp/person.html
+++ b/src/main/webapp/apps/personApp/person.html
@@ -5,20 +5,31 @@
</div>
<h3>Badges</h3>
+
<p ng-repeat="badge in person.badges">
<span class="badge-level-{{badge.level}} badge">{{badge.name}}</span><span ng-show="badge.count > 1"> x {{badge.count}}</span>
</p>
- <h3>Badges in progress</h3>
- <p ng-repeat="badge in person.badgesInProgress">
- <span class="badge badge-level-{{badge.level}}">{{badge.name}}</span> progress: {{badge.progress}} of {{badge.goal}}
- </p>
+ <div ng-repeat="badge in person.badgesInProgress">
+ <div class="progress">
+ <div class="bar" style="width: {{badge.progress / badge.goal * 100}}%;">{{badge.name}}</div>
+ </div>
+ </div>
- <h3>Builds</h3>
- <ul>
- <li ng-repeat="build in builds">
- {{build.uuid}}
- </li>
- </ul>
+ <h3>Recent builds</h3>
+ <table class="table">
+ <thead>
+ <tr>
+ <th>Date</th>
+ <th>Success</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr ng-repeat="build in builds" class="{{{true: 'success', false: 'error'}[build.success]}}">
+ <td>{{build.date | date:'medium'}}</td>
+ <td>{{build.success}}</td>
+ </tr>
+ </tbody>
+ </table>
</div>