ng-container in list component

This commit is contained in:
Edi Cziszter 2022-01-17 12:53:39 +02:00
parent b795b50c84
commit c8f19f68e0
2 changed files with 32 additions and 32 deletions

View File

@ -1,31 +1,29 @@
<ng-container *ngIf="annotationReferences">
<div class="content-container">
<div class="dialog references-dialog">
<div class="references-header flex">
<div class="small-label">
{{ annotationReferences.length }}
{{ (annotationReferences.length === 1 ? 'references.singular' : 'references.plural') | translate }}
</div>
<iqser-circle-button (action)="annotationReferencesService.hide()" icon="iqser:close"></iqser-circle-button>
<div class="content-container">
<div class="dialog references-dialog">
<div class="references-header flex">
<div class="small-label">
{{ annotationReferences.length }}
{{ (annotationReferences.length === 1 ? 'references.singular' : 'references.plural') | translate }}
</div>
<div class="annotations-container flex">
<div class="annotation-container">
<div class="annotation-card-container flex">
<redaction-annotation-card [annotation]="annotation" [file]="file"></redaction-annotation-card>
<redaction-annotation-references-page-indicator
[number]="annotation.pageNumber"
></redaction-annotation-references-page-indicator>
</div>
<iqser-circle-button (action)="annotationReferencesService.hide()" icon="iqser:close"></iqser-circle-button>
</div>
<div class="annotations-container flex">
<div class="annotation-container">
<div class="annotation-card-container flex">
<redaction-annotation-card [annotation]="annotation" [file]="file"></redaction-annotation-card>
<redaction-annotation-references-page-indicator
[number]="annotation.pageNumber"
></redaction-annotation-references-page-indicator>
</div>
<div class="annotation-container" *ngFor="let reference of annotationReferences" (click)="referenceClicked.emit(reference)">
<div class="annotation-card-container flex">
<redaction-annotation-card [annotation]="reference" [file]="file"></redaction-annotation-card>
<redaction-annotation-references-page-indicator
[number]="reference.pageNumber"
></redaction-annotation-references-page-indicator>
</div>
</div>
<div (click)="referenceClicked.emit(reference)" *ngFor="let reference of annotationReferences" class="annotation-container">
<div class="annotation-card-container flex">
<redaction-annotation-card [annotation]="reference" [file]="file"></redaction-annotation-card>
<redaction-annotation-references-page-indicator
[number]="reference.pageNumber"
></redaction-annotation-references-page-indicator>
</div>
</div>
</div>
</div>
</ng-container>
</div>

View File

@ -44,10 +44,12 @@
<redaction-annotation-details [annotation]="annotation"></redaction-annotation-details>
</div>
<redaction-annotation-references-dialog
(referenceClicked)="referenceClicked($event)"
*ngIf="annotationReferencesService.annotation$ | async as annotation"
[annotation]="annotation"
[fileData]="fileData"
[file]="file"
></redaction-annotation-references-dialog>
<ng-container *ngIf="annotationReferencesService.annotation$ | async as annotation">
<redaction-annotation-references-dialog
(referenceClicked)="referenceClicked($event)"
*ngIf="annotationReferencesService.hasReferences([annotation])"
[annotation]="annotation"
[fileData]="fileData"
[file]="file"
></redaction-annotation-references-dialog>
</ng-container>