This is an automated email from the git hooks/post-receive script. New commit to branch develop in repository pollen. See https://gitlab.nuiton.org/chorem/pollen.git commit 3105f48b3cb90b68a7001e032a7228ccc92c6249 Author: Sylvain Bavencoff <bavencoff@codelutin.com> Date: Wed May 31 11:03:56 2017 +0200 modification de libellé, correction sur les doit les lecture de commentaire --- .../org/chorem/pollen/services/service/CommentService.java | 4 +++- .../org/chorem/pollen/services/service/PollService.java | 10 ++++++---- pollen-ui-riot-js/src/main/web/i18n.json | 6 ++++-- pollen-ui-riot-js/src/main/web/js/Poll.js | 4 ++++ pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html | 13 ++++++------- pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html | 2 +- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/CommentService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/CommentService.java index 4267231..fd9fcd8 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/CommentService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/CommentService.java @@ -56,6 +56,7 @@ public class CommentService extends PollenServiceSupport { public PaginationResultBean<CommentBean> getComments(String pollId, PaginationParameterBean paginationParameter) { checkNotNull(pollId); + checkPermission(PermissionVerb.readComment, pollId); Poll poll = getPollService().getPoll0(pollId); PaginationParameter page = getPaginationParameter(paginationParameter); @@ -69,6 +70,7 @@ public class CommentService extends PollenServiceSupport { public long getCommentCount(String pollId) { checkNotNull(pollId); + checkPermission(PermissionVerb.readComment, pollId); Poll poll = getPollService().getPoll0(pollId); @@ -79,7 +81,7 @@ public class CommentService extends PollenServiceSupport { checkNotNull(pollId); checkNotNull(commentId); - checkPermission(PermissionVerb.readComment, commentId); + checkPermission(PermissionVerb.readComment, pollId); Poll poll = getPollService().getPoll0(pollId); diff --git a/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java b/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java index 6c67065..143408d 100644 --- a/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java +++ b/pollen-services/src/main/java/org/chorem/pollen/services/service/PollService.java @@ -73,7 +73,8 @@ public class PollService extends PollenServiceSupport { } - input.setCommentIsVisible(isPermitted(PermissionVerb.readComment, input.getEntityId())); + boolean commentIsVisible = isPermitted(PermissionVerb.readComment, input.getEntityId()); + input.setCommentIsVisible(commentIsVisible); input.setVoteIsVisible(isPermitted(PermissionVerb.readVote, input.getEntityId())); @@ -91,9 +92,10 @@ public class PollService extends PollenServiceSupport { && isPermitted(PermissionVerb.addVote, input.getEntityId()); input.setCanVote(canVote); - - long commentCount = getCommentService().getCommentCount(input.getEntityId()); - input.setCommentCount(commentCount); + if (commentIsVisible) { + long commentCount = getCommentService().getCommentCount(input.getEntityId()); + input.setCommentCount(commentCount); + } long voteCount = getVoteService().getVoteCount(input.getEntityId()); input.setVoteCount(voteCount); long participantCount = getVoterListService().getVoterListMemberCount(input.getEntityId()); diff --git a/pollen-ui-riot-js/src/main/web/i18n.json b/pollen-ui-riot-js/src/main/web/i18n.json index 96f1a5d..43b27fb 100644 --- a/pollen-ui-riot-js/src/main/web/i18n.json +++ b/pollen-ui-riot-js/src/main/web/i18n.json @@ -43,8 +43,9 @@ "poll_noVote": "aucun vote", "poll_vote": "vote", "poll_votes": "votes", + "poll_subscribers": "invités", "poll_participants": "participants", - "poll_abstention": "d'abstention", + "poll_participation": "de participation", "poll_closedFrom": "Fermé depuis le", "poll_urlForAdmin" : "Administrer ce sondage avec cette adresse", "poll_urlForVote" : "Inviter de nouveaux participants en leur envoyant cette adresse", @@ -478,8 +479,9 @@ "poll_noVote": "no vote", "poll_vote": "vote", "poll_votes": "votes", + "poll_subscribers": "subscribers", "poll_participants": "participants", - "poll_abstention": "of abstention", + "poll_participation": "of participation", "poll_closedFrom": "Closing from", "poll_urlForAdmin" : "Administrate poll with this address", "poll_urlForVote" : "Invited new participants with this address", diff --git a/pollen-ui-riot-js/src/main/web/js/Poll.js b/pollen-ui-riot-js/src/main/web/js/Poll.js index 8388528..1ffb91c 100644 --- a/pollen-ui-riot-js/src/main/web/js/Poll.js +++ b/pollen-ui-riot-js/src/main/web/js/Poll.js @@ -41,6 +41,10 @@ class Poll { return this._initPromise; } + getPermission() { + return this.permission || this.votePermission; + } + reloadPoll() { return pollService.getPoll(this.id, this.permission || this.votePermission).then(result => { Object.assign(this, result); diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html index 4676deb..c354261 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Poll.tag.html @@ -9,18 +9,18 @@ require("../popup/QrCodeButton.tag.html"); <div class="tabs"> <div class={tab : true, selected : selectedTab === "votes"}> - <a href="#poll/{poll.id}/vote{poll.permission?'/' + poll.permission : ''}"> + <a href="#poll/{poll.id}/vote{poll.getPermission()?'/' + poll.getPermission() : ''}"> <i class="fa fa-thumbs-o-up fa-flip-horizontal fa-15x"></i> {__.votes} ({poll.voteCount}) </a> </div> <div class={tab : true, selected : selectedTab === "results"}> - <a href="#poll/{poll.id}/result{poll.permission?'/' + poll.permission : ''}"> + <a href="#poll/{poll.id}/result{poll.getPermission()?'/' + poll.getPermission() : ''}"> <i class="fa fa-trophy fa-15x"></i> {__.results} </a> </div> <div class={tab : true, selected : selectedTab === "comments"}> - <a href="#poll/{poll.id}/comment{poll.permission?'/' + poll.permission : ''}"> - <i class="fa fa-comments-o fa-15x"></i> {__.comments} ({poll.commentCount}) + <a href="#poll/{poll.id}/comment{poll.getPermission()?'/' + poll.getPermission() : ''}"> + <i class="fa fa-comments-o fa-15x"></i> {__.comments} <span if={poll.commentIsVisible}>({poll.commentCount})</span> </a> </div> @@ -159,8 +159,8 @@ require("../popup/QrCodeButton.tag.html"); <span if={poll.voteCount === 1}>1 {__.vote}</span> <span if={poll.voteCount > 1}>{poll.voteCount} {__.votes}</span> <span if={poll.pollType === "RESTRICTED"}> - - {poll.participantCount} {__.participants} - - {((1 - poll.voteCount / poll.participantCount) * 100).toFixed(2)} % {__.abstention}</span> + - {poll.participantCount} {__.subscribers} + - {((poll.voteCount / poll.participantCount) * 100).toFixed(2)} % {__.participation}</span> <span if={poll.status === "VOTING" && poll.endDate}> {__.votingTo} {formatDate(poll.endDate)}</span> <span if={poll.status === "CLOSED" && poll.endDate}> {__.closedFrom} {formatDate(poll.endDate)}</span> </div> @@ -221,7 +221,6 @@ require("../popup/QrCodeButton.tag.html"); this.confirm(this.__.deletePoll).then((confirm) => { if (confirm) { this.poll.delete().then(() => { - let route = require("riot-route"); route("/home"); }); } diff --git a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html index 74fcef8..2b44bde 100644 --- a/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html +++ b/pollen-ui-riot-js/src/main/web/tag/poll/Settings.tag.html @@ -410,7 +410,7 @@ require("../components/date-time-picker.tag.html"); this.updateVoteCountingTypeHelp(); }; - this.toggleNotifyMeBeforePollEnds = e => { + this.toggleNotifyMeBeforePollEnds = () => { if (!this.notifyMeBeforePollEnds) { this.refs.notifyMeHoursBeforePollEnds = undefined; } -- To stop receiving notification emails like this one, please contact chorem.org SCM administrator <admin+scm@chorem.org>.