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; reason?: string;
is_child: boolean; is_child: boolean;
show_meta_box: boolean; show_meta_box: boolean;
submitter?: string[]; submitters?: string[];
recommender?: string; recommender?: string;
recommendation?: string; recommendation?: string;
recommendation_extension?: string; recommendation_extension?: string;

View File

@ -5,7 +5,7 @@
[ngStyle]="{ 'margin-top': projector.show_header_footer ? '144px' : '94px' }" [ngStyle]="{ 'margin-top': projector.show_header_footer ? '144px' : '94px' }"
> >
<!-- Submitters --> <!-- 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"> <span *ngFor="let submitter of data.data.submitters; let last = last">
{{ submitter }}<span *ngIf="!last">, </span> {{ submitter }}<span *ngIf="!last">, </span>
</span> </span>
@ -34,10 +34,10 @@
</span> </span>
</h2> </h2>
<div *ngIf="!data.data.show_meta_box"> <!-- Metainfo as table -->
<table class="metatable spacer-top-20" cellpadding="0" cellspacing="0"> <table *ngIf="showMetaTable" class="metatable spacer-top-20" cellpadding="0" cellspacing="0">
<!-- Submitters --> <!-- Submitters -->
<tr> <tr *ngIf="data.data?.submitters?.length > 0">
<td class="min"> <td class="min">
<b>{{ 'Submitters' | translate }}:</b> <b>{{ 'Submitters' | translate }}:</b>
</td> </td>
@ -68,7 +68,7 @@
</td> </td>
</tr> </tr>
</table> </table>
</div>
</div> </div>
</div> </div>

View File

@ -85,6 +85,15 @@ export class MotionSlideComponent extends BaseMotionSlideComponent<MotionSlideDa
return this._data; 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; private _scroll = 0;
@Input() @Input()