Fixed the numbering of assignment candidates for projector and PDF

This commit is contained in:
Joshua Sangmeister 2020-02-14 16:44:06 +01:00 committed by FinnStutzenstein
parent b48ca8c434
commit 7598fc5367
4 changed files with 18 additions and 7 deletions

View File

@ -131,6 +131,7 @@ export class AssignmentPdfService {
margin: [0, 0, 0, 10] margin: [0, 0, 0, 10]
}; };
}); });
const listType = assignment.number_poll_candidates ? 'ol' : 'ul';
return { return {
columns: [ columns: [
@ -141,7 +142,7 @@ export class AssignmentPdfService {
style: 'textItem' style: 'textItem'
}, },
{ {
ul: userList, [listType]: userList,
style: 'textItem' style: 'textItem'
} }
] ]

View File

@ -7,4 +7,5 @@ export interface AssignmentSlideData {
user: string; user: string;
elected: boolean; elected: boolean;
}[]; }[];
number_poll_candidates: boolean;
} }

View File

@ -7,10 +7,18 @@
<div *ngIf="data.data && data.data.description" [innerHTML]="data.data.description | trust: 'html'"></div> <div *ngIf="data.data && data.data.description" [innerHTML]="data.data.description | trust: 'html'"></div>
<h3 translate>Candidates</h3> <h3 translate>Candidates</h3>
<ul *ngIf="data.data.assignment_related_users && data.data.assignment_related_users.length"> <ng-container *ngIf="data.data.assignment_related_users && data.data.assignment_related_users.length">
<li *ngFor="let candidate of data.data.assignment_related_users"> <ol *ngIf="data.data.number_poll_candidates">
{{ candidate.user }} <li *ngFor="let candidate of data.data.assignment_related_users">
<mat-icon *ngIf="candidate.elected">star</mat-icon> {{ candidate.user }}
</li> <mat-icon *ngIf="candidate.elected">star</mat-icon>
</ul> </li>
</ol>
<ul *ngIf="!data.data.number_poll_candidates">
<li *ngFor="let candidate of data.data.assignment_related_users">
{{ candidate.user }}
<mat-icon *ngIf="candidate.elected">star</mat-icon>
</li>
</ul>
</ng-container>
</div> </div>

View File

@ -34,6 +34,7 @@ async def assignment_slide(
"open_posts": assignment["open_posts"], "open_posts": assignment["open_posts"],
"description": assignment["description"], "description": assignment["description"],
"assignment_related_users": assignment_related_users, "assignment_related_users": assignment_related_users,
"number_poll_candidates": assignment["number_poll_candidates"],
} }