barker/bookie/src/app/tables/table-list/table-list.component.html
2019-06-17 13:23:00 +05:30

44 lines
1.6 KiB
HTML

<mat-card>
<mat-card-title-group>
<mat-card-title>Tables</mat-card-title>
<button mat-button (click)="updateSortOrder()">
Update Order
</button>
<a mat-button [routerLink]="['/tables', 'new']">
<mat-icon>add_box</mat-icon>
Add
</a>
</mat-card-title-group>
<mat-card-content>
<mat-table #table cdkDropList [dataSource]="dataSource" [cdkDropListData]="dataSource" aria-label="Elements" (cdkDropListDropped)="dropTable($event)">
<!-- Name Column -->
<ng-container matColumnDef="name">
<mat-header-cell *matHeaderCellDef>Name</mat-header-cell>
<mat-cell *matCellDef="let row"><a [routerLink]="['/tables', row.id]">{{row.name}}</a></mat-cell>
</ng-container>
<!-- Seats Column -->
<ng-container matColumnDef="seats">
<mat-header-cell *matHeaderCellDef>Seats</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.seats}}</mat-cell>
</ng-container>
<!-- Section Column -->
<ng-container matColumnDef="section">
<mat-header-cell *matHeaderCellDef>Section</mat-header-cell>
<mat-cell *matCellDef="let row">{{row.section}}</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">{{row.isActive}}</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;" cdkDrag [cdkDragData]="row"></mat-row>
</mat-table>
</mat-card-content>
</mat-card>