95 lines
3.0 KiB
HTML
95 lines
3.0 KiB
HTML
<h2 class="row-container space-between">
|
|
<span>Bundles</span>
|
|
<button mat-icon-button (click)="exportCsv()" [disabled]="!(data | async)?.length">
|
|
<mat-icon>save_alt</mat-icon>
|
|
</button>
|
|
<a mat-button [routerLink]="['/bundles', 'new']">
|
|
<mat-icon>add_box</mat-icon>
|
|
Add
|
|
</a>
|
|
</h2>
|
|
|
|
<form [formGroup]="form" class="flex-col">
|
|
<div class="row-container">
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Filter</mat-label>
|
|
<input type="text" matInput formControlName="filter" autocomplete="off" />
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Menu Category</mat-label>
|
|
<mat-select formControlName="menuCategory" (selectionChange)="filterOn($event.value)">
|
|
<mat-option>-- All Bundles --</mat-option>
|
|
@for (mc of menuCategories; track mc) {
|
|
<mat-option [value]="mc.id">
|
|
{{ mc.name }}
|
|
</mat-option>
|
|
}
|
|
</mat-select>
|
|
</mat-form-field>
|
|
</div>
|
|
</form>
|
|
|
|
<mat-table #table [dataSource]="dataSource" aria-label="Bundles">
|
|
<!-- Name -->
|
|
<ng-container matColumnDef="name">
|
|
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">
|
|
<a [routerLink]="['/bundles', row.id]">{{ row.name }} ({{ row.units }})</a>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Price -->
|
|
<ng-container matColumnDef="price">
|
|
<mat-header-cell *matHeaderCellDef class="right">Price</mat-header-cell>
|
|
<mat-cell *matCellDef="let row" class="right">
|
|
{{ row.salePrice | currency: 'INR' }}
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Menu Category -->
|
|
<ng-container matColumnDef="menuCategory">
|
|
<mat-header-cell *matHeaderCellDef>Menu Category</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">
|
|
{{ row.menuCategory?.name }}
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Items -->
|
|
<ng-container matColumnDef="items">
|
|
<mat-header-cell *matHeaderCellDef>Items</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">
|
|
<div class="items-list">
|
|
@for (item of row.items; track item) {
|
|
<div class="item-name">{{ item.name }} x {{ item.quantity }} @ {{ item.salePrice | currency: 'INR' }}</div>
|
|
}
|
|
</div>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Info -->
|
|
<ng-container matColumnDef="info">
|
|
<mat-header-cell *matHeaderCellDef>Details</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">
|
|
<div class="row-container">
|
|
<div>
|
|
<mat-icon>
|
|
{{ row.hasHappyHour ? 'sentiment_satisfied_alt' : 'sentiment_dissatisfied' }}
|
|
</mat-icon>
|
|
<b>{{ row.hasHappyHour ? 'Happy Hour' : 'Regular' }}</b>
|
|
</div>
|
|
|
|
<div>
|
|
<mat-icon>
|
|
{{ row.isNotAvailable ? 'pause' : 'play_arrow' }}
|
|
</mat-icon>
|
|
<b>{{ row.isNotAvailable ? 'Not Available' : 'Available' }}</b>
|
|
</div>
|
|
</div>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
|
</mat-table>
|