clos slide content

This commit is contained in:
FinnStutzenstein 2019-02-26 13:33:23 +01:00 committed by Emanuel Schütze
parent 798af8c5ab
commit 7be436594e
8 changed files with 29 additions and 22 deletions

View File

@ -4,10 +4,10 @@ interface SlideSpeaker {
}
export interface CommonListOfSpeakersSlideData {
waiting: SlideSpeaker[];
current: SlideSpeaker;
finished: SlideSpeaker[];
title_information: object;
content_object_collection: string;
item_number: string;
waiting?: SlideSpeaker[];
current?: SlideSpeaker;
finished?: SlideSpeaker[];
title_information?: object;
content_object_collection?: string;
item_number?: string;
}

View File

@ -1,11 +1,11 @@
<div *ngIf="data">
<div class="slidetitle">
<h1 translate>List of speakers</h1>
<h2> {{ getTitle() }}</h2>
<h2>{{ getTitle() }}</h2>
</div>
<!-- Last speakers -->
<div *ngIf="data.data.finished.length">
<div *ngIf="data.data.finished && data.data.finished.length">
<div *ngFor="let speaker of data.data.finished" class="lastSpeakers">
{{ speaker.user }}
<mat-icon *ngIf="speaker.marked">star</mat-icon>
@ -18,7 +18,7 @@
</div>
<!-- Next speakers -->
<div *ngIf="data.data.waiting.length">
<div *ngIf="data.data.waiting && data.data.waiting.length">
<ol class="nextSpeakers">
<li *ngFor="let speaker of data.data.waiting">
{{ speaker.user }}

View File

@ -16,13 +16,17 @@ export class CommonListOfSpeakersSlideComponent extends BaseSlideComponent<Commo
}
public getTitle(): string {
if (!this.data.data.content_object_collection || !this.data.data.title_information) {
return '';
}
const numberPrefix = this.data.data.item_number ? `${this.data.data.item_number} · ` : '';
const repo = this.collectionStringMapperService.getRepository(this.data.data.content_object_collection);
if (isBaseAgendaContentObjectRepository(repo)) {
return numberPrefix + repo.getAgendaTitle(this.data.data.title_information);
} else {
throw new Error('The content object has no agenda based repository!');
throw new Error('The content object has no agenda base repository!');
}
}
}

View File

@ -1,3 +1,3 @@
<div id="overlay" *ngIf="data">
TODO
<os-common-list-of-speakers-slide [data]="data"></os-common-list-of-speakers-slide>
</div>

View File

@ -5,5 +5,5 @@
background-color: green;
height: 30px;
margin: 10px;
z-index: 2;
z-index: 10;
}

View File

@ -2,6 +2,7 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { CurrentListOfSpeakersOverlaySlideComponent } from './current-list-of-speakers-overlay-slide.component';
import { E2EImportsModule } from '../../../../e2e-imports.module';
import { CommonListOfSpeakersSlideModule } from '../common/common-list-of-speakers-slide.module';
describe('CurrentListOfSpeakersOverlaySlideComponent', () => {
let component: CurrentListOfSpeakersOverlaySlideComponent;
@ -9,7 +10,7 @@ describe('CurrentListOfSpeakersOverlaySlideComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
imports: [E2EImportsModule],
imports: [E2EImportsModule, CommonListOfSpeakersSlideModule],
declarations: [CurrentListOfSpeakersOverlaySlideComponent]
}).compileComponents();
}));

View File

@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core';
import { Component } from '@angular/core';
import { BaseSlideComponent } from 'app/slides/base-slide-component';
import { CommonListOfSpeakersSlideData } from '../common/common-list-of-speakers-slide-data';
@ -9,12 +9,6 @@ import { CommonListOfSpeakersSlideData } from '../common/common-list-of-speakers
styleUrls: ['./current-list-of-speakers-overlay-slide.component.scss']
})
export class CurrentListOfSpeakersOverlaySlideComponent extends BaseSlideComponent<CommonListOfSpeakersSlideData> {
// TODO: remove to access data in the template
@Input()
public set data(value: any) {
console.log(value.data);
}
public constructor() {
super();
}

View File

@ -1,7 +1,15 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { makeSlideModule } from 'app/slides/base-slide-module';
import { CurrentListOfSpeakersOverlaySlideComponent } from './current-list-of-speakers-overlay-slide.component';
import { CommonListOfSpeakersSlideModule } from '../common/common-list-of-speakers-slide.module';
import { SharedModule } from 'app/shared/shared.module';
import { SLIDE } from 'app/slides/slide-token';
@NgModule(makeSlideModule(CurrentListOfSpeakersOverlaySlideComponent))
@NgModule({
imports: [CommonModule, SharedModule, CommonListOfSpeakersSlideModule],
declarations: [CurrentListOfSpeakersOverlaySlideComponent],
providers: [{ provide: SLIDE, useValue: CurrentListOfSpeakersOverlaySlideComponent }],
entryComponents: [CurrentListOfSpeakersOverlaySlideComponent]
})
export class CurrentListOfSpeakersOverlaySlideModule {}