From 41ceb4ef9d78c056785ea5483022018f19911060 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Wed, 14 Dec 2016 14:05:03 +0100 Subject: [PATCH] add special voting values for missed options (fixes #2709) --- .../assignments/static/js/assignments/pdf.js | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/openslides/assignments/static/js/assignments/pdf.js b/openslides/assignments/static/js/assignments/pdf.js index be89f1978..c49fa29d3 100644 --- a/openslides/assignments/static/js/assignments/pdf.js +++ b/openslides/assignments/static/js/assignments/pdf.js @@ -131,9 +131,6 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) var resultBody = []; angular.forEach(assignment.polls, function(poll, pollIndex) { if (poll.published) { - var voteNrTotal = poll.votescast; - var voteNrValid = poll.votesvalid; - var voteNrInVal = poll.votesinvalid; var pollTableBody = []; resultBody.push({ @@ -172,8 +169,7 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) angular.forEach(votes, function(vote) { resultBlock.push(parseVoteValue(vote, true)); }); - tableLine.push( - { + tableLine.push({ text: resultBlock, style: PDFLayout.flipTableRowStyle(pollTableBody.length) } @@ -182,42 +178,40 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf']) pollTableBody.push(tableLine); }); - //it is technically possible to make a single push-statement - //however, the flipTableRowStyle-function needs the current table size - if (voteNrValid) { + if (poll.votesvalid) { pollTableBody.push([ { text: gettextCatalog.getString("Valid ballots"), style: 'tableConclude' }, { - text: "" + voteNrValid, + text: parseVoteValue(poll.getVote('votesvalid'), false), style: 'tableConclude' }, ]); } - if (voteNrInVal) { + if (poll.votesinvalid) { pollTableBody.push([ { text: gettextCatalog.getString("Invalid ballots"), style: 'tableConclude' }, { - text: "" + voteNrInVal, + text: parseVoteValue(poll.getVote('votesinvalid'), false), style: 'tableConclude' }, ]); } - if (voteNrTotal) { + if (poll.votescast) { pollTableBody.push([ { text: gettextCatalog.getString("Casted ballots"), style: 'tableConclude' }, { - text: "" + voteNrTotal, + text: parseVoteValue(poll.getVote('votescast'), false), style: 'tableConclude' }, ]);