diff --git a/docs-parent/TODO b/docs-parent/TODO index 761c77da..27e966ce 100644 --- a/docs-parent/TODO +++ b/docs-parent/TODO @@ -1,4 +1,3 @@ - Client/server side search on tags -- Client side search on creation date - Client/server side edition of existing tag names - Server side reordering files \ 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 c543450e..7912a107 100644 --- a/docs-web/src/main/webapp/index.html +++ b/docs-web/src/main/webapp/index.html @@ -45,8 +45,8 @@ diff --git a/docs-web/src/main/webapp/js/controller/Document.js b/docs-web/src/main/webapp/js/controller/Document.js index 4b98f5bd..9ac30679 100644 --- a/docs-web/src/main/webapp/js/controller/Document.js +++ b/docs-web/src/main/webapp/js/controller/Document.js @@ -12,6 +12,19 @@ App.controller('Document', function($scope, $state, Restangular) { $scope.offset = 0; $scope.currentPage = 1; $scope.limit = 10; + $scope.isAdvancedSearchCollapsed = true; + + /** + * Initialize search criterias. + */ + $scope.initSearch = function() { + $scope.search = { + query: '', + createDateMin: null, + createDateMax: null, + }; + }; + $scope.initSearch(); /** * Load new documents page. @@ -23,10 +36,13 @@ App.controller('Document', function($scope, $state, Restangular) { limit: $scope.limit, sort_column: $scope.sortColumn, asc: $scope.asc, - search: $scope.search + search: $scope.search.query, + create_date_min: $scope.isAdvancedSearchCollapsed || !$scope.search.createDateMin ? null : $scope.search.createDateMin.getTime(), + create_date_max: $scope.isAdvancedSearchCollapsed || !$scope.search.createDateMax ? null : $scope.search.createDateMax.getTime() }) .then(function(data) { - $scope.documents = data; + $scope.documents = data.documents; + $scope.totalDocuments = data.total; $scope.numPages = Math.ceil(data.total / $scope.limit); }); }; @@ -43,16 +59,20 @@ App.controller('Document', function($scope, $state, Restangular) { /** * Watch for current page change. */ - $scope.$watch('currentPage', function() { + $scope.$watch('currentPage', function(prev, next) { + if (prev == next) { + return; + } $scope.offset = ($scope.currentPage - 1) * $scope.limit; $scope.pageDocuments(); }); + /** + * Watch for search change. + */ $scope.$watch('search', function(prev, next) { - if (next) { - $scope.loadDocuments(); - } - }) + $scope.loadDocuments(); + }, true); /** * Sort documents. diff --git a/docs-web/src/main/webapp/partial/directive.selecttag.html b/docs-web/src/main/webapp/partial/directive.selecttag.html index fff67b78..a98fe3ae 100644 --- a/docs-web/src/main/webapp/partial/directive.selecttag.html +++ b/docs-web/src/main/webapp/partial/directive.selecttag.html @@ -3,7 +3,7 @@
  • {{ tag.name }}
  • - +

    \ 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 9323d8cd..7460b210 100644 --- a/docs-web/src/main/webapp/partial/document.default.html +++ b/docs-web/src/main/webapp/partial/document.default.html @@ -1,5 +1,5 @@

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

    diff --git a/docs-web/src/main/webapp/partial/document.edit.html b/docs-web/src/main/webapp/partial/document.edit.html index a5a8b6af..f5b0e06a 100644 --- a/docs-web/src/main/webapp/partial/document.edit.html +++ b/docs-web/src/main/webapp/partial/document.edit.html @@ -14,7 +14,7 @@
    - +
    diff --git a/docs-web/src/main/webapp/partial/document.html b/docs-web/src/main/webapp/partial/document.html index c88d02a8..5c40ef0e 100644 --- a/docs-web/src/main/webapp/partial/document.html +++ b/docs-web/src/main/webapp/partial/document.html @@ -4,10 +4,28 @@

    -

    +

    - + +

    +
    +
    +
    +
    + +
    + + to + +
    +
    +
    + +
    +
    +
    +
    @@ -16,7 +34,7 @@ - + diff --git a/docs-web/src/main/webapp/partial/tag.html b/docs-web/src/main/webapp/partial/tag.html index c343de39..a6b7d499 100644 --- a/docs-web/src/main/webapp/partial/tag.html +++ b/docs-web/src/main/webapp/partial/tag.html @@ -1,6 +1,6 @@
    -
    +

    diff --git a/docs-web/src/main/webapp/style/main.less b/docs-web/src/main/webapp/style/main.less index 194a3fc8..c8cd794a 100644 --- a/docs-web/src/main/webapp/style/main.less +++ b/docs-web/src/main/webapp/style/main.less @@ -13,13 +13,14 @@ cursor: pointer; } -/*.thumbnails-file li.thumbnail-container { - &:nth-child(6n+1) { - margin-left: 0; - } -}*/ - - .thumbnails-file [class*="span"]:first-child { margin-left: 2.5641%; +} + +.collapse[style="height: auto;"] { + overflow: visible; +} + +input[readonly][datepicker-popup] { + cursor: pointer; } \ No newline at end of file

    {{ document.title }} {{ document.create_date | date: 'yyyy-MM-dd' }}