This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.codelutin.com/coselmar.git commit 441c2de27262be5d103212216d2361e1913df714 Author: Yannick Martel <martel@©odelutin.com> Date: Thu Dec 11 15:03:14 2014 +0100 prepare referential search --- coselmar-ui/src/main/webapp/index.html | 27 ++++++--- .../src/main/webapp/js/coselmar-controllers.js | 70 ++++++++++++++++++++++ coselmar-ui/src/main/webapp/js/coselmar.js | 5 ++ coselmar-ui/src/main/webapp/views/home.html | 15 ++--- .../main/webapp/views/referential/referential.html | 59 ++++++++++++++++++ 5 files changed, 162 insertions(+), 14 deletions(-) diff --git a/coselmar-ui/src/main/webapp/index.html b/coselmar-ui/src/main/webapp/index.html index d430a3e..7a9a43e 100644 --- a/coselmar-ui/src/main/webapp/index.html +++ b/coselmar-ui/src/main/webapp/index.html @@ -67,7 +67,7 @@ <span class="icon-bar"></span> <span class="icon-bar"></span> </button> - <a class="navbar-brand visible-xs" href="#">UI Bootstrap</a> + <a class="navbar-brand visible-xs" href="#">Coselmar Referential</a> </div> <nav class="hidden-xs"> <ul class="nav navbar-nav"> @@ -78,13 +78,16 @@ <li ng-if="currentUser"> <a href="#/documents" role="button" class="dropdown-toggle">Documents</a> </li> - <li class="dropdown"> - <a role="button" class="dropdown-toggle">Questions<span class="caret"></span></a> + <li class="dropdown" ng-if="currentUser"> + <a class="dropdown-toggle" data-toggle="dropdown">Questions<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> - <!--<li><a href="#/questions">List</a></li>--> - <li><a href="#/questions/new">Add a question</a></li> + <li><a href="#/questions" role="menuitem">List</a></li> + <li><a href="#/questions/new" role="menuitem" ng-if="currentUser.role == 'SUPERVISOR'">Add a question</a></li> </ul> </li> + <li ng-if="currentUser"> + <a href="#/referential" role="button" class="dropdown-toggle">Referential Search</a> + </li> </ul> <!-- Login Part --> @@ -116,8 +119,18 @@ </nav> <nav class="visible-xs" collapse="!isCollapsed"> <ul class="nav navbar-nav"> - <li><a href="#users" ng-click="isCollapsed = !isCollapsed">Users</a></li> - <li><a href="#documents" ng-click="isCollapsed = !isCollapsed">Documents</a></li> + <li ng-if="currentUser.role == 'ADMIN'"> + <a href="#users" ng-click="isCollapsed = !isCollapsed">Users</a> + </li> + <li ng-if="currentUser"> + <a href="#documents" ng-click="isCollapsed = !isCollapsed">Documents</a> + </li> + <li ng-if="currentUser"> + <a href="#question" ng-click="isCollapsed = !isCollapsed">Questions</a> + </li> + <li ng-if="currentUser"> + <a href="#referential" ng-click="isCollapsed = !isCollapsed">Referential</a> + </li> </ul> </nav> </div> diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 16017d1..db3f727 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -679,6 +679,76 @@ coselmarControllers.controller('ModalCreateDocumentsCtrl', function ($scope, $mo }); + +///////////////////////////////////////////////// +/////////// Referential Part ////////////////// +///////////////////////////////////////////////// + +// Controller for Referential Page +coselmarControllers.controller("ReferentialCtrl", ['$scope', '$routeParams', '$location', + function($scope, $routeParams, $location){ + + //manage keywords if given + $scope.search = { keywords : [], results : [], onDocuments: false, onQuestions: false }; + + var keywords = $routeParams.keywords; + if (Array.isArray(keywords)) { + $scope.search.keywords = keywords; + } else if (keywords) { + $scope.search.keywords.push(keywords); + } + + var onQuestions = $routeParams.onQuestions; + if (onQuestions) { + console.log(onQuestions); + $scope.search.onQuestions = onQuestions; + } + + var onDocuments = $routeParams.onDocuments; + if (onDocuments) { + $scope.search.onDocuments = onDocuments; + } + + var remoteSearchInReferential = function() { + console.log("TODO : call server"); +// referentialService.find($scope.search, function(results) { +// +// $scope.search.results = results +// +// }, function(error) { +// //TODO ymartel 20141211 : deal with error.status or statusText +// console.log("error occurs"); +// console.log(error.s); +// } +// ); + }; + + remoteSearchInReferential(); + + $scope.searchInReferential = function(){ + + if ($scope.search.keywords) { + $location.search('keywords', $scope.search.keywords); + } else { + $location.search('keywords', null); + } + + if ($scope.search.onDocuments) { + $location.search('onDocuments', $scope.search.onDocuments); + } else { + $location.search('onDocuments', null); + } + + if ($scope.search.onQuestions) { + $location.search('onQuestions', $scope.search.onQuestions); + } else { + $location.search('onQuestions', null); + } + }; + +}]); + + /** * AngularJS default filter with the following expression: * "person in people | filter: {name: $select.search, age: $select.search}" diff --git a/coselmar-ui/src/main/webapp/js/coselmar.js b/coselmar-ui/src/main/webapp/js/coselmar.js index 208594c..8373782 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar.js +++ b/coselmar-ui/src/main/webapp/js/coselmar.js @@ -64,6 +64,11 @@ coselmarApp.config(['$routeProvider', function($routeProvider) { controller : 'QuestionCtrl', templateUrl : 'views/questions/question.html' + // Referential search + }).when('/referential', { + controller : 'ReferentialCtrl', + templateUrl : 'views/referential/referential.html' + }).otherwise({ redirectTo: '/', diff --git a/coselmar-ui/src/main/webapp/views/home.html b/coselmar-ui/src/main/webapp/views/home.html index 9fe01ba..53b06fc 100644 --- a/coselmar-ui/src/main/webapp/views/home.html +++ b/coselmar-ui/src/main/webapp/views/home.html @@ -26,8 +26,8 @@ <p style="margin-top: 50px;"> L'application a pour but de faciliter le suivi des demandes d'expertises - scientifiques et de fournir un référentiel de documents, permettant de - faciliter les réponses aux demandes. + scientifiques et de fournir un référentiel de documents, permettant de + faciliter les réponses aux demandes. </p> <p> @@ -35,13 +35,14 @@ <ul> <li>ajouter et consulter des documents ;</li> <li>avoir une gestion d'utilisateurs suivant 5 profils : admin, responsable, expert, membre, client ;</li> - <li>limiter la visibilité d'un document.</li> + <li>limiter la visibilité d'un document.</li> + <li>déposer une demande/question ;</li> + <li>associer des experts scientifiques à une demande/question ;</li> + <li>apporter une réponse avec compte-rendu et documents à une demande/question ;</li> </ul> - À terme, elle permettra de : + À terme, elle permettra de : <ul> - <li>déposer une demande d'expertise ;</li> - <li>mettre en relation les experts scientifiques pour répondre à une demande ;</li> - <li>apporter une réponse avec compte-rendu et documents à une demande d'expertise ;</li> + <li>faire une recherche globale sur le référentiel document/question</li> </ul> </p> </div> diff --git a/coselmar-ui/src/main/webapp/views/referential/referential.html b/coselmar-ui/src/main/webapp/views/referential/referential.html new file mode 100644 index 0000000..73901e2 --- /dev/null +++ b/coselmar-ui/src/main/webapp/views/referential/referential.html @@ -0,0 +1,59 @@ +<div style="padding: 0px 0px 0px 30px"> + <div class="page-header" style="margin: 0"> + <h2>Ask the Referential</h2> + </div> + + <!-- Search Line --> + <div class="form-group row"> + <label class="col-md-2 control-label">Keywords</label> + + <div class="col-md-4"> + <input type="text" class="form-control" name="keywords" ng-minlength="10" + ng-model="search.keywords" ng-list placeholder="keyword 1, keyword2"/> + </div> + + <div class="col-md-2"> + <label> + <input type="checkbox" name="onDocuments" ng-model="search.onDocuments" /> + documents + </label> + </div> + + <div class="col-md-2"> + <label> + <input type="checkbox" name="onQuestions" ng-model="search.onQuestions" /> + questions + </label> + </div> + + <div class="col-md-2"> + <a class="btn btn-action btn-success" ng-click="searchInReferential()"> + <span class="fa fa-search" aria-hidden="true"></span>Search + </a> + + </div> + + </div> + <!-- End Search Line --> + + <div class=""> + + <table class="table"> + <tr> + <th>Type</th> + <th>Title</th> + <th>Deposit Date</th> + <th>Head</th> + </tr> + <tr ng-repeat="content in search.results"> + <td>{{content.type}}</td> + <td ng-if="content.type.toLowerCase() == 'document'"><a href="#/documents/{{content.id}}">{{content.title}}</a></td> + <td ng-if="content.type.toLowerCase() == 'question'"><a href="#/questions/{{content.id}}">{{content.title}}</a></td> + <td>{{content.depositDate}}</td> + <td>{{content.head}}</td> + </tr> + </table> + + </div> + +</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>.