ViewItem title (fixes #4464)

This commit is contained in:
FinnStutzenstein 2019-03-11 11:21:34 +01:00
parent 0419ea629f
commit aa81bf38c3
3 changed files with 5 additions and 14 deletions

View File

@ -78,16 +78,6 @@ export class ItemRepositoryService extends BaseRepository<ViewItem, Item> {
const viewItem = new ViewItem(item, contentObject); const viewItem = new ViewItem(item, contentObject);
viewItem.getVerboseName = this.getVerboseName; viewItem.getVerboseName = this.getVerboseName;
viewItem.getTitle = () => { viewItem.getTitle = () => {
if (viewItem.contentObject) {
return viewItem.contentObject.getAgendaTitle();
} else {
const repo = this.collectionStringMapperService.getRepository(
viewItem.item.content_object.collection
) as BaseAgendaContentObjectRepository<any, any>;
return repo.getAgendaTitle(viewItem);
}
};
viewItem.getListTitle = () => {
const numberPrefix = viewItem.itemNumber ? `${viewItem.itemNumber} · ` : ''; const numberPrefix = viewItem.itemNumber ? `${viewItem.itemNumber} · ` : '';
if (viewItem.contentObject) { if (viewItem.contentObject) {
@ -99,6 +89,7 @@ export class ItemRepositoryService extends BaseRepository<ViewItem, Item> {
return numberPrefix + repo.getAgendaTitleWithType(viewItem); return numberPrefix + repo.getAgendaTitleWithType(viewItem);
} }
}; };
viewItem.getListTitle = viewItem.getTitle;
return viewItem; return viewItem;
} }

View File

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

View File

@ -111,9 +111,9 @@ export class ViewItem extends BaseViewModel {
/** /**
* This is set by the repository * This is set by the repository
*/ */
public getVerboseName; public getVerboseName: () => string;
public getTitle; public getTitle: () => string;
public getListTitle; public getListTitle: () => string;
public listOfSpeakersSlide: ProjectorElementBuildDeskriptor = { public listOfSpeakersSlide: ProjectorElementBuildDeskriptor = {
getBasicProjectorElement: options => ({ getBasicProjectorElement: options => ({