|
1 | 1 | <ng-template> |
2 | | - <tbody *ngIf="rows"> |
3 | | - <tr *ngFor="let form of rows"> |
4 | | - <td> |
5 | | - <div class="row"> |
6 | | - <div class="col-sm-9"> |
7 | | - <a routerLink="{{form._id}}/view" (click)="onRowSelect($event, form)" class="text-decoration-none"><h5>{{ form.title }}</h5></a> |
8 | | - <div class="form-updated small text-muted"> |
9 | | - Updated {{ form.modified | timeSince }} ago |
| 2 | + @if (rows) { |
| 3 | + <tbody> |
| 4 | + @for (form of rows; track form._id) { |
| 5 | + <tr> |
| 6 | + <td> |
| 7 | + <div class="row"> |
| 8 | + <div class="col-sm-9"> |
| 9 | + <a routerLink="{{form._id}}/view" (click)="onRowSelect($event, form)" class="text-decoration-none"><h5>{{ form.title }}</h5></a> |
| 10 | + <div class="form-updated small text-muted"> |
| 11 | + Updated {{ form.modified | timeSince }} ago |
| 12 | + </div> |
| 13 | + </div> |
| 14 | + <div class="col-sm-3 d-flex justify-content-end align-items-center"> |
| 15 | + @if (actionAllowed('formView')) { |
| 16 | + <button #create class="btn btn-outline-secondary btn-sm form-btn form-btn-use" (click)="onRowAction($event, form, 'view')"><span class="fa fa-pencil bi bi-pencil"></span></button> |
| 17 | + } |
| 18 | + @if (actionAllowed('formSubmission')) { |
| 19 | + <button #view class="btn btn-outline-secondary btn-sm form-btn" (click)="onRowAction($event, form, 'submission')"><span class="fa fa-list-alt bi bi-table"></span></button> |
| 20 | + } |
| 21 | + @if (actionAllowed('formEdit')) { |
| 22 | + <button #edit class="btn btn-outline-secondary btn-sm form-btn" (click)="onRowAction($event, form, 'edit')"><span class="fa fa-edit bi bi-pencil-square"></span></button> |
| 23 | + } |
| 24 | + @if (actionAllowed('formDelete')) { |
| 25 | + <button #delete class="btn btn-secondary btn-sm form-btn form-btn-delete" (click)="onRowAction($event, form, 'delete')" title="Delete form"><span class="fa fa-trash bi bi-trash"></span></button> |
| 26 | + } |
| 27 | + </div> |
10 | 28 | </div> |
11 | | - </div> |
12 | | - <div class="col-sm-3 d-flex justify-content-end align-items-center"> |
13 | | - <button #create *ngIf="actionAllowed('formView')" class="btn btn-outline-secondary btn-sm form-btn form-btn-use" (click)="onRowAction($event, form, 'view')"><span class="fa fa-pencil bi bi-pencil"></span></button> |
14 | | - <button #view *ngIf="actionAllowed('formSubmission')" class="btn btn-outline-secondary btn-sm form-btn" (click)="onRowAction($event, form, 'submission')"><span class="fa fa-list-alt bi bi-table"></span></button> |
15 | | - <button #edit *ngIf="actionAllowed('formEdit')" class="btn btn-outline-secondary btn-sm form-btn" (click)="onRowAction($event, form, 'edit')"><span class="fa fa-edit bi bi-pencil-square"></span></button> |
16 | | - <button #delete *ngIf="actionAllowed('formDelete')" class="btn btn-secondary btn-sm form-btn form-btn-delete" (click)="onRowAction($event, form, 'delete')" title="Delete form"><span class="fa fa-trash bi bi-trash"></span></button> |
17 | | - </div> |
18 | | - </div> |
19 | | - </td> |
20 | | - </tr> |
21 | | - </tbody> |
| 29 | + </td> |
| 30 | + </tr> |
| 31 | + } |
| 32 | + </tbody> |
| 33 | + } |
22 | 34 | </ng-template> |
0 commit comments