diff --git a/docs-web/src/main/webapp/src/app/docs/controller/Document.js b/docs-web/src/main/webapp/src/app/docs/controller/Document.js index 6af0d944..551c1dcc 100644 --- a/docs-web/src/main/webapp/src/app/docs/controller/Document.js +++ b/docs-web/src/main/webapp/src/app/docs/controller/Document.js @@ -13,6 +13,7 @@ angular.module('docs').controller('Document', function($scope, $timeout, $state, $scope.currentPage = 1; $scope.limit = _.isUndefined(localStorage.documentsPageSize) ? 10 : localStorage.documentsPageSize; $scope.search = ''; + $scope.setSearch = function(search) { $scope.search = search }; // A timeout promise is used to slow down search requests to the server // We keep track of it for cancellation purpose @@ -101,4 +102,20 @@ angular.module('docs').controller('Document', function($scope, $timeout, $state, $scope.viewDocument = function(id) { $state.transitionTo('document.view', { id: id }); }; + + // Load tags + var tags = []; + Restangular.one('tag/list').getList().then(function(data) { + tags = data.tags; + }); + + /** + * Find children tags. + * @param parent + */ + $scope.getChildrenTags = function(parent) { + return _.filter(tags, function(tag) { + return tag.parent == parent; + }); + }; }); \ No newline at end of file diff --git a/docs-web/src/main/webapp/src/partial/docs/document.html b/docs-web/src/main/webapp/src/partial/docs/document.html index e4b91b11..ab403e40 100644 --- a/docs-web/src/main/webapp/src/partial/docs/document.html +++ b/docs-web/src/main/webapp/src/partial/docs/document.html @@ -5,49 +5,60 @@ Add a document
-