79 lines
2.7 KiB
HTML
79 lines
2.7 KiB
HTML
@if (listResource.isLoading()) {
|
|
<app-skeleton-loader type="table" [count]="5" />
|
|
} @else if (listResource.error()) {
|
|
<app-error-state (retryAction)="listResource.reload()" />
|
|
} @else {
|
|
<h2 class="row-container space-between">
|
|
Modifiers
|
|
<a mat-button [routerLink]="['/modifiers', 'new']">
|
|
<mat-icon>add_box</mat-icon>
|
|
Add
|
|
</a>
|
|
</h2>
|
|
<form class="flex-col">
|
|
<div class="row-container">
|
|
<mat-form-field class="flex-auto">
|
|
<mat-label>Modifier Category</mat-label>
|
|
<mat-select [formField]="form.menuCategory">
|
|
<mat-option [value]="null">-- All Categories --</mat-option>
|
|
@for (mc of modifierCategories(); track mc.id) {
|
|
<mat-option [value]="mc.id">
|
|
{{ mc.name }}
|
|
</mat-option>
|
|
}
|
|
</mat-select>
|
|
</mat-form-field>
|
|
</div>
|
|
</form>
|
|
<mat-table #table [dataSource]="dataSource()" aria-label="Elements">
|
|
<!-- Name Column -->
|
|
<ng-container matColumnDef="name">
|
|
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
|
|
<mat-cell *matCellDef="let row"
|
|
><a [routerLink]="['/modifiers', row.id]">{{ row.name }}</a></mat-cell
|
|
>
|
|
</ng-container>
|
|
|
|
<!-- Show In Bill Column -->
|
|
<ng-container matColumnDef="showInBill">
|
|
<mat-header-cell *matHeaderCellDef>Show In Bill</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">
|
|
<div layout="row">
|
|
<div>
|
|
<mat-icon>
|
|
{{ row.showInBill ? 'visibility' : 'visibility_off' }}
|
|
</mat-icon>
|
|
<b> {{ row.showInBill ? 'Show' : 'Hide' }}</b>
|
|
</div>
|
|
</div>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Price Column -->
|
|
<ng-container matColumnDef="price">
|
|
<mat-header-cell *matHeaderCellDef>Price</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.price | currency: 'INR' }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Modifier Category Column -->
|
|
<ng-container matColumnDef="modifierCategory">
|
|
<mat-header-cell *matHeaderCellDef>Category</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">{{ row.modifierCategory.name }}</mat-cell>
|
|
</ng-container>
|
|
|
|
<!-- Is Active Column -->
|
|
<ng-container matColumnDef="isActive">
|
|
<mat-header-cell *matHeaderCellDef>Is Active</mat-header-cell>
|
|
<mat-cell *matCellDef="let row">
|
|
<mat-icon>
|
|
{{ row.isActive ? 'visibility' : 'visibility_off' }}
|
|
</mat-icon>
|
|
<b> {{ row.isActive ? 'Active' : 'Not Active' }}</b>
|
|
</mat-cell>
|
|
</ng-container>
|
|
|
|
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
|
|
<mat-row *matRowDef="let row; columns: displayedColumns"></mat-row>
|
|
</mat-table>
|
|
}
|