list file attachments

This commit is contained in:
2020-05-13 19:31:57 +02:00
committed by smuddy
parent 536739e651
commit 80e35a7e44
23 changed files with 300 additions and 53 deletions

View File

@@ -12,39 +12,54 @@
</mat-select>
</mat-form-field>
<div *ngFor="let song of presentationSongs" @fade class="song">
<div [class.active]="show.presentationSongId===song.id" class="title song-part">
<div (click)="onSectionClick(song.id, -1)" class="head">{{song.title}}</div>
</div>
<div *ngIf="show" class="song-parts">
<div (click)="onSectionClick(song.id, i)" *ngFor="let section of song.sections; index as i"
[class.active]="show.presentationSongId===song.id && show.presentationSection===i"
<ng-container *ngIf="!progress">
<div *ngIf="show" class="song-parts padding-bottom">
<div (click)="onSectionClick('title', -1)"
[class.active]="show.presentationSongId==='title'"
class="song-part">
<div class="head">{{section.type|sectionType}} {{section.number + 1}}</div>
<div class="fragment">{{getFirstLine(section)}}</div>
<div class="head">Veranstaltung</div>
</div>
<div (click)="onSectionClick('empty', -1)"
[class.active]="show.presentationSongId==='empty'"
class="song-part">
<div class="head">Leer</div>
</div>
</div>
</div>
<div *ngIf="show" class="div-bottom">
<a routerLink="/presentation/monitor" target="_blank">
<fa-icon [icon]="faDesktop"></fa-icon>
</a>
<div *ngFor="let song of presentationSongs" @fade class="song">
<div [class.active]="show.presentationSongId===song.id" class="title song-part">
<div (click)="onSectionClick(song.id, -1)" class="head">{{song.title}}</div>
</div>
<div *ngIf="show" class="song-parts">
<div (click)="onSectionClick(song.id, i)" *ngFor="let section of song.sections; index as i"
[class.active]="show.presentationSongId===song.id && show.presentationSection===i"
class="song-part">
<div class="head">{{section.type|sectionType}} {{section.number + 1}}</div>
<div class="fragment">{{getFirstLine(section)}}</div>
</div>
</div>
</div>
<mat-slider
(ngModelChange)="onZoom($event)"
[max]="100"
[min]="10"
[ngModel]="show.presentationZoom"
[step]="2"
[thumbLabel]="true"
>
</mat-slider>
</div>
<div *ngIf="show" class="div-bottom">
<a routerLink="/presentation/monitor" target="_blank">
<fa-icon [icon]="faDesktop"></fa-icon>
</a>
<mat-slider
(ngModelChange)="onZoom($event)"
[max]="100"
[min]="10"
[ngModel]="show.presentationZoom"
[step]="2"
[thumbLabel]="true"
>
</mat-slider>
</div>
<app-add-song *ngIf="show" [addedLive]="true" [showId]="currentShowId" [showSongs]="showSongs"
[songs]="songs"></app-add-song>
<app-add-song *ngIf="show" [addedLive]="true" [showId]="currentShowId" [showSongs]="showSongs"
[songs]="songs"></app-add-song>
</ng-container>
</app-card>

View File

@@ -68,3 +68,7 @@
display: grid;
grid-template-columns: 40px auto;
}
.padding-bottom {
padding-bottom: 20px;
}

View File

@@ -12,6 +12,7 @@ import {GlobalSettingsService} from '../../../services/global-settings.service';
import {FormControl} from '@angular/forms';
import {distinctUntilChanged, map} from 'rxjs/operators';
import {fade} from '../../../animations';
import {delay} from '../../../services/delay';
export interface PresentationSong {
id: string;
@@ -32,6 +33,7 @@ export class RemoteComponent {
public songs: Song[];
public presentationSongs: PresentationSong[];
public currentShowId: string;
public progress = false;
public faDesktop = faDesktop;
public showControl = new FormControl();
@@ -49,12 +51,21 @@ export class RemoteComponent {
globalSettingsService.get$.pipe(
map(_ => _.currentShow),
distinctUntilChanged()
).subscribe(_ => this.showControl.setValue(_));
).subscribe(_ => {
this.showControl.setValue(_, {emitEvent: false});
this.onShowChanged(_, false);
});
this.showControl.valueChanges.subscribe(value => this.onShowChanged(value));
}
public onShowChanged(change: string): void {
this.globalSettingsService.set({currentShow: change});
public async onShowChanged(change: string, updateShow = true): Promise<void> {
this.progress = true;
if (updateShow) {
await this.showService.update$(change, {presentationSongId: 'empty'});
await delay(1200);
await this.globalSettingsService.set({currentShow: change});
await this.showService.update$(change, {presentationSongId: 'title'});
}
this.currentShowId = change;
this.showService.read$(change).subscribe(_ => this.show = _);
this.showSongService.list$(change).subscribe(_ => {
@@ -67,6 +78,8 @@ export class RemoteComponent {
sections: this.textRenderingService.parse(song.text)
}))
});
await delay(500);
this.progress = false;
}
public getFirstLine(section: Section): string {