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 786d6c2840673c81abdc8715d13644748a4dcf7c Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Thu Jun 12 16:51:35 2014 +0200 delete member in voterList --- pollen-ui-angular/src/main/webapp/css/style.css | 10 +++++++++- .../src/main/webapp/js/controllers/pollCtrl.js | 17 +++++++++++++++++ .../src/main/webapp/partials/poll-listParticipant.html | 10 +++++----- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/pollen-ui-angular/src/main/webapp/css/style.css b/pollen-ui-angular/src/main/webapp/css/style.css index 144f707..6b8a543 100644 --- a/pollen-ui-angular/src/main/webapp/css/style.css +++ b/pollen-ui-angular/src/main/webapp/css/style.css @@ -249,10 +249,18 @@ i.icon-collapse { border:1px solid #DDD; } -input[type=number] { +.voterList tr th.weight, .voterList tr td.weight { + width:92px; +} + +.voterList tr th.weight input, .voterList tr td.weight input { width:80px; } +.voterList tr td.action { + width:53px; +} + hr { border-top:1px solid #CCCCCC; } \ No newline at end of file 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 26bea08..b6c1273 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -547,6 +547,23 @@ angular.module('pollControllers', []) } }; + $scope.deleteVoterListMember = function (member, voterList) { + if (angular.isDefined(voterList) && angular.isDefined(voterList.group.id)) { + var confirmMessage; + $translate('action.message.confirmDelete').then(function (msg) { + confirmMessage = msg; + }).then( function () { + var confirmDelete = confirm(confirmMessage); + if (confirmDelete == true) { + member.$remove({pollId:$routeParams.pollId, permission:$scope.globalVariables.permission, voterListId:voterList.group.id}, function (data) { + var index = voterList.members.indexOf(member); + voterList.members.splice(index, 1); + }); + } + }); + } + }; + //////////////////////////////// //// POLL ///// //////////////////////////////// diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html b/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html index 3a6cdf9..e36d9ee 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-listParticipant.html @@ -39,22 +39,22 @@ <tr ng-show="data.poll.pollType == 'GROUP'" ng-class="{'has-success':voterList.group.id && !voterList.group.restError}"> <th colspan="2" ng-class="{'has-error':voterList.group.restError.name}"> <input type="text" name="group" placeholder="name group" ng-model="voterList.group.name" class="form-control" auto-save="saveVoterList(voterList)"/></th> - <th ng-class="{'has-error':voterList.group.restError.weight}"> <input type="number" ng-model="voterList.group.weight" select-on-click class="form-control" auto-save="saveVoterList(voterList)" /> </th> - <th> </th> + <th class="weight" ng-class="{'has-error':voterList.group.restError.weight}"> <input type="number" ng-model="voterList.group.weight" select-on-click class="form-control" auto-save="saveVoterList(voterList)" /> </th> + <th class="action"> </th> </tr> <tr> <th> {{ 'poll.restricted.name' | translate }} </th> <th> {{ 'poll.restricted.mail' | translate }} </th> <th> {{ 'poll.restricted.weight' | translate }} </th> - <th> </th> + <th class="action"> </th> </tr> <tr ng-repeat="member in voterList.members" ng-class="{'has-success':member.id && !member.restError}"> <td> <div ng-class="{'has-error':member.restError.name}"><input type="text" ng-model="member.name" class="form-control" auto-save="saveVoterListMember(member, voterList)"/></div></td> <td> <div ng-class="{'has-error':member.restError.email}"><input type="text" ng-model="member.email" class="form-control" auto-save="saveVoterListMember(member, voterList)" /></div></td> - <td> <div ng-class="{'has-error':member.restError.weight}"><input type="number" ng-model="member.weight" select-on-click class="form-control" auto-save="saveVoterListMember(member, voterList)"/></div></td> - <th> <div ng-show="member.id"><button class="btn btn-danger" disabled>X</button> </div></th> + <td class="weight"> <div ng-class="{'has-error':member.restError.weight}"><input type="number" ng-model="member.weight" select-on-click class="form-control" auto-save="saveVoterListMember(member, voterList)"/></div></td> + <td class="action"> <div ng-show="member.id"><button class="btn btn-danger" ng-click="deleteVoterListMember(member, voterList);"><i class="glyphicon glyphicon-remove"></i></button></div></td> </tr> <tr> -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.