This is an automated email from the git hooks/post-receive script. New commit to branch feature/editVote in repository pollen. See http://git.chorem.org/pollen.git commit 0778ebc7e923cef53e2ea2e764e572635a9d40b9 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Jul 31 14:21:38 2014 +0200 add message with url for clone poll and change order alert --- .../src/main/webapp/js/controllers/pollCtrl.js | 22 +++++++++++++++------- .../src/main/webapp/partials/poll-list.html | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js index c78c1a7..72d8ac9 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -31,8 +31,8 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr ////////////////////////////////// .controller('PollCtrl', - ['$scope', '$rootScope', '$controller', '$sce', '$timeout', '$routeParams', '$location', 'SessionStorage', '$translate', '$route', '$q', 'Poll', 'PollenResource', 'Page', 'DateFormat', - function ( $scope, $rootScope, $controller, $sce, $timeout, $routeParams, $location, SessionStorage, $translate, $route, $q, Poll, PollenResource, Page, DateFormat) { + ['$scope', '$rootScope', '$controller', '$sce', '$timeout', '$routeParams', '$location', 'SessionStorage', '$translate', '$filter', '$route', '$q', 'Poll', 'PollenResource', 'Page', 'DateFormat', + function ( $scope, $rootScope, $controller, $sce, $timeout, $routeParams, $location, SessionStorage, $translate, $filter, $route, $q, Poll, PollenResource, Page, DateFormat) { $scope.setTab = function (defaultValue) { if (angular.isDefined($route.current)) { @@ -322,8 +322,15 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.clonePoll = function () { if (angular.isDefined($scope.data.poll.id)) { Poll.clone({pollId: $scope.data.poll.id, permission: $scope.globalVariables.pollToken}, {}, function (data) { + $rootScope.$broadcast('newInfo', + $filter('translate')('poll.created.printLink', {url: + '<input type="text" class="form-control" value="' + + $scope.globalVariables.baseUrl+'#/poll/edit/'+data.id+'/'+data.permission + + '" readonly />' + }) + , -1); $rootScope.$broadcast('newSuccess', 'poll.cloned'); - $location.url('/poll/edit/'+data.id); + $location.url('/poll/edit/'+data.id+'/'+data.permission); $route.reload(); }); } @@ -724,7 +731,6 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr } Poll.add(poll, function (data) { - $rootScope.$broadcast('newSuccess', 'poll.saved'); $rootScope.$broadcast('newInfo', $filter('translate')('poll.created.printLink', {url: '<input type="text" class="form-control" value="' + @@ -732,6 +738,7 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr '" readonly />' }) , -1); + $rootScope.$broadcast('newSuccess', 'poll.saved'); if ($scope.data.poll.pollType != 'FREE') { SessionStorage.save({'voterList':$scope.data.voterList}) $location.url('/poll/edit/'+data.id+'/'+data.permission); @@ -1176,15 +1183,16 @@ angular.module('pollControllers', ['ngRoute', 'pollenServices', 'pascalprecht.tr $scope.data.votants.push(newVote); }) - $rootScope.$broadcast('newSuccess', 'vote.added'); - initVote(); - $rootScope.$broadcast('newInfo', $filter('translate')('vote.added.printLink', {url: '<input type="text" class="form-control" value="' + $scope.globalVariables.baseUrl+'#/poll/vote/'+$routeParams.pollId+'/'+ returnRequest.permission + '" readonly />'}) , -1); + + $rootScope.$broadcast('newSuccess', 'vote.added'); + initVote(); + $location.url('/poll/vote/'+$routeParams.pollId+'/'+ returnRequest.permission); }, function (error) { if (angular.isDefined(error.data["voter.name"])) { diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-list.html b/pollen-ui-angular/src/main/webapp/partials/poll-list.html index 7eb9ed2..dd5b175 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-list.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-list.html @@ -33,7 +33,7 @@ <div ng-bind-html="toHTML(poll.description)"></div> </td> </tr> - <tr ng-show="data.polls.length > 1"> + <tr ng-show="data.polls.length > 0"> <td colspan="3"> <button class="btn btn-default" ng-click="selectAll()"><span class="glyphicon glyphicon-check"></span> {{ 'action.selectAll' | translate }}</button> <button class="btn btn-default" ng-click="unselectAll()"><span class="glyphicon glyphicon-unchecked"></span> {{ 'action.unselectAll' | translate }}</button> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.