report.component.html 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <mat-card class="create-report">
  2. <mat-card-header class="create-report-header">
  3. {{ title }}
  4. </mat-card-header>
  5. <mat-card-content class="create-report-form-content">
  6. <mat-form-field>
  7. <input
  8. matInput
  9. placeholder="Description"
  10. required
  11. [(ngModel)]="description"
  12. #descript="ngModel">
  13. <div *ngIf="descript.invalid && (descript.dirty || descript.touched)"
  14. class="alert alert-danger">
  15. </div>
  16. </mat-form-field>
  17. <mat-toolbar color="primary">
  18. <span>Report items</span>
  19. <span class="create-report-toolbar-spacer"></span>
  20. <button mat-icon-button (click)="addItem()">
  21. <mat-icon aria-label="Add new item">playlist_add</mat-icon>
  22. </button>
  23. <button mat-icon-button (click)="save()">
  24. <mat-icon aria-label="Save report">save</mat-icon>
  25. </button>
  26. </mat-toolbar>
  27. <mat-table #table [dataSource]="dataSource">
  28. <ng-container matColumnDef="description">
  29. <mat-header-cell *matHeaderCellDef> Description </mat-header-cell>
  30. <mat-cell *matCellDef="let item"> {{item.description}} </mat-cell>
  31. </ng-container>
  32. <ng-container matColumnDef="amount">
  33. <mat-header-cell *matHeaderCellDef> Amount </mat-header-cell>
  34. <mat-cell *matCellDef="let item"> {{item.amount | currency}} </mat-cell>
  35. </ng-container>
  36. <ng-container matColumnDef="type">
  37. <mat-header-cell *matHeaderCellDef> Type </mat-header-cell>
  38. <mat-cell *matCellDef="let item"> {{item.type}} </mat-cell>
  39. </ng-container>
  40. <ng-container matColumnDef="date">
  41. <mat-header-cell *matHeaderCellDef> Date </mat-header-cell>
  42. <mat-cell *matCellDef="let item"> {{item.date | date}} </mat-cell>
  43. </ng-container>
  44. <ng-container matColumnDef="hasReceipt">
  45. <mat-header-cell *matHeaderCellDef> Has receipt </mat-header-cell>
  46. <mat-cell *matCellDef="let item">
  47. <mat-icon *ngIf="item.hasReceipt">check</mat-icon>
  48. </mat-cell>
  49. </ng-container>
  50. <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
  51. <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
  52. </mat-table>
  53. </mat-card-content>
  54. </mat-card>
  55. <button mat-raised-button color="warn" (click)="cancel()">Cancel</button>