OpenSlides/client/src/app/shared/models/base/agenda-base-model.ts
FinnStutzenstein 1ee76de417 Handling of titles, projection and content objects in items
Restructure the titles for motion, motion-block, assignment and topic.
Less possibilities for more clear code. Added mote base models enabling
functionalities of projection and being a content object for items
2018-09-14 08:36:35 +02:00

38 lines
1.2 KiB
TypeScript

import { AgendaInformation } from './agenda-information';
import { ProjectableBaseModel } from './projectable-base-model';
/**
* A base model for models, that can be content objects in the agenda. Provides title and navigation
* information for the agenda.
*/
export abstract class AgendaBaseModel extends ProjectableBaseModel implements AgendaInformation {
protected verboseName: string;
/**
* A Model that inherits from this class should provide a verbose name. It's used by creating
* the agenda title with type.
* @param collectionString
* @param verboseName
* @param input
*/
protected constructor(collectionString: string, verboseName: string, input?: any) {
super(collectionString, input);
this.verboseName = verboseName;
}
public getAgendaTitle(): string {
return this.getTitle();
}
public getAgendaTitleWithType(): string {
// Return the agenda title with the model's verbose name appended
return this.getAgendaTitle() + ' (' + this.verboseName + ')';
}
/**
* Should return the URL to the detail view. Used for the agenda, that the
* user can navigate to the content object.
*/
public abstract getDetailStateURL(): string;
}