reports.component.html 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <a mat-raised-button routerLink="/reports/create">New report</a>
  2. <h1 class="mat-h1">Reports</h1>
  3. <mat-table #table [dataSource]="reports" id="reports-list">
  4. <ng-container matColumnDef="id">
  5. <mat-header-cell *matHeaderCellDef> Id </mat-header-cell>
  6. <mat-cell *matCellDef="let report">
  7. <a [routerLink]="['/reports', report.id]">{{report.id}}</a>
  8. </mat-cell>
  9. </ng-container>
  10. <ng-container matColumnDef="description">
  11. <mat-header-cell *matHeaderCellDef> Description </mat-header-cell>
  12. <mat-cell *matCellDef="let report">
  13. <a [routerLink]="['/reports', report.id]">{{report.description}}</a>
  14. </mat-cell>
  15. </ng-container>
  16. <ng-container matColumnDef="date">
  17. <mat-header-cell *matHeaderCellDef> Date </mat-header-cell>
  18. <mat-cell *matCellDef="let report"> {{report.date | date}} </mat-cell>
  19. </ng-container>
  20. <ng-container matColumnDef="amount">
  21. <mat-header-cell *matHeaderCellDef> Amount </mat-header-cell>
  22. <mat-cell *matCellDef="let report"> {{report.amount | currency}} </mat-cell>
  23. </ng-container>
  24. <ng-container matColumnDef="approved">
  25. <mat-header-cell *matHeaderCellDef> Approved </mat-header-cell>
  26. <mat-cell *matCellDef="let report">
  27. <mat-icon *ngIf="report.approved" id="report${{report.id}}">check</mat-icon>
  28. </mat-cell>
  29. </ng-container>
  30. <ng-container matColumnDef="actions">
  31. <mat-header-cell *matHeaderCellDef></mat-header-cell>
  32. <mat-cell *matCellDef="let report">
  33. <div *ngIf="isAdmin | async">
  34. <button mat-icon-button color="primary" (click)="approve(report)">
  35. <mat-icon>check_circle</mat-icon>
  36. </button>
  37. <button mat-icon-button color="warn" (click)="reject(report)">
  38. <mat-icon>highlight_off</mat-icon>
  39. </button>
  40. </div>
  41. </mat-cell>
  42. </ng-container>
  43. <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
  44. <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
  45. </mat-table>