Respect candidate enumeration per assignment

Uses candidate enum per assignment as given in the form.
Changes enumeration in drag-list and poll-meta-info
This commit is contained in:
Sean 2021-05-26 15:49:19 +02:00 committed by Emanuel Schütze
parent 43d73a87f1
commit 8734e48aef
5 changed files with 21 additions and 4 deletions

View File

@ -22,13 +22,14 @@
.count {
display: table-cell;
vertical-align: middle;
min-width: 2em;
padding-left: 1.25em;
min-width: 1.5em;
padding-left: 0.75em;
}
.content {
display: table-cell;
vertical-align: middle;
width: 100%;
padding-left: 0.75em;
}
}

View File

@ -149,7 +149,7 @@
<os-sorting-list
[input]="assignment.assignment_related_users"
[live]="true"
[count]="true"
[count]="enumerateCandidates"
[enable]="hasPerms('manage')"
(sortEvent)="onSortingChange($event)"
>

View File

@ -143,6 +143,10 @@ export class AssignmentDetailComponent extends BaseViewComponentDirective implem
return this.agendaObserver.getValue().length > 0;
}
public get enumerateCandidates(): boolean {
return this.assignment?.number_poll_candidates || false;
}
/**
* Hold the subscription to the navigation.
* This cannot go into the subscription-list, since it should

View File

@ -3,9 +3,12 @@
<small class="meta-info-left subtitle" *ngIf="poll.options?.length && showCandidates">
<div>
{{ 'Candidates' | translate }}:
<ol>
<ol *ngIf="enumerateCandidates">
<li *ngFor="let option of poll.options">{{ getOptionTitle(option) | translate }}</li>
</ol>
<ul *ngIf="!enumerateCandidates">
<li *ngFor="let option of poll.options">{{ getOptionTitle(option) | translate }}</li>
</ul>
</div>
<div *ngIf="hasGlobalOption">
{{ 'Options' | translate }}:

View File

@ -1,5 +1,6 @@
import { Component, Input } from '@angular/core';
import { ViewAssignment } from 'app/site/assignments/models/view-assignment';
import { ViewAssignmentOption } from 'app/site/assignments/models/view-assignment-option';
import { ViewAssignmentPoll } from 'app/site/assignments/models/view-assignment-poll';
import { UnknownUserLabel } from 'app/site/assignments/modules/assignment-poll/services/assignment-poll.service';
@ -20,6 +21,14 @@ export class AssignmentPollMetaInfoComponent {
@Input()
public showCandidates = true;
private get assignment(): ViewAssignment {
return this.poll.assignment;
}
public get enumerateCandidates(): boolean {
return this.assignment?.number_poll_candidates || false;
}
public get hasGlobalOption(): boolean {
return this.poll.hasGlobalOption;
}