Merge pull request #6081 from tsiegleauq/enum-assignment-candidates-again

Respect candidate enumeration per assignment
This commit is contained in:
Emanuel Schütze 2021-05-26 18:35:00 +02:00 committed by GitHub
commit 3eb7386a58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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;
}