Better empty view widget

This commit is contained in:
shamoon 2023-09-23 22:13:37 -07:00
parent d7305ab701
commit d8314500a0

View File

@ -1,9 +1,8 @@
<pngx-widget-frame [title]="savedView.name" [loading]="loading"> <pngx-widget-frame [title]="savedView.name" [loading]="loading" *pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.Document }">
<a class="btn-link" header-buttons [routerLink]="[]" (click)="showAll()" *pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.Document }" i18n>Show all</a> <a *ngIf="documents.length" class="btn-link" header-buttons [routerLink]="[]" (click)="showAll()" i18n>Show all</a>
<table *ngIf="documents.length; else empty" content class="table table-hover mb-0 align-middle">
<table content class="table table-hover mb-0 align-middle">
<thead> <thead>
<tr> <tr>
<th scope="col" i18n>Created</th> <th scope="col" i18n>Created</th>
@ -12,7 +11,7 @@
<th scope="col" class="d-none d-md-table-cell" i18n>Correspondent</th> <th scope="col" class="d-none d-md-table-cell" i18n>Correspondent</th>
</tr> </tr>
</thead> </thead>
<tbody *pngxIfPermissions="{ action: PermissionAction.View, type: PermissionType.Document }"> <tbody>
<tr *ngFor="let doc of documents" (mouseleave)="mouseLeaveCard()"> <tr *ngFor="let doc of documents" (mouseleave)="mouseLeaveCard()">
<td class="py-2 py-md-3"><a routerLink="/documents/{{doc.id}}" class="btn-link text-dark text-decoration-none">{{doc.created_date | customDate}}</a></td> <td class="py-2 py-md-3"><a routerLink="/documents/{{doc.id}}" class="btn-link text-dark text-decoration-none">{{doc.created_date | customDate}}</a></td>
<td class="py-2 py-md-3"> <td class="py-2 py-md-3">
@ -45,4 +44,8 @@
</tbody> </tbody>
</table> </table>
<ng-template #empty>
<p i18n class="text-center text-muted mb-0 fst-italic">No documents</p>
</ng-template>
</pngx-widget-frame> </pngx-widget-frame>