From 2e958034244d9d4bdc3a1c855ad7aa69ab40ed91 Mon Sep 17 00:00:00 2001 From: jendib Date: Thu, 1 Aug 2013 13:53:52 +0200 Subject: [PATCH] Document count and general data on default page --- docs-parent/TODO | 1 - docs-web/src/main/webapp/index.html | 1 + docs-web/src/main/webapp/js/app.js | 3 ++- .../main/webapp/js/controller/DocumentDefault.js | 9 +++++++++ .../src/main/webapp/partial/document.default.html | 13 +++++++++++-- 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 docs-web/src/main/webapp/js/controller/DocumentDefault.js diff --git a/docs-parent/TODO b/docs-parent/TODO index 726b0eb7..dc04a294 100644 --- a/docs-parent/TODO +++ b/docs-parent/TODO @@ -1,3 +1,2 @@ - Reordering files (server) -- GET /app/stats to display general data (server/client) - User settings \ No newline at end of file diff --git a/docs-web/src/main/webapp/index.html b/docs-web/src/main/webapp/index.html index 363751a2..f0f710eb 100644 --- a/docs-web/src/main/webapp/index.html +++ b/docs-web/src/main/webapp/index.html @@ -28,6 +28,7 @@ + diff --git a/docs-web/src/main/webapp/js/app.js b/docs-web/src/main/webapp/js/app.js index 5405f8fa..96d22b8b 100644 --- a/docs-web/src/main/webapp/js/app.js +++ b/docs-web/src/main/webapp/js/app.js @@ -43,7 +43,8 @@ var App = angular.module('docs', ['ui.state', 'ui.bootstrap', 'ui.route', 'ui.ke url: '', views: { 'document': { - templateUrl: 'partial/document.default.html' + templateUrl: 'partial/document.default.html', + controller: 'DocumentDefault' } } }) diff --git a/docs-web/src/main/webapp/js/controller/DocumentDefault.js b/docs-web/src/main/webapp/js/controller/DocumentDefault.js new file mode 100644 index 00000000..37772c00 --- /dev/null +++ b/docs-web/src/main/webapp/js/controller/DocumentDefault.js @@ -0,0 +1,9 @@ +'use strict'; + +/** + * Document default controller. + */ +App.controller('DocumentDefault', function($scope, $state, Restangular) { + // Load app data + $scope.app = Restangular.one('app').get(); +}); \ No newline at end of file diff --git a/docs-web/src/main/webapp/partial/document.default.html b/docs-web/src/main/webapp/partial/document.default.html index 7460b210..ccf0bedf 100644 --- a/docs-web/src/main/webapp/partial/document.default.html +++ b/docs-web/src/main/webapp/partial/document.default.html @@ -1,8 +1,17 @@

- {{ totalDocuments }} document{{ totalDocuments > 1 ? 's' : '' }} in the database + {{ app.document_count }} document{{ app.document_count > 1 ? 's' : '' }} in the database

-

There seems to be a kind of order in the universe, in the movement of the stars and the turning of the earth and the changing of the seasons, and even in the cycle of human life. But human life itself is almost pure chaos. Everyone takes his stance, asserts his own rights and feelings, mistaking the motives of others, and his own.

+

There seems to be a kind of order in the universe, but human life itself is almost pure chaos.

Katherine Anne Porter
+ +
+ +
+ +
\ No newline at end of file