From ac1703242e3eed49c4144b312d79e76d75f54f65 Mon Sep 17 00:00:00 2001 From: Maximilian Krambach Date: Fri, 14 Jun 2019 11:09:49 +0200 Subject: [PATCH] config to show/hide motion sequential numbers --- .../motion-detail/motion-detail.component.html | 7 +++++-- .../motion-detail/motion-detail.component.ts | 9 ++++++++- .../components/motion-list/motion-list.component.html | 2 +- .../components/motion-list/motion-list.component.ts | 9 +++++++++ openslides/motions/config_variables.py | 10 ++++++++++ 5 files changed, 33 insertions(+), 4 deletions(-) diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html index e423440a5..fc81a13dd 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.html @@ -113,9 +113,12 @@ - Sequential number {{ motion.id }} + + Sequential number +  {{ motion.id }} + + ·  - · Amendment to {{ motion.parent.identifier || motion.parent.title diff --git a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts index 930f57a0b..0ca5a92aa 100644 --- a/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts +++ b/client/src/app/site/motions/modules/motion-detail/components/motion-detail/motion-detail.component.ts @@ -163,6 +163,11 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, */ public statutesEnabled: boolean; + /** + * Value of the config variable `motions_show_sequential_numbers` + */ + public showSequential: boolean; + /** * Value of the config variable `motions_reason_required` */ @@ -493,7 +498,9 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit, this.configService .get('motions_recommendation_text_mode') .subscribe(mode => (this.crMode = mode)); - + this.configService + .get('motions_show_sequential_numbers') + .subscribe(shown => (this.showSequential = shown)); // disable the selector for attachments if there are none this.mediafilesObserver.subscribe(() => { if (this.contentForm) { diff --git a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.html b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.html index 0a5df7595..b9bb92395 100644 --- a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.html +++ b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.html @@ -90,7 +90,7 @@
by {{ motion.submitters }} - + · Sequential number {{ motion.id }} diff --git a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts index 17fa70f67..31d03a979 100644 --- a/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts +++ b/client/src/app/site/motions/modules/motion-list/components/motion-list/motion-list.component.ts @@ -116,6 +116,12 @@ export class MotionListComponent extends ListViewBaseComponent imple * @TODO replace by direct access to config variable, once it's available from the templates */ public statutesEnabled: boolean; + + /** + * Value of the config variable `motions_show_sequential_numbers` + */ + public showSequential: boolean; + public recommendationEnabled: boolean; public tags: ViewTag[] = []; @@ -212,6 +218,9 @@ export class MotionListComponent extends ListViewBaseComponent imple this.configService.get('motions_recommendations_by').subscribe(recommender => { this.recommendationEnabled = !!recommender; }); + this.configService + .get('motions_show_sequential_numbers') + .subscribe(show => (this.showSequential = show)); this.motionBlockRepo.getViewModelListObservable().subscribe(mBs => { this.motionBlocks = mBs; }); diff --git a/openslides/motions/config_variables.py b/openslides/motions/config_variables.py index b3c0f73c0..5e0cd2543 100644 --- a/openslides/motions/config_variables.py +++ b/openslides/motions/config_variables.py @@ -190,6 +190,16 @@ def get_config_variables(): subgroup="General", ) + yield ConfigVariable( + name="motions_show_sequential_numbers", + default_value=True, + input_type="boolean", + label="Show the sequential number for a motion", + weight=336, + group="Motions", + subgroup="General", + ) + # Amendments yield ConfigVariable(