add partey shares

This commit is contained in:
_Bastler 2021-11-17 20:18:51 +01:00
parent c4f1d5151b
commit fd01b23138
3 changed files with 20 additions and 6 deletions

View File

@ -5,11 +5,15 @@
<mat-dialog-content> <mat-dialog-content>
<h3 *ngIf="timeslot.id">{{'partey.timeslots.type.' + timeslot.type | i18n}}</h3> <h3 *ngIf="timeslot.id">{{'partey.timeslots.type.' + timeslot.type | i18n}}</h3>
<form [formGroup]="form"> <form [formGroup]="form">
<mat-form-field *ngIf="timeslot.type == 'VIDEO'"> <mat-form-field *ngIf="timeslot.type == 'VIDEO' || timeslot.type == 'AUDIO'">
<input matInput [(ngModel)]="timeslot.share" formControlName="share"
placeholder="{{'partey.timeslots.share.placeholder' | i18n}}">
</mat-form-field>
<mat-form-field *ngIf="timeslot.type == 'VIDEO_STREAM'">
<input matInput [(ngModel)]="timeslot.stream" formControlName="stream" <input matInput [(ngModel)]="timeslot.stream" formControlName="stream"
placeholder="{{'partey.timeslots.stream' | i18n}}"> placeholder="{{'partey.timeslots.stream' | i18n}}">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="timeslot.type == 'AUDIO' && timeslot.secret"> <mat-form-field *ngIf="timeslot.type == 'AUDIO_STREAM' && timeslot.secret">
<textarea [mat-autosize] matInput [value]="timeslot.secret" readonly placeholder="{{'partey.timeslots.secret' | i18n}}"></textarea> <textarea [mat-autosize] matInput [value]="timeslot.secret" readonly placeholder="{{'partey.timeslots.secret' | i18n}}"></textarea>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>

View File

@ -64,14 +64,24 @@
</td> </td>
</ng-container> </ng-container>
<ng-container matColumnDef="share">
<th mat-header-cell *matHeaderCellDef mat-sort-header="stream"> {{'partey.timeslots.share' | i18n}}
</th>
<td mat-cell *matCellDef="let timeslot">
<div *ngIf="timeslot.owner == userId">
<span> {{ timeslot.share }} </span>
</div>
</td>
</ng-container>
<ng-container matColumnDef="stream"> <ng-container matColumnDef="stream">
<th mat-header-cell *matHeaderCellDef mat-sort-header="stream"> {{'partey.timeslots.stream' | i18n}} <th mat-header-cell *matHeaderCellDef mat-sort-header="stream"> {{'partey.timeslots.stream' | i18n}}
</th> </th>
<td mat-cell *matCellDef="let timeslot"> <td mat-cell *matCellDef="let timeslot">
<div *ngIf="timeslot.owner == userId"> <div *ngIf="timeslot.owner == userId">
<button *ngIf="timeslot.type == 'AUDIO'" mat-raised-button <button *ngIf="timeslot.type == 'AUDIO_STREAM'" mat-raised-button
(click)="copySecretToClipboard(timeslot.secret)">{{'partey.timeslots.secret.copy' | i18n}}</button> (click)="copySecretToClipboard(timeslot.secret)">{{'partey.timeslots.secret.copy' | i18n}}</button>
<span *ngIf="timeslot.type == 'VIDEO'"> {{ timeslot.stream }} </span> <span *ngIf="timeslot.type == 'VIDEO_STREAM'"> {{ timeslot.stream }} </span>
</div> </div>
</td> </td>
</ng-container> </ng-container>

View File

@ -32,10 +32,10 @@ export class ParteyTimeslotsComponent implements OnInit {
filter: any = {}; filter: any = {};
pageSizeOptions: number[] = [ 5, 10, 25, 50 ]; pageSizeOptions: number[] = [ 5, 10, 25, 50 ];
visibilities = [ "PRIVATE", "PROTECTED", "PUBLIC" ]; visibilities = [ "PRIVATE", "PROTECTED", "PUBLIC" ];
types = [ "VIDEO", "AUDIO" ]; types = [ "VIDEO", "AUDIO", "AUDIO_STREAM", "VIDEO_STREAM" ];
userId: any; userId: any;
timeslotsColumns = [ "type", "starts", "ends", "title", "description", "stream", "edit", "delete" ]; timeslotsColumns = [ "type", "starts", "ends", "title", "description", "share", "stream", "edit", "delete" ];
searchFormControl = new FormControl(); searchFormControl = new FormControl();
ownerFormControl = new FormControl(); ownerFormControl = new FormControl();