This is an automated email from the git hooks/post-receive script. New commit to branch feature/7644-recherche-avancée-documents in repository coselmar. See http://git.codelutin.com/coselmar.git commit 06dc1e766f160f90d2a8cac798c76b2ebe3da1b0 Author: Yannick Martel <martel@©odelutin.com> Date: Wed Dec 9 13:05:51 2015 +0100 refs-10 #7778 Prepare la recherche avancée sur les documents --- .../src/main/webapp/js/coselmar-controllers.js | 13 +++-- .../src/main/webapp/views/documents/documents.html | 17 +----- .../src/main/webapp/views/documents/toolsPart.html | 65 ++++++++++++++++++++++ 3 files changed, 74 insertions(+), 21 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index b690efe..2426648 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -156,15 +156,17 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara function($scope, $route, $routeParams, $location, notify, documentService, errorService){ //manage keywords if given - $scope.searchKeywords = []; + $scope.search = { searchKeywords : []}; + $scope.example = { active : "true", role : 'ALL'}; + var keywords = $routeParams.keywords; if (Array.isArray(keywords)) { - $scope.searchKeywords = keywords; + $scope.search.searchKeywords = keywords; } else if (keywords) { - $scope.searchKeywords.push(keywords); + $scope.search.searchKeywords.push(keywords); } - documentService.getDocuments($scope.searchKeywords, function(documents) { + documentService.getDocuments($scope.search.searchKeywords, function(documents) { $scope.documents = documents; }, errorService.defaultFailOnCall); @@ -185,7 +187,7 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara }; $scope.searchDocuments = function(){ - $location.search('keywords', $scope.searchKeywords); + $location.search('keywords', $scope.search.searchKeywords); }; }]); @@ -574,7 +576,6 @@ coselmarControllers.controller("UsersCtrl", ['$scope', '$route', '$routeParams', }; $scope.searchUsers = function(){ - console.log("launch search"); $location.search('keywords', $scope.search.searchKeyword); $location.search('showDisable', $scope.search.showDisable); }; diff --git a/coselmar-ui/src/main/webapp/views/documents/documents.html b/coselmar-ui/src/main/webapp/views/documents/documents.html index a42e6ed..5578226 100644 --- a/coselmar-ui/src/main/webapp/views/documents/documents.html +++ b/coselmar-ui/src/main/webapp/views/documents/documents.html @@ -29,22 +29,9 @@ </h1> </div> + <div> - <div> - <div class="form-group" ng-if="context.currentUser.role == 'EXPERT' || context.currentUser.role == 'SUPERVISOR'"> - <a href="#/documents/new" class="form-inline navbar-left btn btn-primary">{{ 'document.button.add' | translate}}</a> - </div> - <form class="form-inline pull-right search-zone" role="documentOptions" ng-submit="searchDocuments()"> - <div class="form-group"> - <span class="fa fa-info-circle" tooltip-placement="bottom" tooltip-html-unsafe="{{ 'common.message.info.searchKeywords' | translate }}"></span> - <input type="search" class="form-control" placeholder="keyword1,keyword2,..." ng-model="searchKeywords" ng-list /> - </div> - <div class="form-group"> - <button type="submit" class="btn btn-primary glyphicon glyphicon-search"></button> - </div> - </form> - </div> - <br/> + <div ng-include="src='views/documents/toolsPart.html'"></div> <table class="table"> <thead> <tr> diff --git a/coselmar-ui/src/main/webapp/views/documents/toolsPart.html b/coselmar-ui/src/main/webapp/views/documents/toolsPart.html new file mode 100644 index 0000000..aba3898 --- /dev/null +++ b/coselmar-ui/src/main/webapp/views/documents/toolsPart.html @@ -0,0 +1,65 @@ +<!-- + #%L + Coselmar :: UI + $Id:$ + $HeadURL:$ + %% + Copyright (C) 2014 - 2015 Ifremer, Code Lutin + %% + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public + License along with this program. If not, see + <http://www.gnu.org/licenses/gpl-3.0.html>. + #L% + --> + +<div> + <!-- New Document --> + <div class="form-group"> + <div class="form-group" ng-if="context.currentUser.role == 'EXPERT' || context.currentUser.role == 'SUPERVISOR'"> + <a href="#/documents/new" class="form-inline navbar-left btn btn-primary">{{ 'document.button.add' | translate}}</a> + </div> + + <!-- Simple search part --> + + <form class="form-inline pull-right search-zone" role="documentOptions" ng-submit="searchDocuments()" ng-show="!advanced"> + <div class="form-group"> + <span class="fa fa-info-circle" tooltip-placement="bottom" + tooltip-html-unsafe="{{ 'common.message.info.searchKeywords' | translate }}"></span> + <input type="search" class="form-control" placeholder="keyword1,keyword2,..." ng-model="search.searchKeywords" ng-list /> + </div> + <div class="form-group"> + <button type="submit" class="btn btn-primary fa fa-search"></button> + </div> + <div class="form-group" ng-show="!advanced"> + <a ng-click="advanced=true" class="btn btn-action"> + <span class="fa fa-expand" aria-hidden="true"></span> + {{'common.button.advanceSearch' | translate }} + </a> + </div> + </form> + + </div> +</div> + +<div class="text-right clear"> +</div> + +<!-- Advanced Search part --> +<div ng-show="advanced" class="search-zone marginVertical20"> + <div class="form-group text-right"> + <a ng-click="advanced=false" class="btn btn-action"><span class="fa fa-compress" aria-hidden="true"></span> {{ 'common.button.simpleSearch' | translate }}</a> + </div> + <form class="form-horizontal" name="userFullOption" role="userFullOptions" ng-submit="advancedSearchDocuments()"> + + </form> +</div> \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.