Merge pull request #4939 from tsiegleauq/filter-has-speaker
Add speakers-filter to motion list
This commit is contained in:
commit
afb804b7a2
@ -329,6 +329,10 @@ export class ViewMotion extends BaseViewModelWithAgendaItemAndListOfSpeakers<Mot
|
||||
return !!this.personalNote && !!this.personalNote.note;
|
||||
}
|
||||
|
||||
public get hasSpeakers(): boolean {
|
||||
return this.speakerAmount > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Translate the state's css class into a color
|
||||
*
|
||||
|
@ -88,6 +88,15 @@ export class MotionFilterListService extends BaseFilterListService<ViewMotion> {
|
||||
options: []
|
||||
};
|
||||
|
||||
public hasSpeakerOptions: OsFilter = {
|
||||
property: 'hasSpeakers',
|
||||
label: 'Speakers',
|
||||
options: [
|
||||
{ condition: true, label: this.translate.instant('Has speakers') },
|
||||
{ condition: false, label: this.translate.instant('Has no speakers') }
|
||||
]
|
||||
};
|
||||
|
||||
public personalNoteFilterOptions = [
|
||||
{
|
||||
property: 'star',
|
||||
@ -212,6 +221,11 @@ export class MotionFilterListService extends BaseFilterListService<ViewMotion> {
|
||||
this.tagFilterOptions
|
||||
];
|
||||
|
||||
// only add the filter if the user has the correct permission
|
||||
if (this.operator.hasPerms('agenda.can_see_list_of_speakers')) {
|
||||
filterDefinitions.push(this.hasSpeakerOptions);
|
||||
}
|
||||
|
||||
if (!this.operator.isAnonymous) {
|
||||
filterDefinitions = filterDefinitions.concat(this.personalNoteFilterOptions);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user