Hide motion preamble in final state

If a motion is in final state, the preamble does not get shown in detail
view and pdf
This commit is contained in:
Sean 2020-08-19 16:15:56 +02:00
parent aed17360e6
commit a9c1578ebb
6 changed files with 19 additions and 5 deletions

View File

@ -142,6 +142,10 @@ export class ViewMotion extends BaseViewModelWithAgendaItemAndListOfSpeakers<Mot
return this.speakerAmount > 0;
}
public get showPreamble(): boolean {
return !this.state?.isFinalState ?? true;
}
/**
* Translate the state's css class into a color
*

View File

@ -40,7 +40,7 @@
<div *ngIf="changes.length === 0" class="no-changes">{{ 'No change recommendations yet' | translate }}</div>
</section>
<span class="text-prefix-label">{{ preamble | translate }}</span>
<span class="text-prefix-label" *ngIf="showPreamble">{{ preamble | translate }}</span>
<!-- The actual diff view -->
<div class="motion-text-with-diffs">

View File

@ -85,6 +85,10 @@ export class MotionDetailDiffComponent extends BaseViewComponent implements Afte
public preamble: string;
public get showPreamble(): boolean {
return this.motion.showPreamble;
}
/**
* @param title
* @param translate

View File

@ -667,7 +667,7 @@
</div>
<!-- Text (hide preamble, if diff mode. The preample is included in the motion-detail-diff component) -->
<span *ngIf="!isRecoMode(ChangeRecoMode.Diff)" class="text-prefix-label">{{ preamble | translate }}</span>
<span *ngIf="showPreamble && !isRecoMode(ChangeRecoMode.Diff)" class="text-prefix-label">{{ preamble | translate }}</span>
<!-- Regular motions or traditional amendments -->
<ng-container *ngIf="!editMotion && !motion.isStatuteAmendment() && !motion.isParagraphBasedAmendment()">

View File

@ -167,6 +167,10 @@ export class MotionDetailComponent extends BaseViewComponent implements OnInit,
);
}
public get showPreamble(): boolean {
return this.motion.showPreamble;
}
/**
* Saves the target motion. Accessed via the getter and setter.
*/

View File

@ -132,8 +132,10 @@ export class MotionPdfService {
}
if (!contentToExport || contentToExport.includes('text')) {
if (motion.showPreamble) {
const preamble = this.createPreamble(motion);
motionPdfContent.push(preamble);
}
const text = this.createText(motion, lineLength, lnMode, crMode);
motionPdfContent.push(text);
}