add special voting values for missed options (fixes #2709)
This commit is contained in:
parent
7cbc0d4bfe
commit
41ceb4ef9d
@ -131,9 +131,6 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf'])
|
|||||||
var resultBody = [];
|
var resultBody = [];
|
||||||
angular.forEach(assignment.polls, function(poll, pollIndex) {
|
angular.forEach(assignment.polls, function(poll, pollIndex) {
|
||||||
if (poll.published) {
|
if (poll.published) {
|
||||||
var voteNrTotal = poll.votescast;
|
|
||||||
var voteNrValid = poll.votesvalid;
|
|
||||||
var voteNrInVal = poll.votesinvalid;
|
|
||||||
var pollTableBody = [];
|
var pollTableBody = [];
|
||||||
|
|
||||||
resultBody.push({
|
resultBody.push({
|
||||||
@ -172,8 +169,7 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf'])
|
|||||||
angular.forEach(votes, function(vote) {
|
angular.forEach(votes, function(vote) {
|
||||||
resultBlock.push(parseVoteValue(vote, true));
|
resultBlock.push(parseVoteValue(vote, true));
|
||||||
});
|
});
|
||||||
tableLine.push(
|
tableLine.push({
|
||||||
{
|
|
||||||
text: resultBlock,
|
text: resultBlock,
|
||||||
style: PDFLayout.flipTableRowStyle(pollTableBody.length)
|
style: PDFLayout.flipTableRowStyle(pollTableBody.length)
|
||||||
}
|
}
|
||||||
@ -182,42 +178,40 @@ angular.module('OpenSlidesApp.assignments.pdf', ['OpenSlidesApp.core.pdf'])
|
|||||||
pollTableBody.push(tableLine);
|
pollTableBody.push(tableLine);
|
||||||
});
|
});
|
||||||
|
|
||||||
//it is technically possible to make a single push-statement
|
if (poll.votesvalid) {
|
||||||
//however, the flipTableRowStyle-function needs the current table size
|
|
||||||
if (voteNrValid) {
|
|
||||||
pollTableBody.push([
|
pollTableBody.push([
|
||||||
{
|
{
|
||||||
text: gettextCatalog.getString("Valid ballots"),
|
text: gettextCatalog.getString("Valid ballots"),
|
||||||
style: 'tableConclude'
|
style: 'tableConclude'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "" + voteNrValid,
|
text: parseVoteValue(poll.getVote('votesvalid'), false),
|
||||||
style: 'tableConclude'
|
style: 'tableConclude'
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (voteNrInVal) {
|
if (poll.votesinvalid) {
|
||||||
pollTableBody.push([
|
pollTableBody.push([
|
||||||
{
|
{
|
||||||
text: gettextCatalog.getString("Invalid ballots"),
|
text: gettextCatalog.getString("Invalid ballots"),
|
||||||
style: 'tableConclude'
|
style: 'tableConclude'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "" + voteNrInVal,
|
text: parseVoteValue(poll.getVote('votesinvalid'), false),
|
||||||
style: 'tableConclude'
|
style: 'tableConclude'
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (voteNrTotal) {
|
if (poll.votescast) {
|
||||||
pollTableBody.push([
|
pollTableBody.push([
|
||||||
{
|
{
|
||||||
text: gettextCatalog.getString("Casted ballots"),
|
text: gettextCatalog.getString("Casted ballots"),
|
||||||
style: 'tableConclude'
|
style: 'tableConclude'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: "" + voteNrTotal,
|
text: parseVoteValue(poll.getVote('votescast'), false),
|
||||||
style: 'tableConclude'
|
style: 'tableConclude'
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
Loading…
Reference in New Issue
Block a user