published shows are readonly

This commit is contained in:
2020-04-17 15:25:58 +02:00
committed by smuddy
parent c5748d5e34
commit 617a87c29c
4 changed files with 16 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
heading="{{show.showType|showType}}, {{show.date.toDate()|date:'dd.MM.yyyy'}} - {{getStatus(show)}}"> heading="{{show.showType|showType}}, {{show.date.toDate()|date:'dd.MM.yyyy'}} - {{getStatus(show)}}">
<i *ngIf="show.public">öffentliche Veranstaltung</i> <i *ngIf="show.public">öffentliche Veranstaltung</i>
<i *ngIf="!show.public">geschlossene Veranstaltung</i> <i *ngIf="!show.public">geschlossene Veranstaltung</i>
<p> <p *ngIf="!show.published">
<mat-checkbox [(ngModel)]="showText">Text anzeigen</mat-checkbox> <mat-checkbox [(ngModel)]="showText">Text anzeigen</mat-checkbox>
</p> </p>
<div *ngIf="showSongs && songs" class="song-list"> <div *ngIf="showSongs && songs" class="song-list">
@@ -12,11 +12,12 @@
[showSongs]="showSongs" [showSongs]="showSongs"
[showText]="showText" [showText]="showText"
[song]="getSong(song.songId)" [song]="getSong(song.songId)"
[show]="show"
class="song-row" class="song-row"
></app-song> ></app-song>
</div> </div>
<div *ngIf="songs" class="add-row"> <div *ngIf="songs && !show.published" class="add-row">
<mat-form-field appearance="outline"> <mat-form-field appearance="outline">
<mat-label>Lied hinzufügen...</mat-label> <mat-label>Lied hinzufügen...</mat-label>
<mat-select (selectionChange)="onAddSongSelectionChanged($event)"> <mat-select (selectionChange)="onAddSongSelectionChanged($event)">

View File

@@ -1,5 +1,7 @@
<div *ngIf="_song"> <div *ngIf="_song">
<div class="song"> <div *ngIf="show.published" class="title published">{{_song.title}}</div>
<div *ngIf="!show.published" class="song">
<app-menu-button (click)="reorder(true)" [icon]="faUp" class="btnUp"></app-menu-button> <app-menu-button (click)="reorder(true)" [icon]="faUp" class="btnUp"></app-menu-button>
<app-menu-button (click)="reorder(false)" [icon]="faDown" class="btnDown"></app-menu-button> <app-menu-button (click)="reorder(false)" [icon]="faDown" class="btnDown"></app-menu-button>
<span class="title">{{_song.title}}</span> <span class="title">{{_song.title}}</span>
@@ -13,6 +15,7 @@
</span> </span>
<app-menu-button (click)="onDelete()" [icon]="faDelete" class="btnDelete"></app-menu-button> <app-menu-button (click)="onDelete()" [icon]="faDelete" class="btnDelete"></app-menu-button>
</div> </div>
<app-song-text (chordModeChanged)="onChordModeChanged($event)" *ngIf="showText" [chordMode]="showSong.chordMode" <app-song-text (chordModeChanged)="onChordModeChanged($event)" *ngIf="showText || show.published"
[showSwitch]="true" [text]="_song.text"></app-song-text> [chordMode]="showSong.chordMode"
[showSwitch]="!show.published" [text]="_song.text"></app-song-text>
</div> </div>

View File

@@ -30,6 +30,11 @@ mat-form-field {
.title { .title {
grid-area: title; grid-area: title;
&.published {
margin: 10px 0;
font-weight: bold;
}
} }
.keys { .keys {

View File

@@ -8,6 +8,7 @@ import {ShowSong} from '../../services/showSong';
import {getScale} from '../../../songs/services/key.helper'; import {getScale} from '../../../songs/services/key.helper';
import {FormControl} from '@angular/forms'; import {FormControl} from '@angular/forms';
import {ChordMode} from '../../../../widget-modules/components/song-text/song-text.component'; import {ChordMode} from '../../../../widget-modules/components/song-text/song-text.component';
import {Show} from '../../services/show';
@Component({ @Component({
selector: 'app-song', selector: 'app-song',
@@ -15,6 +16,7 @@ import {ChordMode} from '../../../../widget-modules/components/song-text/song-te
styleUrls: ['./song.component.less'] styleUrls: ['./song.component.less']
}) })
export class SongComponent implements OnInit { export class SongComponent implements OnInit {
@Input() public show: Show;
@Input() public showSong: ShowSong; @Input() public showSong: ShowSong;
@Input() public showSongs: ShowSong[]; @Input() public showSongs: ShowSong[];
@Input() public showId: string; @Input() public showId: string;