Merge pull request #4893 from tsiegleauq/close-list-of-speakers

Visualize closed lists of speakers
This commit is contained in:
Sean 2019-08-02 10:00:16 +02:00 committed by GitHub
commit 420a355ec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 9 deletions

View File

@ -77,6 +77,7 @@ _('Input format: DD.MM.YYYY HH:MM');
_('Hide internal items when projecting subitems');
_('Number of last speakers to be shown on the projector');
_('List of speakers');
_('The list of speakers is closed');
_('Show orange countdown in the last x seconds of speaking time');
_('Enter duration in seconds. Choose 0 to disable warning color.');
_('Hide the amount of speakers in subtitle of list of speakers slide');

View File

@ -1,5 +1,10 @@
<mat-form-field [style.display]="fullWidth ? 'block' : 'inline-block'">
<mat-select [formControl]="formControl" placeholder="{{ listname | translate }}" [multiple]="multiple" #thisSelector>
<mat-select
[formControl]="formControl"
placeholder="{{ listname | translate }}"
[multiple]="multiple"
#thisSelector
>
<ngx-mat-select-search ngModel (ngModelChange)="onSearch($event)"></ngx-mat-select-search>
<div *ngIf="!multiple && includeNone">
<mat-option [value]="null">

View File

@ -1,18 +1,18 @@
<ng-container *osPerms="'agenda.can_see_list_of_speakers'">
<ng-container *ngIf="listOfSpeakers">
<a class="anchor-button" *ngIf="!menuItem" [routerLink]="listOfSpeakersUrl">
<button type="button" mat-icon-button [disabled]="disabled">
<button type="button" mat-icon-button [disabled]="disabled" [matTooltip]="tooltip | translate">
<mat-icon
[matBadge]="listOfSpeakers.waitingSpeakerAmount > 0 ? listOfSpeakers.waitingSpeakerAmount : null"
matBadgeColor="accent"
>
mic
{{ icon }}
</mat-icon>
</button>
</a>
<button type="button" *ngIf="menuItem" mat-menu-item [routerLink]="listOfSpeakers.listOfSpeakersUrl">
<mat-icon>mic</mat-icon>
<mat-icon>{{ icon }}</mat-icon>
<span translate>List of speakers</span>
</button>
</ng-container>

View File

@ -44,6 +44,14 @@ export class SpeakerButtonComponent {
}
}
public get icon(): string {
return this.listOfSpeakers.closed ? 'voice_over_off' : 'record_voice_over';
}
public get tooltip(): string {
return this.listOfSpeakers.closed ? 'The list of speakers is closed' : 'List of speakers';
}
/**
* The constructor
*/

View File

@ -13,7 +13,12 @@
<mat-card class="os-card speaker-card" *ngIf="viewListOfSpeakers">
<!-- Title -->
<h1 class="los-title">{{ viewListOfSpeakers.getTitle() }}</h1>
<h1 class="los-title">
{{ viewListOfSpeakers.getTitle() }}
<mat-icon *ngIf="viewListOfSpeakers.closed">
lock
</mat-icon>
</h1>
<!-- List of finished speakers -->
<mat-expansion-panel *ngIf="finishedSpeakers && finishedSpeakers.length > 0" class="finished-list">
@ -131,7 +136,7 @@
<!-- Add me and remove me if OP has correct permission -->
<div *osPerms="'agenda.can_be_speaker'" class="add-self-buttons">
<div *ngIf="speakers && !closedList">
<button mat-stroked-button (click)="addNewSpeaker()" *ngIf="!isOpInList() && canAddSelf">
<button mat-stroked-button [disabled]="viewListOfSpeakers.closed" (click)="addNewSpeaker()" *ngIf="!isOpInList() && canAddSelf">
<mat-icon>add</mat-icon>
<span translate>Add me</span>
</button>
@ -166,12 +171,12 @@
></os-projector-button>
<button mat-menu-item *ngIf="isListOfSpeakersClosed" (click)="openSpeakerList()">
<mat-icon>mic</mat-icon>
<mat-icon>lock_open</mat-icon>
<span translate>Open list of speakers</span>
</button>
<button mat-menu-item *ngIf="!isListOfSpeakersClosed" (click)="closeSpeakerList()">
<mat-icon>mic_off</mat-icon>
<mat-icon>lock</mat-icon>
<span translate>Close list of speakers</span>
</button>

View File

@ -369,7 +369,11 @@ export class ListOfSpeakersComponent extends BaseViewComponent implements OnInit
* @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;
return this.finishedSpeakers.filter(finishedSpeaker => {
if (finishedSpeaker && finishedSpeaker.user) {
return finishedSpeaker.user.id === speaker.user.id;
}
}).length;
}
/**