config to show/hide motion sequential numbers

This commit is contained in:
Maximilian Krambach 2019-06-14 11:09:49 +02:00 committed by Emanuel Schütze
parent 184bb17596
commit ac1703242e
5 changed files with 33 additions and 4 deletions

View File

@ -113,9 +113,12 @@
<!-- Sequential number --> <!-- Sequential number -->
<span class="main-nav-color title-font"> <span class="main-nav-color title-font">
<span translate>Sequential number</span>&nbsp;{{ motion.id }} <span *ngIf="showSequential">
<span translate>Sequential number</span>
&nbsp;{{ motion.id }}
</span>
<span *ngIf="showSequential && motion.parent_id">&#xb7;&nbsp;</span>
<span *ngIf="motion.parent_id"> <span *ngIf="motion.parent_id">
&#xb7;
<span> <span>
<span translate>Amendment to</span>&nbsp;<a [routerLink]="motion.parent.getDetailStateURL()">{{ <span translate>Amendment to</span>&nbsp;<a [routerLink]="motion.parent.getDetailStateURL()">{{
motion.parent.identifier || motion.parent.title motion.parent.identifier || motion.parent.title

View File

@ -163,6 +163,11 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
*/ */
public statutesEnabled: boolean; public statutesEnabled: boolean;
/**
* Value of the config variable `motions_show_sequential_numbers`
*/
public showSequential: boolean;
/** /**
* Value of the config variable `motions_reason_required` * Value of the config variable `motions_reason_required`
*/ */
@ -493,7 +498,9 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
this.configService this.configService
.get<ChangeRecoMode>('motions_recommendation_text_mode') .get<ChangeRecoMode>('motions_recommendation_text_mode')
.subscribe(mode => (this.crMode = mode)); .subscribe(mode => (this.crMode = mode));
this.configService
.get<boolean>('motions_show_sequential_numbers')
.subscribe(shown => (this.showSequential = shown));
// disable the selector for attachments if there are none // disable the selector for attachments if there are none
this.mediafilesObserver.subscribe(() => { this.mediafilesObserver.subscribe(() => {
if (this.contentForm) { if (this.contentForm) {

View File

@ -90,7 +90,7 @@
<!-- Submitters --> <!-- Submitters -->
<div class="submitters-line ellipsis-overflow" *ngIf="motion.submitters.length"> <div class="submitters-line ellipsis-overflow" *ngIf="motion.submitters.length">
<span translate>by</span> {{ motion.submitters }} <span translate>by</span> {{ motion.submitters }}
<span *osPerms="'motions.can_manage'"> <span *ngIf="showSequential">
&middot; &middot;
<span translate>Sequential number</span> <span translate>Sequential number</span>
{{ motion.id }} {{ motion.id }}

View File

@ -116,6 +116,12 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion> imple
* @TODO replace by direct access to config variable, once it's available from the templates * @TODO replace by direct access to config variable, once it's available from the templates
*/ */
public statutesEnabled: boolean; public statutesEnabled: boolean;
/**
* Value of the config variable `motions_show_sequential_numbers`
*/
public showSequential: boolean;
public recommendationEnabled: boolean; public recommendationEnabled: boolean;
public tags: ViewTag[] = []; public tags: ViewTag[] = [];
@ -212,6 +218,9 @@ export class MotionListComponent extends ListViewBaseComponent<ViewMotion> imple
this.configService.get<string>('motions_recommendations_by').subscribe(recommender => { this.configService.get<string>('motions_recommendations_by').subscribe(recommender => {
this.recommendationEnabled = !!recommender; this.recommendationEnabled = !!recommender;
}); });
this.configService
.get<boolean>('motions_show_sequential_numbers')
.subscribe(show => (this.showSequential = show));
this.motionBlockRepo.getViewModelListObservable().subscribe(mBs => { this.motionBlockRepo.getViewModelListObservable().subscribe(mBs => {
this.motionBlocks = mBs; this.motionBlocks = mBs;
}); });

View File

@ -190,6 +190,16 @@ def get_config_variables():
subgroup="General", 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 # Amendments
yield ConfigVariable( yield ConfigVariable(