diff --git a/src/main/resources/static/css/app.css b/src/main/resources/static/css/app.css new file mode 100644 index 0000000..0c5fdb0 --- /dev/null +++ b/src/main/resources/static/css/app.css @@ -0,0 +1,12 @@ +body { + padding-top: 20px; + font-family: "Helvetica Neue",Helvetica,Arial,sans-serif; +} + +.burp { + margin-bottom: 2em; +} + +.burp .date { + text-decoration: underline overline; +} \ No newline at end of file diff --git a/src/main/resources/static/favicon.ico b/src/main/resources/static/favicon.ico new file mode 100644 index 0000000..d49b435 Binary files /dev/null and b/src/main/resources/static/favicon.ico differ diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html new file mode 100644 index 0000000..e0dcefb --- /dev/null +++ b/src/main/resources/static/index.html @@ -0,0 +1,24 @@ + + + + + + +BURP: Bayer Ubiquitous Rating Platform + + + + + + + + + + + + + +
+ + + \ No newline at end of file diff --git a/src/main/resources/static/js/app.js b/src/main/resources/static/js/app.js new file mode 100644 index 0000000..25fcc7d --- /dev/null +++ b/src/main/resources/static/js/app.js @@ -0,0 +1,13 @@ +var burpApp = angular.module('burpApp', ['ngRoute', 'burpControllers' ]); + +burpApp.config([ '$routeProvider', function($routeProvider) { + $routeProvider.when('/list', { + templateUrl : 'partials/list.html', + controller : 'BurpListCtrl' + }).when('/tag/:taggedBurps*', { + templateUrl : 'partials/tag.html', + controller : 'TagCtrl' + }).otherwise({ + redirectTo : '/list' + }); +} ]); diff --git a/src/main/resources/static/js/controllers.js b/src/main/resources/static/js/controllers.js new file mode 100644 index 0000000..2e8f68b --- /dev/null +++ b/src/main/resources/static/js/controllers.js @@ -0,0 +1,29 @@ +var burpControllers = angular.module('burpControllers', ['ngResource']); + +burpControllers.controller('BurpListCtrl', [ '$scope', '$resource', function($scope, $resource) { + + var burps = $resource('/burps/search/findFirst8ByOrderByTimestampDesc').get(); + + burps.$promise.then(function(data) { + $scope.burps = burps._embedded.burps; + + for (var i = 0; i < $scope.burps.length; i++) { + $scope.burps[i].user = $resource($scope.burps[i]._links.user.href).get(); + $scope.burps[i].tags = $resource($scope.burps[i]._links.tags.href).get(); + } + }); +} ]); + +burpControllers.controller('TagCtrl', [ '$scope', '$routeParams', '$resource', function($scope, $routeParams, $resource) { + + var burpsList = $resource($routeParams.taggedBurps).get(); + burpsList.$promise.then(function(data) { + $scope.burps = burpsList._embedded.burps; + + for (var i = 0; i < $scope.burps.length; i++) { + $scope.burps[i].user = $resource($scope.burps[i]._links.user.href).get(); + $scope.burps[i].tags = $resource($scope.burps[i]._links.tags.href).get(); + } + }); + +} ]); diff --git a/src/main/resources/static/partials/list.html b/src/main/resources/static/partials/list.html new file mode 100644 index 0000000..0486012 --- /dev/null +++ b/src/main/resources/static/partials/list.html @@ -0,0 +1,19 @@ +
+
+
+
+
{{burp.user.name}}
+
{{burp.timestamp | date:'HH:mm:ss dd.MM.yyyy'}}
+
{{burp.text}}
+ + #{{tag.name}} + +
+ +
+
{{burps | json}}
+
+ +
+
+
diff --git a/src/main/resources/static/partials/tag.html b/src/main/resources/static/partials/tag.html new file mode 100644 index 0000000..879d4a5 --- /dev/null +++ b/src/main/resources/static/partials/tag.html @@ -0,0 +1,15 @@ +
+
+
+
+
{{burp.user.name}}
+
{{burp.timestamp | date:'HH:mm:ss dd.MM.yyyy'}}
+
{{burp.text}}
+ + #{{tag.name}} + +
+
+
+
+ \ No newline at end of file