From aa46922c8b9feef1299191e276cf5ef643b72c12 Mon Sep 17 00:00:00 2001 From: Joshua Sangmeister Date: Thu, 12 Mar 2020 11:49:34 +0100 Subject: [PATCH] added an indicator if all motions of a block are finished --- .../site/motions/models/view-motion-block.ts | 7 ++++++ .../motion-block-detail.component.html | 22 +++++++++++++++---- .../motion-block-detail.component.ts | 1 + .../motion-block-list.component.html | 22 ++++++++++++++----- 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/client/src/app/site/motions/models/view-motion-block.ts b/client/src/app/site/motions/models/view-motion-block.ts index 0e0ba32ca..b2182694d 100644 --- a/client/src/app/site/motions/models/view-motion-block.ts +++ b/client/src/app/site/motions/models/view-motion-block.ts @@ -23,6 +23,13 @@ export class ViewMotionBlock extends BaseViewModelWithAgendaItemAndListOfSpeaker return this._model; } + /** + * A block is finished when all its motions are in a final state + */ + public get isFinished(): boolean { + return this.motions && this.motions.length && this.motions.every(motion => motion.isInFinalState()); + } + /** * Formats the category for search * diff --git a/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.html b/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.html index 80c70702a..651e66f80 100644 --- a/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.html +++ b/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.html @@ -1,10 +1,24 @@
-

- lock - {{ block.title }} -

+ + +

{{ block.title }}

+
+
diff --git a/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts b/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts index a581bb0d9..ed54bffa4 100644 --- a/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-block/components/motion-block-detail/motion-block-detail.component.ts @@ -148,6 +148,7 @@ export class MotionBlockDetailComponent extends BaseListViewComponent('motions_show_sequential_numbers') .subscribe(show => (this.showSequential = show)); + (window).comp = this; } /** diff --git a/client/src/app/site/motions/modules/motion-block/components/motion-block-list/motion-block-list.component.html b/client/src/app/site/motions/modules/motion-block/components/motion-block-list/motion-block-list.component.html index 438d82e59..6624b8878 100644 --- a/client/src/app/site/motions/modules/motion-block/components/motion-block-list/motion-block-list.component.html +++ b/client/src/app/site/motions/modules/motion-block/components/motion-block-list/motion-block-list.component.html @@ -19,16 +19,28 @@
+
-
- {{ title }} -
+ +
+ {{ title }} +
+