This is an automated email from the git hooks/post-receive script. unknown user pushed a commit to branch devel in repository Pollen. commit 0e7fbcdc3ee0fda1700d6a17cac60a377e6fd11f Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Tue May 20 15:08:35 2014 +0200 change fonction name for save and delete poll --- .../src/main/webapp/js/controllers/pollCtrl.js | 14 +++++++------- pollen-ui-angular/src/main/webapp/partials/big-poll.html | 12 +++++++----- .../src/main/webapp/partials/inline-poll.html | 4 ++-- pollen-ui-angular/src/main/webapp/partials/poll.html | 10 ++++++---- 4 files changed, 22 insertions(+), 18 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 e4227df..a607ec8 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -181,7 +181,7 @@ angular.module('pollControllers', []) } initPoll(); - $scope.save = function () { + $scope.savePoll = function () { var poll = angular.copy($scope.data.poll); poll.choice = angular.copy($scope.data.choices); Poll.add(poll, function (data) { @@ -198,7 +198,7 @@ angular.module('pollControllers', []) }); } - $scope.delete = function () { + $scope.deletePoll = function () { $scope.data.poll = initPoll(); } @@ -229,7 +229,7 @@ angular.module('pollControllers', []) } $scope.deleteChoice = function (choice) { - PollChoice.delete({pollId:$routeParams.pollId, permission:$routeParams.token, choiceId: choice.id}, function () { + PollChoice.remove({pollId:$routeParams.pollId, permission:$routeParams.token, choiceId: choice.id}, function () { $scope.globalVariables.saved = true; var index = $scope.data.choices.indexOf(choice); if (index > -1) { @@ -247,12 +247,12 @@ angular.module('pollControllers', []) PollChoice.query({pollId:$routeParams.pollId}).$promise.then(function (choices) { $scope.data.choices = choices; $scope.data.vote = {}; - $scope.data.vote.choices = $scope.data.choices; + $scope.data.vote.choice = $scope.data.choices; }); } initPoll(); - $scope.save = function () { + $scope.savePoll = function () { $scope.data.poll.$update({permission:$routeParams.token}, function (data) { $scope.globalVariables.saved = true; }, function (error) { @@ -271,8 +271,8 @@ angular.module('pollControllers', []) } } - $scope.delete = function () { - $scope.data.poll.$delete({permission:$routeParams.token}, function() { + $scope.deletePoll = function () { + $scope.data.poll.$remove({permission:$routeParams.token}, function() { $location.path('/'); }); } diff --git a/pollen-ui-angular/src/main/webapp/partials/big-poll.html b/pollen-ui-angular/src/main/webapp/partials/big-poll.html index ea0c8f5..66c5901 100644 --- a/pollen-ui-angular/src/main/webapp/partials/big-poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/big-poll.html @@ -52,15 +52,17 @@ </div> </div> <p collapse="!globalVariables.editMode && !showChoiceDesc" edit-me="showEditChoiceDesc" ng-hide="showEditChoiceDesc">{{choice.description}}</p> - <p ng-show="globalVariables.editMode && showEditChoiceDesc"><textarea ng-model="choice.description" focus-me="showEditChoiceDesc" ng-blur="showEditChoiceDesc = false" auto-save="saveChoice(choice)" cols="80" rows="8"></textarea></p> + <p ng-show="globalVariables.editMode && showEditChoiceDesc"> + <textarea ng-model="choice.description" focus-me="showEditChoiceDesc" ng-blur="showEditChoiceDesc = false" auto-save="saveChoice(choice)" cols="80" rows="8"></textarea> + </p> </div> <div class="col-sm-2 pollChoiceInput"> - <input type="checkbox" ng-model="vote.choice[$index].value"/> + <input type="checkbox" ng-model="data.vote.choice[$index].voteValue" name="{{data.vote.choice[$index].choiceId}}"/> </div> </div> -<div class="row pollBigChoice" ng-if="globalVariables.editMode"> +<div class="row pollBigChoice"> <div class="col-sm-10"> - <button class="btn btn-info btn-large" ng-click="addChoice()">Ajouter un choix</button> + <button class="btn btn-info btn-large" ng-click="addChoice()" ng-if="globalVariables.editMode" >Ajouter un choix</button> </div> <div class="col-sm-2"> <button ng-click="inlineVersion()" class="btn btn-default">inline version</button> @@ -68,6 +70,6 @@ </div> <div class="pollBigVote"> - <input type="text" placeholder="Votre Nom" ng-model="vote.name"/> + <input type="text" placeholder="Votre Nom" ng-model="data.vote.voterName"/> <button class="btn btn-primary" ng-click="voter()">Voter</button> </div> \ No newline at end of file diff --git a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html index 840a498..b3d0f9d 100644 --- a/pollen-ui-angular/src/main/webapp/partials/inline-poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/inline-poll.html @@ -24,7 +24,7 @@ <table> <!-- begin print choices --> <tr> - <td><button ng-if="globalVariables.editMode" ng-click="bigVersion()" class="btn btn-default" >Big version</button></td> + <td><button ng-click="bigVersion()" class="btn btn-default" >Big version</button></td> <td ng-repeat="choice in data.choices" class="pollChoice pollAnim" ng-mouseenter="showEditHover = true" ng-mouseleave="showEditHover = false"> <div ng-if="choice.choiceType == 'TEXT'" edit-me="showEdit" > <div ng-hide="showEdit && !globalVariables.voted" class="fixe-input" title="{{choice.description}}"> @@ -55,7 +55,7 @@ <info-error error="data.vote.restError.voterName" data="data.vote.voteName"></info-error> </td> <td ng-repeat="choice in data.vote.choice" class="pollChoice"> - <input type="checkbox" name="{{choice.choice.topiaId}}" ng-model="choice.voteValue" /> + <input type="checkbox" name="{{choice.choiceId}}" ng-model="choice.voteValue" /> </td> <td> <input class="btn btn-primary btn-large" type="button" value="Vote" ng-click="voter()" /> diff --git a/pollen-ui-angular/src/main/webapp/partials/poll.html b/pollen-ui-angular/src/main/webapp/partials/poll.html index d6403df..6a676ba 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll.html @@ -39,7 +39,7 @@ </h1> <h1 ng-show="showEditTitle"> - <input type="text" class="form-control" focus-me="showEditTitle" ng-model="data.poll.title" ng-exit="showEditTitle = false" auto-save="save()" required/> + <input type="text" class="form-control" focus-me="showEditTitle" ng-model="data.poll.title" ng-exit="showEditTitle = false" auto-save="savePoll()" required/> </h1> </div> @@ -49,7 +49,9 @@ <div ng-show="showEditDesc" class="pollDesc"> <textarea id="descEditor" data-ck-editor ng-model="data.poll.description"></textarea> - <input type="button" value="Return" class="btn btn-primary" ng-click="showEditDesc = false; save()"/> + <!-- fix me : no save in creation but save in edition --> + <input type="button" value="Return" class="btn btn-primary" ng-click="showEditDesc = false;" ng-show="globalVariables.create"/> + <input type="button" value="Return" class="btn btn-primary" ng-click="showEditDesc = false; savePoll()" ng-show="globalVariables.edit"/> </div> <div id="poll"> @@ -67,13 +69,13 @@ <div ng-if="globalVariables.create"> <hr/> <button type="button" class="btn btn-default" ng-model="globalVariables.editMode" btn-checkbox>Mode Edition</button> - <button class="btn btn-primary" ng-click="save()">Sauvegarder</button> + <button class="btn btn-primary" ng-click="savePoll()">Sauvegarder</button> </div> <div ng-if="globalVariables.edit"> <hr/> <button type="button" class="btn btn-default" ng-model="globalVariables.editMode" btn-checkbox>Mode Edition</button> - <button class="btn btn-danger" ng-click="delete();">Supprimer</button> + <button class="btn btn-danger" ng-click="deletePoll();">Supprimer</button> </div> </form> \ No newline at end of file -- To stop receiving notification emails like this one, please contact Chorem.org SCM administrator <admin+scm@chorem.org>.