Adds a variable to hide the motion-text on projector

This commit is contained in:
GabrielMeyer 2019-09-09 19:12:23 +02:00
parent 2c58d0f0fe
commit c0ded6f32e
4 changed files with 23 additions and 8 deletions

View File

@ -35,7 +35,7 @@
<div id="text-wrapper"> <div id="text-wrapper">
<div id="text" [ngStyle]="textDivStyles"> <div id="text" [ngStyle]="textDivStyles">
<!-- Text --> <!-- Text -->
<span class="text-prefix-label">{{ preamble | translate }}</span> <span *ngIf="isStatuteAmendment() || isParagraphBasedAmendment() || !!getFormattedText()" class="text-prefix-label">{{ preamble | translate }}</span>
<!-- Regular motions or traditional amendments --> <!-- Regular motions or traditional amendments -->
<ng-container *ngIf="!isStatuteAmendment() && !isParagraphBasedAmendment()"> <ng-container *ngIf="!isStatuteAmendment() && !isParagraphBasedAmendment()">
@ -51,7 +51,7 @@
</div> </div>
<div [innerHTML]="getFormattedTitleDiff()"></div> <div [innerHTML]="getFormattedTitleDiff()"></div>
</div> </div>
<div [innerHTML]="sanitizedText(getFormattedText())"></div> <div *ngIf="getFormattedText()" [innerHTML]="sanitizedText(getFormattedText())"></div>
</div> </div>
</ng-container> </ng-container>

View File

@ -324,6 +324,9 @@ export class MotionSlideComponent extends BaseMotionSlideComponent<MotionSlideDa
// const changes: ViewUnifiedChange[] = Object.assign([], this.allChangingObjects); // const changes: ViewUnifiedChange[] = Object.assign([], this.allChangingObjects);
const motion = this.data.data; const motion = this.data.data;
if (!motion.text) {
return null;
}
switch (this.crMode) { switch (this.crMode) {
case ChangeRecoMode.Original: case ChangeRecoMode.Original:
return this.lineNumbering.insertLineNumbers(motion.text, this.lineLength, this.highlightedLine); return this.lineNumbering.insertLineNumbers(motion.text, this.lineLength, this.highlightedLine);

View File

@ -95,12 +95,22 @@ def get_config_variables():
subgroup="General", subgroup="General",
) )
yield ConfigVariable(
name="motions_disable_text_on_projector",
default_value=False,
input_type="boolean",
label="Hide motion-text on projector",
weight=325,
group="Motions",
subgroup="General",
)
yield ConfigVariable( yield ConfigVariable(
name="motions_disable_reason_on_projector", name="motions_disable_reason_on_projector",
default_value=False, default_value=False,
input_type="boolean", input_type="boolean",
label="Hide reason on projector", label="Hide reason on projector",
weight=325, weight=326,
group="Motions", group="Motions",
subgroup="General", subgroup="General",
) )
@ -110,7 +120,7 @@ def get_config_variables():
default_value=False, default_value=False,
input_type="boolean", input_type="boolean",
label="Hide meta information box on projector", label="Hide meta information box on projector",
weight=326, weight=327,
group="Motions", group="Motions",
subgroup="General", subgroup="General",
) )
@ -120,7 +130,7 @@ def get_config_variables():
default_value=False, default_value=False,
input_type="boolean", input_type="boolean",
label="Hide recommendation on projector", label="Hide recommendation on projector",
weight=327, weight=328,
group="Motions", group="Motions",
subgroup="General", subgroup="General",
) )
@ -130,7 +140,7 @@ def get_config_variables():
default_value=False, default_value=False,
input_type="boolean", input_type="boolean",
label="Hide referring motions", label="Hide referring motions",
weight=328, weight=329,
group="Motions", group="Motions",
subgroup="General", subgroup="General",
) )
@ -141,7 +151,7 @@ def get_config_variables():
input_type="boolean", input_type="boolean",
label="Show the sequential number for a motion", label="Show the sequential number for a motion",
help_text="In motion list, motion detail and PDF.", help_text="In motion list, motion detail and PDF.",
weight=329, weight=330,
group="Motions", group="Motions",
subgroup="General", subgroup="General",
) )

View File

@ -211,7 +211,6 @@ async def motion_slide(
"identifier": motion["identifier"], "identifier": motion["identifier"],
"title": motion["title"], "title": motion["title"],
"preamble": motions_preamble, "preamble": motions_preamble,
"text": motion["text"],
"amendment_paragraphs": motion["amendment_paragraphs"], "amendment_paragraphs": motion["amendment_paragraphs"],
"base_motion": base_motion, "base_motion": base_motion,
"base_statute": base_statute, "base_statute": base_statute,
@ -224,6 +223,9 @@ async def motion_slide(
"line_numbering_mode": line_numbering_mode, "line_numbering_mode": line_numbering_mode,
} }
if not await get_config(all_data, "motions_disable_text_on_projector"):
return_value["text"] = motion["text"]
if not await get_config(all_data, "motions_disable_reason_on_projector"): if not await get_config(all_data, "motions_disable_reason_on_projector"):
return_value["reason"] = motion["reason"] return_value["reason"] = motion["reason"]