From 5577bac7c9816ecfa01995efee5abd37bac2f2cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emanuel=20Sch=C3=BCtze?= Date: Thu, 26 Nov 2020 11:47:18 +0100 Subject: [PATCH] Show motion poll title in motion pdf --- .../motions/services/motion-pdf.service.ts | 57 +++++++++---------- 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/client/src/app/site/motions/services/motion-pdf.service.ts b/client/src/app/site/motions/services/motion-pdf.service.ts index 45412abb4..346d65167 100644 --- a/client/src/app/site/motions/services/motion-pdf.service.ts +++ b/client/src/app/site/motions/services/motion-pdf.service.ts @@ -370,13 +370,12 @@ export class MotionPdfService { // voting results if (motion.polls.length && (!infoToExport || infoToExport.includes('polls'))) { - const column1 = []; - const column2 = []; - const column3 = []; motion.polls.forEach(poll => { if (poll.hasVotes) { const tableData = this.motionPollService.generateTableData(poll); - + const column1 = []; + const column2 = []; + const column3 = []; tableData.forEach(votingResult => { const votingOption = this.translate.instant( this.pollKeyVerbose.transform(votingResult.votingOption) @@ -397,33 +396,33 @@ export class MotionPdfService { } column3.push(resultValue); }); + metaTableBody.push([ + { + text: poll.title, + style: 'boldText' + }, + { + columns: [ + { + text: column1.join('\n'), + width: 'auto' + }, + { + text: column2.join('\n'), + width: 'auto', + alignment: 'right' + }, + { + text: column3.join('\n'), + width: 'auto', + alignment: 'right' + } + ], + columnGap: 7 + } + ]); } }); - metaTableBody.push([ - { - text: `${this.translate.instant('Voting result')}:`, - style: 'boldText' - }, - { - columns: [ - { - text: column1.join('\n'), - width: 'auto' - }, - { - text: column2.join('\n'), - width: 'auto', - alignment: 'right' - }, - { - text: column3.join('\n'), - width: 'auto', - alignment: 'right' - } - ], - columnGap: 7 - } - ]); } // summary of change recommendations (for motion diff version only)