Merge pull request #5390 from jsangmeister/hide-amendments-when-deactivated

Hides amendments entry in menu if deactivated
This commit is contained in:
Emanuel Schütze 2020-06-02 22:26:14 +02:00 committed by GitHub
commit d7408b40f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 1 deletions

View File

@ -236,7 +236,7 @@
</div>
<!-- Amendments -->
<div *ngIf="perms.isAllowed('manage') || hasAmendments()">
<div *ngIf="amendmentsEnabled && (perms.isAllowed('manage') || hasAmendments())">
<button mat-menu-item routerLink="amendments">
<!-- color_lens -->
<!-- format_paint -->

View File

@ -139,6 +139,11 @@ export class MotionListComponent extends BaseListViewComponent<ViewMotion> imple
*/
public statutesEnabled: boolean;
/**
* Value of the configuration variable `motions_amendments_enabled` - are amendments enabled?
*/
public amendmentsEnabled: boolean;
/**
* Value of the config variable `motions_show_sequential_numbers`
*/
@ -235,6 +240,9 @@ export class MotionListComponent extends BaseListViewComponent<ViewMotion> imple
this.configService
.get<boolean>('motions_statutes_enabled')
.subscribe(enabled => (this.statutesEnabled = enabled));
this.configService
.get<boolean>('motions_amendments_enabled')
.subscribe(enabled => (this.amendmentsEnabled = enabled));
this.configService.get<string>('motions_recommendations_by').subscribe(recommender => {
this.recommendationEnabled = !!recommender;
});