diff --git a/client/src/app/shared/components/assignment-poll-detail-content/assignment-poll-detail-content.component.html b/client/src/app/shared/components/assignment-poll-detail-content/assignment-poll-detail-content.component.html index af581c843..4d0040bad 100644 --- a/client/src/app/shared/components/assignment-poll-detail-content/assignment-poll-detail-content.component.html +++ b/client/src/app/shared/components/assignment-poll-detail-content/assignment-poll-detail-content.component.html @@ -2,6 +2,7 @@ + - + + +
{{ 'Candidates' | translate }} @@ -21,7 +22,10 @@ {{ 'Abstain' | translate }}
+ {{ i + 1 }}. +
@@ -50,6 +54,7 @@
{{ 'Entitled users' | translate }}
diff --git a/client/src/app/site/assignments/services/assignment-pdf.service.ts b/client/src/app/site/assignments/services/assignment-pdf.service.ts index f2ebfbc50..491040f55 100644 --- a/client/src/app/site/assignments/services/assignment-pdf.service.ts +++ b/client/src/app/site/assignments/services/assignment-pdf.service.ts @@ -175,6 +175,10 @@ export class AssignmentPdfService { }); pollTableBody.push([ + { + text: '', + style: 'tableHeader' + }, { text: this.translate.instant('Candidates'), style: 'tableHeader' @@ -186,10 +190,15 @@ export class AssignmentPdfService { ]); const tableData = this.assignmentPollService.generateTableData(poll); - for (const pollResult of tableData) { + for (const [index, pollResult] of tableData.entries()) { + const rank = pollResult.class === 'user' ? index + 1 : ''; const voteOption = this.translate.instant(this.pollKeyVerbose.transform(pollResult.votingOption)); const resultLine = this.getPollResult(pollResult, poll); + const tableLine = [ + { + text: rank + }, { text: voteOption }, @@ -203,7 +212,7 @@ export class AssignmentPdfService { resultBody.push({ table: { - widths: ['64%', '33%'], + widths: ['3%', '65%', '33%'], headerRows: 1, body: pollTableBody },