Hide the submitter-box in motion slide if empty

Hides the "submitter" text and corresponding boxes if they are empty
This commit is contained in:
Sean 2020-05-13 15:18:31 +02:00 committed by Emanuel Schütze
parent b7b27d2e88
commit fef3cf41bb
3 changed files with 46 additions and 37 deletions

View File

@ -63,7 +63,7 @@ export interface MotionSlideData {
reason?: string;
is_child: boolean;
show_meta_box: boolean;
submitter?: string[];
submitters?: string[];
recommender?: string;
recommendation?: string;
recommendation_extension?: string;

View File

@ -5,7 +5,7 @@
[ngStyle]="{ 'margin-top': projector.show_header_footer ? '144px' : '94px' }"
>
<!-- Submitters -->
<h3>{{ 'Submitters' | translate }}</h3>
<h3 *ngIf="data.data?.submitters?.length > 0">{{ 'Submitters' | translate }}</h3>
<span *ngFor="let submitter of data.data.submitters; let last = last">
{{ submitter }}<span *ngIf="!last">, </span>
</span>
@ -34,41 +34,41 @@
</span>
</h2>
<div *ngIf="!data.data.show_meta_box">
<table class="metatable spacer-top-20" cellpadding="0" cellspacing="0">
<!-- Submitters -->
<tr>
<td class="min">
<b>{{ 'Submitters' | translate }}:</b>
</td>
<td>
<span *ngFor="let submitter of data.data.submitters; let last = last">
{{ submitter }}<span *ngIf="!last">, </span>
</span>
</td>
</tr>
<!-- Recommendation -->
<tr *ngIf="data.data.recommendation && data.data.recommender">
<td class="min">
<b>{{ data.data.recommender }}:</b>
</td>
<td>
{{ getRecommendationLabel() }}
</td>
</tr>
<!-- recommendation referencing motions -->
<tr *ngIf="data.data.recommendation_referencing_motions">
<td class="min">
<b>{{ 'Referring motions' | translate }}:</b>
</td>
<td>
<span *ngFor="let titleInformation of referencingMotions; let last = last">
{{ getIdentifierOrTitle(titleInformation) }}<span *ngIf="!last">,</span>
</span>
</td>
</tr>
</table>
</div>
<!-- Metainfo as table -->
<table *ngIf="showMetaTable" class="metatable spacer-top-20" cellpadding="0" cellspacing="0">
<!-- Submitters -->
<tr *ngIf="data.data?.submitters?.length > 0">
<td class="min">
<b>{{ 'Submitters' | translate }}:</b>
</td>
<td>
<span *ngFor="let submitter of data.data.submitters; let last = last">
{{ submitter }}<span *ngIf="!last">, </span>
</span>
</td>
</tr>
<!-- Recommendation -->
<tr *ngIf="data.data.recommendation && data.data.recommender">
<td class="min">
<b>{{ data.data.recommender }}:</b>
</td>
<td>
{{ getRecommendationLabel() }}
</td>
</tr>
<!-- recommendation referencing motions -->
<tr *ngIf="data.data.recommendation_referencing_motions">
<td class="min">
<b>{{ 'Referring motions' | translate }}:</b>
</td>
<td>
<span *ngFor="let titleInformation of referencingMotions; let last = last">
{{ getIdentifierOrTitle(titleInformation) }}<span *ngIf="!last">,</span>
</span>
</td>
</tr>
</table>
</div>
</div>

View File

@ -85,6 +85,15 @@ export class MotionSlideComponent extends BaseMotionSlideComponent<MotionSlideDa
return this._data;
}
public get showMetaTable(): boolean {
return (
!this.data.data.show_meta_box &&
(this.data.data?.submitters.length > 0 ||
(!!this.data.data.recommendation && !!this.data.data.recommender) ||
!!this.data.data.recommendation_referencing_motions)
);
}
private _scroll = 0;
@Input()