diff --git a/client/package.json b/client/package.json index e019d6b10..7317f2128 100644 --- a/client/package.json +++ b/client/package.json @@ -47,8 +47,8 @@ "@ngx-pwa/local-storage": "~8.2.1", "@ngx-translate/core": "~11.0.1", "@ngx-translate/http-loader": "^4.0.0", - "@pebula/ngrid": "1.0.0-rc.5", - "@pebula/ngrid-material": "1.0.0-rc.5", + "@pebula/ngrid": "1.0.0-rc.9", + "@pebula/ngrid-material": "1.0.0-rc.9", "@pebula/utils": "1.0.0", "@tinymce/tinymce-angular": "^3.2.0", "acorn": "^7.0.0", diff --git a/client/src/app/core/repositories/agenda/item-repository.service.ts b/client/src/app/core/repositories/agenda/item-repository.service.ts index 97f8b69af..da4c7abca 100644 --- a/client/src/app/core/repositories/agenda/item-repository.service.ts +++ b/client/src/app/core/repositories/agenda/item-repository.service.ts @@ -91,6 +91,22 @@ export class ItemRepositoryService extends BaseHasContentObjectRepository< } }; + /** + * Overrides the base function, if implemented. + * + * @returns An optional subtitle as `string`. Defaults to `null`. + */ + public getSubtitle = (titleInformation: ItemTitleInformation) => { + if (titleInformation.contentObject) { + return titleInformation.contentObject.getAgendaSubtitle(); + } else { + const repo = this.collectionStringMapperService.getRepository( + titleInformation.contentObjectData.collection + ) as BaseIsAgendaItemContentObjectRepository; + return repo.getAgendaSubtitle(titleInformation.title_information); + } + }; + /** * Overrides the base function. * @@ -107,6 +123,20 @@ export class ItemRepositoryService extends BaseHasContentObjectRepository< } }; + /** + * @override The base-function to extends the items with an optional subtitle. + * + * @param model The underlying item. + * @param initialLoading boolean passed to the base-function. + * + * @returns {ViewItem} The modified item extended with the `getSubtitle()`-function. + */ + protected createViewModelWithTitles(model: Item, initialLoading: boolean): ViewItem { + const viewModel = super.createViewModelWithTitles(model, initialLoading); + viewModel.getSubtitle = () => this.getSubtitle(viewModel); + return viewModel; + } + /** * Trigger the automatic numbering sequence on the server */ diff --git a/client/src/app/core/repositories/base-is-agenda-item-and-list-of-speakers-content-object-repository.ts b/client/src/app/core/repositories/base-is-agenda-item-and-list-of-speakers-content-object-repository.ts index 040084e2e..7cd046150 100644 --- a/client/src/app/core/repositories/base-is-agenda-item-and-list-of-speakers-content-object-repository.ts +++ b/client/src/app/core/repositories/base-is-agenda-item-and-list-of-speakers-content-object-repository.ts @@ -59,6 +59,17 @@ 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 { + return null; + } + public getAgendaSlideTitle(titleInformation: T): string { const numberPrefix = titleInformation.agenda_item_number ? `${titleInformation.agenda_item_number} ยท ` : ''; return numberPrefix + this.getTitle(titleInformation); @@ -88,6 +99,7 @@ export abstract class BaseIsAgendaItemAndListOfSpeakersContentObjectRepository< viewModel.getAgendaListTitle = () => this.getAgendaListTitle(viewModel); viewModel.getAgendaListTitleWithoutItemNumber = () => this.getAgendaListTitleWithoutItemNumber(viewModel); viewModel.getAgendaSlideTitle = () => this.getAgendaSlideTitle(viewModel); + viewModel.getAgendaSubtitle = () => this.getAgendaSubtitle(viewModel); viewModel.getListOfSpeakersTitle = () => this.getListOfSpeakersTitle(viewModel); viewModel.getListOfSpeakersSlideTitle = () => this.getListOfSpeakersSlideTitle(viewModel); return viewModel; diff --git a/client/src/app/core/repositories/base-is-agenda-item-content-object-repository.ts b/client/src/app/core/repositories/base-is-agenda-item-content-object-repository.ts index e82a6aa11..fe8f5fa53 100644 --- a/client/src/app/core/repositories/base-is-agenda-item-content-object-repository.ts +++ b/client/src/app/core/repositories/base-is-agenda-item-content-object-repository.ts @@ -84,6 +84,17 @@ export abstract class BaseIsAgendaItemContentObjectRepository< return numberPrefix + this.getTitle(titleInformation) + ' (' + this.getVerboseName() + ')'; } + /** + * Overrides the base function. Returns an optional subtitle. + * + * @param titleInformation The information about the underlying model. + * + * @returns A string as subtitle. Defaults to `null`. + */ + public getAgendaSubtitle(titleInformation: T): string | null { + return null; + } + /** * Function to return the title without item-number, in example used for pdf-creation. * @@ -110,6 +121,7 @@ export abstract class BaseIsAgendaItemContentObjectRepository< viewModel.getAgendaListTitle = () => this.getAgendaListTitle(viewModel); viewModel.getAgendaListTitleWithoutItemNumber = () => this.getAgendaListTitleWithoutItemNumber(viewModel); viewModel.getAgendaSlideTitle = () => this.getAgendaSlideTitle(viewModel); + viewModel.getAgendaSubtitle = () => this.getAgendaSubtitle(viewModel); return viewModel; } } diff --git a/client/src/app/core/repositories/motions/motion-repository.service.ts b/client/src/app/core/repositories/motions/motion-repository.service.ts index 522db0ad9..88b94c7b3 100644 --- a/client/src/app/core/repositories/motions/motion-repository.service.ts +++ b/client/src/app/core/repositories/motions/motion-repository.service.ts @@ -293,6 +293,13 @@ export class MotionRepositoryService extends BaseIsAgendaItemAndListOfSpeakersCo } }; + /** + * @override The base function and returns the submitters as optional subtitle. + */ + public getAgendaSubtitle = (model: ViewMotion) => { + return model.submittersAsUsers.join(', '); + }; + /** * @override The base function */ diff --git a/client/src/app/shared/components/list-view-table/list-view-table.component.html b/client/src/app/shared/components/list-view-table/list-view-table.component.html index f278648a3..cfa5ea52c 100644 --- a/client/src/app/shared/components/list-view-table/list-view-table.component.html +++ b/client/src/app/shared/components/list-view-table/list-view-table.component.html @@ -13,15 +13,11 @@
- {{ item.getListTitle() }} +
+
+ {{ item.getListTitle() }} +
+
+ {{ item.getSubtitle() }} +
+
@@ -52,10 +60,6 @@ {{ durationService.durationToString(item.duration, 'h') }} - -
- {{ item.comment }} -
diff --git a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.scss b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.scss index 97bf09076..f3d57549d 100644 --- a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.scss +++ b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.scss @@ -1,5 +1,4 @@ @import '~assets/styles/tables.scss'; - .info-col-items { display: inline-block; white-space: nowrap; @@ -15,6 +14,9 @@ } } +/* +* Where is this used? +*/ .done-check { margin-right: 10px; } diff --git a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts index eff8977fe..75fa431b1 100644 --- a/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts +++ b/client/src/app/site/agenda/components/agenda-list/agenda-list.component.ts @@ -44,6 +44,11 @@ export class AgendaListComponent extends BaseListViewComponent impleme */ public isNumberingAllowed: boolean; + /** + * A boolean, that decides, if the optional subtitles should be shown. + */ + public showSubtitle: boolean; + /** * Helper to check main button permissions * @@ -146,6 +151,7 @@ export class AgendaListComponent extends BaseListViewComponent impleme this.config .get('agenda_enable_numbering') .subscribe(autoNumbering => (this.isNumberingAllowed = autoNumbering)); + this.config.get('agenda_show_subtitle').subscribe(showSubtitle => (this.showSubtitle = showSubtitle)); } /** diff --git a/client/src/app/site/agenda/models/view-item.ts b/client/src/app/site/agenda/models/view-item.ts index be888e9f7..f1ba15ead 100644 --- a/client/src/app/site/agenda/models/view-item.ts +++ b/client/src/app/site/agenda/models/view-item.ts @@ -46,6 +46,8 @@ export class ViewItem extends BaseViewModelWithContentObject string | null; + /** * Gets the string representation of the item type * @returns The visibility for this item, as defined in {@link itemVisibilityChoices} diff --git a/client/src/app/site/base/base-view-model-with-agenda-item-and-list-of-speakers.ts b/client/src/app/site/base/base-view-model-with-agenda-item-and-list-of-speakers.ts index 655d83cef..cc86b9062 100644 --- a/client/src/app/site/base/base-view-model-with-agenda-item-and-list-of-speakers.ts +++ b/client/src/app/site/base/base-view-model-with-agenda-item-and-list-of-speakers.ts @@ -47,6 +47,7 @@ export abstract class BaseViewModelWithAgendaItemAndListOfSpeakers< public getAgendaSlideTitle: () => string; public getAgendaListTitle: () => string; public getAgendaListTitleWithoutItemNumber: () => string; + public getAgendaSubtitle: () => string; public getListOfSpeakersTitle: () => string; public getListOfSpeakersSlideTitle: () => string; diff --git a/client/src/app/site/base/base-view-model-with-agenda-item.ts b/client/src/app/site/base/base-view-model-with-agenda-item.ts index dc7e3d010..e9e438463 100644 --- a/client/src/app/site/base/base-view-model-with-agenda-item.ts +++ b/client/src/app/site/base/base-view-model-with-agenda-item.ts @@ -46,6 +46,11 @@ export interface IBaseViewModelWithAgendaItem string; + /** + * @return an optional subtitle for the agenda. + */ + getAgendaSubtitle: () => string | null; + /** * @return the agenda title with the verbose name of the content object */ @@ -108,6 +113,15 @@ export abstract class BaseViewModelWithAgendaItem