Add item number to topic title, hide clos slide for one projector

This commit is contained in:
FinnStutzenstein 2019-03-01 08:41:44 +01:00 committed by Emanuel Schütze
parent a9de755047
commit 3f77cc7b24
8 changed files with 34 additions and 11 deletions

View File

@ -25,7 +25,7 @@
</mat-form-field>
</mat-card>
<h1 class="title on-transition-fade" *ngIf="viewItem">{{ viewItem.getTitle() }}</h1>
<h1 class="title on-transition-fade" *ngIf="viewItem">{{ viewItem.contentObject.getTitle() }}</h1>
<mat-card class="speaker-card" *ngIf="viewItem">
<!-- List of finished speakers -->

View File

@ -26,7 +26,7 @@
<mat-card *ngIf="topic || editTopic" [ngClass]="editTopic ? 'os-form-card' : 'os-card'" class="on-transition-fade">
<div *ngIf="!editTopic">
<h1>{{ topic.title }}</h1>
<h1>{{ topic.getTitle() }}</h1>
</div>
<div>
<span *ngIf="!editTopic">

View File

@ -64,7 +64,11 @@ export class ViewTopic extends BaseAgendaViewModel {
}
public getTitle = () => {
if (this.agendaItem) {
return this.agendaItem.itemNumber + ' · ' + this.title;
} else {
return this.title;
}
};
public getAgendaItem(): ViewItem {

View File

@ -117,12 +117,12 @@
</button>
</div>
<div class="name">
{{ i + 1 }}.&nbsp;<span>{{ getSlideTitle(element) }}</span>
<span>{{ getSlideTitle(element) }}</span>
</div>
<div class="button-right" *ngIf="editQueue">
<div>
<button type="button" mat-icon-button (click)="removePreviewElement(i)">
<mat-icon>close</mat-icon>
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
@ -144,7 +144,7 @@
<span translate>History</span>
</mat-expansion-panel-header>
<p *ngFor="let elements of projector.elements_history; let i = index">
{{ i + 1 }}. {{ getSlideTitle(elements[0]) }}
{{ i + 1 }}. &nbsp; {{ getSlideTitle(elements[0]) }}
</p>
</mat-expansion-panel>
@ -191,7 +191,7 @@
</mat-action-row>
</mat-expansion-panel>
<!-- Current List of Speakers -->
<!-- Current list of speakers -->
<mat-expansion-panel>
<mat-expansion-panel-header>
<span translate>Current list of speakers</span>
@ -207,8 +207,8 @@
</mat-list-item>
</mat-list>
<!-- Current Speaker -->
<mat-list>
<!-- Slide-->
<mat-list *ngIf="projectorCount > 1">
<mat-list-item [ngClass]="{ projected: isClosProjected(false) }">
<button type="button" mat-icon-button (click)="toggleClos(false)">
<mat-icon>videocam</mat-icon>

View File

@ -43,6 +43,8 @@ export class ProjectorDetailComponent extends BaseViewComponent implements OnIni
public messages: ViewProjectorMessage[] = [];
public projectorCount: number;
/**
* true if the queue might be altered
*/
@ -72,6 +74,7 @@ export class ProjectorDetailComponent extends BaseViewComponent implements OnIni
this.countdownRepo.getViewModelListObservable().subscribe(countdowns => (this.countdowns = countdowns));
this.messageRepo.getViewModelListObservable().subscribe(messages => (this.messages = messages));
this.repo.getViewModelListObservable().subscribe(projectors => (this.projectorCount = projectors.length));
}
/**

View File

@ -1,4 +1,5 @@
export interface TopicSlideData {
title: string;
text: string;
item_number: string;
}

View File

@ -1,5 +1,10 @@
<div *ngIf="data">
<h1>{{ data.data.title }}</h1>
<h1>
<span *ngIf="data.data.item_number">
{{ data.data.item_number }} &middot;
</span>
{{ data.data.title }}
</h1>
<div [innerHTML]="sanitizedText(data.data.text)"></div>
</div>

View File

@ -33,7 +33,17 @@ def topic_slide(
except KeyError:
raise ProjectorElementException(f"topic with id {topic_id} does not exist")
return {"title": topic["title"], "text": topic["text"]}
item_id = topic["agenda_item_id"]
try:
item = all_data["agenda/item"][item_id]
except KeyError:
raise ProjectorElementException(f"item with id {item_id} does not exist")
return {
"title": topic["title"],
"text": topic["text"],
"item_number": item["item_number"],
}
def register_projector_slides() -> None: