This is an automated email from the git hooks/post-receive script. New commit to branch devel in repository Pollen. See http://git.None/Pollen.git commit 4d0a860a1ac5b0c9eb4ea7b587c18eb1d2aa47c0 Author: Adrien Garandel <a.garandel@dralagen.fr> Date: Tue May 27 17:25:31 2014 +0200 update style of form comment, get permission of the poll --- pollen-rest-api/src/main/resources/mapping | 10 ++++----- .../src/main/webapp/js/controllers/pollCtrl.js | 8 +++---- .../src/main/webapp/partials/poll-comment.html | 25 ++++++++++++++++++---- 3 files changed, 30 insertions(+), 13 deletions(-) diff --git a/pollen-rest-api/src/main/resources/mapping b/pollen-rest-api/src/main/resources/mapping index b782d82..da2368c 100644 --- a/pollen-rest-api/src/main/resources/mapping +++ b/pollen-rest-api/src/main/resources/mapping @@ -69,11 +69,11 @@ DELETE /v1/polls/{pollId}/choices/{choiceId} ChoiceApi.deleteChoice # CommentApi -GET /v1/polls/{pollId}/comments CommentApi.getComments -POST /v1/polls/{pollId}/comments CommentApi.addComment -GET /v1/polls/{pollId}/comments/{commentId} CommentApi.getComment -POST /v1/polls/{pollId}/comments/{commentId} CommentApi.editComment -DELETE /v1/polls/{pollId}/comments/{commentId} CommentApi.deleteComment +GET /v1/polls/{pollId}/comments CommentApi.getComments +POST /v1/polls/{pollId}/comments CommentApi.addComment +GET /v1/polls/{pollId}/comments/{commentId} CommentApi.getComment +PUT,POST /v1/polls/{pollId}/comments/{commentId} CommentApi.editComment +DELETE /v1/polls/{pollId}/comments/{commentId} CommentApi.deleteComment # FavoriteListApi 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 1f24c1f..683986e 100644 --- a/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js +++ b/pollen-ui-angular/src/main/webapp/js/controllers/pollCtrl.js @@ -453,14 +453,14 @@ angular.module('pollControllers', []) } }]) -.controller('PollCommentCtrl', ['$scope', '$controller', '$routeParams', 'PollComment', function ($scope, $controller, $routeParams, PollComment) { +.controller('PollCommentCtrl', ['$scope', '$controller', '$routeParams', 'Poll', 'PollComment', function ($scope, $controller, $routeParams, Poll, PollComment) { $controller('PollCtrl', {$scope:$scope}); $scope.globalVariables.commentMode = true; - if (angular.isUndefined($scope.data.poll.id)) { - $scope.data.poll.id = $routeParams.pollId; - } + Poll.get({pollId:$routeParams.pollId, permission:$scope.globalVariables.permission}, function (data) { + $scope.data.poll = data; + }) $scope.tab = $scope.setTab('comment'); $scope.comment = {text:''}; diff --git a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html index d35a4b1..83ae6d2 100644 --- a/pollen-ui-angular/src/main/webapp/partials/poll-comment.html +++ b/pollen-ui-angular/src/main/webapp/partials/poll-comment.html @@ -23,10 +23,27 @@ <!-- begin for add comment --> <form ng-submit="postComment()"> - name : <input type="text" ng-model="comment.authorName" /> <info-error error="restError['author.name'][0]" data="comment.authorName"></info-error><br/> - text : <info-error error="restError.text[0]" data="comment.text"></info-error> <br/> - <textarea data-ck-editor ng-model="comment.text"></textarea> - <button type="submit" class="btn btn-primary" ng-click="postComment()">Commenter</button> + <div class="form-group"> + <label class="col-sm-2"> Nom </label> + <div class="col-sm-1"> + <info-error error="restError['author.name'][0]" data="comment.authorName"></info-error> + </div> + <div class="col-sm-9"> + <input type="text" ng-model="comment.authorName" class="form-control"/> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-2"> Commentaire </label> + <div class="col-sm-1"><info-error error="restError.text[0]" data="comment.text"></info-error></div> + <div class="col-sm-9"> + <textarea data-ck-editor ng-model="comment.text"></textarea> + </div> + </div> + + <div class="form-group"> + <button type="submit" class="btn btn-primary" ng-click="postComment()">Commenter</button> + </div> </form> <!-- end form comment --> -- To stop receiving notification emails like this one, please contact Chorem.org SCM administrator <admin+scm@chorem.org>.