This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See http://git.chorem.org/pollen.git commit 5dc6870de2da8ef7b26973d06fb7bd0f3fae6dab Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Wed Jun 11 15:53:17 2014 +0200 delete comment --- .../src/main/webapp/js/controllers/pollCtrl.js | 24 ++++++++++++++++++++-- .../src/main/webapp/partials/poll-settings.html | 3 ++- 2 files changed, 24 insertions(+), 3 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 0ba25a4..4c4e66b 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -657,8 +657,8 @@ angular.module('pollControllers', []) }]) .controller('PollCommentCtrl', - ['$scope', '$controller', '$routeParams', 'Poll', 'PollComment', - function ( $scope, $controller, $routeParams, Poll, PollComment ) { + ['$scope', '$controller', '$routeParams', 'Poll', 'PollComment', '$translate', + function ( $scope, $controller, $routeParams, Poll, PollComment, $translate) { $controller('PollCtrl', {$scope:$scope}); $scope.tab = $scope.setTab('comment'); @@ -762,6 +762,26 @@ angular.module('pollControllers', []) $scope.comment = angular.copy(comment); $scope.comment.page = paginationParameter.pageNumber; } + + $scope.deletePost = function (comment) { + var confirmMessage; + $translate('action.message.confirmDelete').then(function (msg) { + confirmMessage = msg; + }).then( function () { + var confirmDelete = confirm(confirmMessage); + if (confirmDelete == true) { + PollComment.remove({pollId:$routeParams.pollId, permission:$scope.globalVariables.permission, commentId:comment.id}, function (data) { + initComments().then(function () { + if ($scope.data.comments.length == 0 && paginationParameter.pageNumber > 0) { + // no comment and not the first page + $scope.data.commentsPagination.currentPage = paginationParameter.pageNumber - 1; + } + }); + }); + } + }); + } + }]) .controller('PollResultCtrl', ['$scope', '$q', '$controller', '$routeParams', 'Poll', 'PollChoice', 'PollVote', function ($scope, $q, $controller, $routeParams, Poll, PollChoice, PollVote) { diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-settings.html b/pollen-ui-angular/src/main/webapp/partials/poll-settings.html index 590a527..ed890b0 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-settings.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-settings.html @@ -19,7 +19,7 @@ #L% --> - +<form class="form-horizontal"> <h4>Confiuration global</h4> <div class="form-group"> @@ -156,3 +156,4 @@ <button class="btn btn-default" ng-model="data.poll.anonymousVoteAllowed" btn-radio="false">Non</button> </div> </div> +</form> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.