Document count and general data on default page

This commit is contained in:
jendib 2013-08-01 13:53:52 +02:00
parent 9e5459cafe
commit 2e95803424
5 changed files with 23 additions and 4 deletions

View File

@ -1,3 +1,2 @@
- Reordering files (server) - Reordering files (server)
- GET /app/stats to display general data (server/client)
- User settings - User settings

View File

@ -28,6 +28,7 @@
<script src="js/app.js" type="text/javascript"></script> <script src="js/app.js" type="text/javascript"></script>
<script src="js/controller/Main.js" type="text/javascript"></script> <script src="js/controller/Main.js" type="text/javascript"></script>
<script src="js/controller/Document.js" type="text/javascript"></script> <script src="js/controller/Document.js" type="text/javascript"></script>
<script src="js/controller/DocumentDefault.js" type="text/javascript"></script>
<script src="js/controller/DocumentEdit.js" type="text/javascript"></script> <script src="js/controller/DocumentEdit.js" type="text/javascript"></script>
<script src="js/controller/DocumentView.js" type="text/javascript"></script> <script src="js/controller/DocumentView.js" type="text/javascript"></script>
<script src="js/controller/FileView.js" type="text/javascript"></script> <script src="js/controller/FileView.js" type="text/javascript"></script>

View File

@ -43,7 +43,8 @@ var App = angular.module('docs', ['ui.state', 'ui.bootstrap', 'ui.route', 'ui.ke
url: '', url: '',
views: { views: {
'document': { 'document': {
templateUrl: 'partial/document.default.html' templateUrl: 'partial/document.default.html',
controller: 'DocumentDefault'
} }
} }
}) })

View File

@ -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();
});

View File

@ -1,8 +1,17 @@
<h1> <h1>
{{ totalDocuments }} <small>document{{ totalDocuments > 1 ? 's' : '' }} in the database</small> {{ app.document_count }} <small>document{{ app.document_count > 1 ? 's' : '' }} in the database</small>
</h1> </h1>
<blockquote class="pull-right"> <blockquote class="pull-right">
<p>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.</p> <p>There seems to be a kind of order in the universe, but human life itself is almost pure chaos.</p>
<small>Katherine Anne Porter</small> <small>Katherine Anne Porter</small>
</blockquote> </blockquote>
<div class="clearfix"></div>
<div class="muted">
<ul class="inline">
<li><strong>Version:</strong> {{ app.current_version }}</li>
<li><strong>Memory:</strong> {{ app.free_memory / 1000000 | number: 0 }}/{{ app.total_memory / 1000000 | number: 0 }} MB</li>
</ul>
</div>