Merge pull request #4121 from MaximilianKrambach/speechcount
warn/show speaker-call amount
This commit is contained in:
commit
5a74c7d662
@ -53,6 +53,9 @@
|
|||||||
<os-sorting-list [input]="speakers" [live]="true" [count]="true" (sortEvent)="onSortingChange($event)">
|
<os-sorting-list [input]="speakers" [live]="true" [count]="true" (sortEvent)="onSortingChange($event)">
|
||||||
<!-- implicit item references into the component using ng-template slot -->
|
<!-- implicit item references into the component using ng-template slot -->
|
||||||
<ng-template let-item>
|
<ng-template let-item>
|
||||||
|
<span *ngIf="hasSpokenCount(item)" class="red-warning-text speaker-warning">
|
||||||
|
<span translate>Call</span><span> {{ hasSpokenCount(item) + 1 }}</span>
|
||||||
|
</span>
|
||||||
<mat-button-toggle-group>
|
<mat-button-toggle-group>
|
||||||
<mat-button-toggle matTooltip="{{ 'Begin speech' | translate }}"
|
<mat-button-toggle matTooltip="{{ 'Begin speech' | translate }}"
|
||||||
(click)="onStartButton(item)">
|
(click)="onStartButton(item)">
|
||||||
|
@ -61,4 +61,8 @@
|
|||||||
.add-self-buttons {
|
.add-self-buttons {
|
||||||
padding: 0 0 20px 25px;
|
padding: 0 0 20px 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.speaker-warning {
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -180,4 +180,14 @@ export class SpeakerListComponent extends BaseViewComponent implements OnInit {
|
|||||||
public isOpInList(): boolean {
|
public isOpInList(): boolean {
|
||||||
return this.speakers.some(speaker => speaker.user.id === this.op.user.id);
|
return this.speakers.some(speaker => speaker.user.id === this.op.user.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks how often a speaker has already finished speaking
|
||||||
|
*
|
||||||
|
* @param speaker
|
||||||
|
* @returns 0 or the number of times a speaker occurs in finishedSpeakers
|
||||||
|
*/
|
||||||
|
public hasSpokenCount(speaker: ViewSpeaker): number {
|
||||||
|
return this.finishedSpeakers.filter(finishedSpeaker => finishedSpeaker.user.id === speaker.user.id).length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user