From dee41593c434402d3d68318f1ded8466b830c445 Mon Sep 17 00:00:00 2001 From: Sean Engelhardt Date: Thu, 22 Aug 2019 15:39:18 +0200 Subject: [PATCH] Add speakers-filter to motion list The motion list (and the amendment list) now have an option to filter if speakers are present on the corresponding LOS-object to the displayed motions --- client/src/app/site/motions/models/view-motion.ts | 4 ++++ .../motions/services/motion-filter-list.service.ts | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/client/src/app/site/motions/models/view-motion.ts b/client/src/app/site/motions/models/view-motion.ts index 9338c1c86..456adf8bb 100644 --- a/client/src/app/site/motions/models/view-motion.ts +++ b/client/src/app/site/motions/models/view-motion.ts @@ -329,6 +329,10 @@ export class ViewMotion extends BaseViewModelWithAgendaItemAndListOfSpeakers 0; + } + /** * Translate the state's css class into a color * diff --git a/client/src/app/site/motions/services/motion-filter-list.service.ts b/client/src/app/site/motions/services/motion-filter-list.service.ts index 75df1afe9..28da12fce 100644 --- a/client/src/app/site/motions/services/motion-filter-list.service.ts +++ b/client/src/app/site/motions/services/motion-filter-list.service.ts @@ -88,6 +88,15 @@ export class MotionFilterListService extends BaseFilterListService { 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 { 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); }