Merge pull request #5063 from GabrielInTheWorld/addsTitleToAgenda

Extends the title of the agenda-items
This commit is contained in:
Emanuel Schütze 2019-10-02 16:57:11 +02:00 committed by GitHub
commit c2c1186da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 26 additions and 24 deletions

View File

@ -96,14 +96,12 @@ export class ItemRepositoryService extends BaseHasContentObjectRepository<
*
* @returns An optional subtitle as `string`. Defaults to `null`.
*/
public getSubtitle = (titleInformation: ItemTitleInformation) => {
if (titleInformation.contentObject) {
return titleInformation.contentObject.getAgendaSubtitle();
public getSubtitle = (viewItem: ViewItem) => {
if (viewItem.contentObject) {
return viewItem.contentObject.getAgendaSubtitle();
} else {
const repo = this.collectionStringMapperService.getRepository(
titleInformation.contentObjectData.collection
) as BaseIsAgendaItemContentObjectRepository<any, any, any>;
return repo.getAgendaSubtitle(titleInformation.title_information);
// The subtitle is not present in the title_information yet.
return null;
}
};

View File

@ -59,14 +59,7 @@ export abstract class BaseIsAgendaItemAndListOfSpeakersContentObjectRepository<
return numberPrefix + this.getTitle(titleInformation) + ' (' + this.getVerboseName() + ')';
}
/**
* Overwrites the base function.
*
* @param titleInformation The information about the model.
*
* @returns {string | null} An optional subtitle. `Null`, if it returns no subtitle, otherwise `string`.
*/
public getAgendaSubtitle(titleInformation: T): string | null {
public getAgendaSubtitle(viewModel: V): string | null {
return null;
}

View File

@ -87,11 +87,10 @@ export abstract class BaseIsAgendaItemContentObjectRepository<
/**
* Overrides the base function. Returns an optional subtitle.
*
* @param titleInformation The information about the underlying model.
*
* @param viewModel The model to get the subtitle from.
* @returns A string as subtitle. Defaults to `null`.
*/
public getAgendaSubtitle(titleInformation: T): string | null {
public getAgendaSubtitle(viewModel: V): string | null {
return null;
}

View File

@ -287,17 +287,23 @@ export class MotionRepositoryService extends BaseIsAgendaItemAndListOfSpeakersCo
const numberPrefix = titleInformation.agenda_item_number ? `${titleInformation.agenda_item_number} · ` : '';
// Append the verbose name only, if not the special format 'Motion <identifier>' is used.
if (titleInformation.identifier) {
return numberPrefix + this.translate.instant('Motion') + ' ' + titleInformation.identifier;
return `${numberPrefix}${this.translate.instant('Motion')} ${titleInformation.identifier} · ${
titleInformation.title
}`;
} else {
return numberPrefix + titleInformation.title + ' (' + this.getVerboseName() + ')';
return `${numberPrefix}${titleInformation.title} (${this.getVerboseName()})`;
}
};
/**
* @override The base function and returns the submitters as optional subtitle.
*/
public getAgendaSubtitle = (model: ViewMotion) => {
return model.submittersAsUsers.join(', ');
public getAgendaSubtitle = (motion: ViewMotion) => {
if (motion.submittersAsUsers && motion.submittersAsUsers.length) {
return `${this.translate.instant('by')} ${motion.submittersAsUsers.join(', ')}`;
} else {
return null;
}
};
/**

View File

@ -36,7 +36,7 @@
*ngIf="!isMultiSelect"
></a>
<div [ngStyle]="{ 'margin-left': item.level * 25 + 'px' }">
<os-icon-container [icon]="item.closed ? 'check' : null" size="large">
<os-icon-container [noWrap]="true" [icon]="item.closed ? 'check' : null" size="large">
<div>
<div>
{{ item.getListTitle() }}
@ -61,6 +61,9 @@
</os-icon-container>
</div>
</div>
<div *ngIf="item.comment" class="align-right">
<os-icon-container [matTooltip]="item.comment" icon="comment"></os-icon-container>
</div>
</div>
<!-- Menu -->

View File

@ -13,6 +13,9 @@
width: $icon-size;
}
}
.align-right {
margin-left: auto;
}
/*
* Where is this used?

View File

@ -47,7 +47,7 @@ export abstract class BaseViewModelWithAgendaItemAndListOfSpeakers<
public getAgendaSlideTitle: () => string;
public getAgendaListTitle: () => string;
public getAgendaListTitleWithoutItemNumber: () => string;
public getAgendaSubtitle: () => string;
public getAgendaSubtitle: () => string | null;
public getListOfSpeakersTitle: () => string;
public getListOfSpeakersSlideTitle: () => string;