This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository coselmar. See http://git.forge.codelutin.com/coselmar.git commit 785a5ebfa28f40a8f4e96435e5fcd0f98ec9d607 Author: Yannick Martel <martel@©odelutin.com> Date: Mon Feb 15 10:36:55 2016 +0100 refs #7975 display bibliography in modal instead of new page --- .../src/main/webapp/js/coselmar-controllers.js | 31 +++++++++++++++------- coselmar-ui/src/main/webapp/js/coselmar.js | 4 --- .../src/main/webapp/views/documents/documents.html | 2 +- .../{bibliography.html => modalBibliography.html} | 8 ++++-- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js index 5efec92..b77ebf4 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar-controllers.js +++ b/coselmar-ui/src/main/webapp/js/coselmar-controllers.js @@ -180,8 +180,8 @@ coselmarControllers.controller("homeConnectedCtrl", ['$scope', 'questionsService ///////////////////////////////////////////////// // Controller for All Documents View -coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routeParams', '$location', 'notify', 'documentService', 'errorService', - function($scope, $route, $routeParams, $location, notify, documentService, errorService){ +coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routeParams', '$location', '$uibModal', 'notify', 'documentService', 'errorService', + function($scope, $route, $routeParams, $location, $uibModal, notify, documentService, errorService){ $scope.$emit('dataLoading'); //manage keywords if given @@ -290,6 +290,19 @@ coselmarControllers.controller("DocumentsCtrl", ['$scope', '$route', '$routePara }); }); + $scope.modalDisplayBibliography = function () { + + var modalInstance = $uibModal.open({ + templateUrl: 'views/documents/modalBibliography.html', + controller: 'ModalDocumentsBibliographyCtrl', + size: 'lg', + resolve : { + searchModel : $scope.example + } + }); + + }; + }]); // Controller for new document View @@ -415,12 +428,9 @@ coselmarControllers.controller("NewDocumentCtrl", ['$scope', '$location', 'notif }]); // Controller for bibliography View -coselmarControllers.controller("DocumentsBibliographyCtrl", ['$scope', '$routeParams', 'documentService', 'errorService', - function($scope, $routeParams, documentService, errorService){ - - $scope.searchId = $routeParams.searchId; +coselmarControllers.controller("ModalDocumentsBibliographyCtrl", function($scope, $uibModalInstance, searchModel, documentService, errorService){ - $scope.example = JSON.parse(atob($scope.searchId)); + $scope.example = searchModel; { if (angular.isDate($scope.example.depositAfterDate)) { @@ -441,14 +451,17 @@ coselmarControllers.controller("DocumentsBibliographyCtrl", ['$scope', '$routeP $scope.$emit('dataLoading'); documentService.getSearchBibliography($scope.example, function(citations) { - console.log(citations); $scope.citations = citations; }, errorService.defaultFailOnCall, function() { $scope.$emit('dataLoaded'); }); }; -}]); + $scope.cancel = function () { + $uibModalInstance.dismiss('cancel'); + }; + +}); // Controller for single document View coselmarControllers.controller("DocumentViewCtrl", diff --git a/coselmar-ui/src/main/webapp/js/coselmar.js b/coselmar-ui/src/main/webapp/js/coselmar.js index ca5840e..8904db3 100644 --- a/coselmar-ui/src/main/webapp/js/coselmar.js +++ b/coselmar-ui/src/main/webapp/js/coselmar.js @@ -36,10 +36,6 @@ coselmarApp.config(['$routeProvider', function($routeProvider) { controller : 'NewDocumentCtrl', templateUrl : 'views/documents/newdocument.html' - }).when('/documents/bibliography/:searchId', { - controller : 'DocumentsBibliographyCtrl', - templateUrl : 'views/documents/bibliography.html' - }).when('/documents/:documentId', { controller : 'DocumentViewCtrl', templateUrl : 'views/documents/document.html' diff --git a/coselmar-ui/src/main/webapp/views/documents/documents.html b/coselmar-ui/src/main/webapp/views/documents/documents.html index cb8bb40..b5659a6 100644 --- a/coselmar-ui/src/main/webapp/views/documents/documents.html +++ b/coselmar-ui/src/main/webapp/views/documents/documents.html @@ -64,7 +64,7 @@ <pagination-tool></pagination-tool> <p ng-if="!paginationData || !paginationData.elements || paginationData.elements.length == 0" translate="common.search.noResult" class="info"/> <div ng-if="paginationData && paginationData.elements && paginationData.elements.length > 0" > - <a href="#/documents/bibliography/{{searchId}}" target="_blank" class="btn btn-primary"> + <a class="btn btn-primary" ng-click="modalDisplayBibliography()"> <span class="fa fa-book" aria-hidden="true"></span>{{ 'document.button.generateBibliography' | translate }}</button> </a> </div> diff --git a/coselmar-ui/src/main/webapp/views/documents/bibliography.html b/coselmar-ui/src/main/webapp/views/documents/modalBibliography.html similarity index 81% rename from coselmar-ui/src/main/webapp/views/documents/bibliography.html rename to coselmar-ui/src/main/webapp/views/documents/modalBibliography.html index 0b1b6e7..06f0bc1 100644 --- a/coselmar-ui/src/main/webapp/views/documents/bibliography.html +++ b/coselmar-ui/src/main/webapp/views/documents/modalBibliography.html @@ -23,16 +23,20 @@ --> <div> - <div class="page-header"> + <div class="modal-title"> <h1> <!-- Heading goes here --> {{ 'document.bibliography.title' | translate }} </h1> </div> - <div> + <div class="modal-body"> <ul> <li ng-repeat="citation in citations">{{citation}}</li> </ul> </div> + + <div class="modal-footer"> + <button class="btn btn-action btn-cancel" ng-click="cancel()">{{ 'common.button.close' | translate }}</button> + </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>.