<div class="container-fluid py-5">
    <div class="row">

        <div class="col-lg-6">
            <div class="jumbotron jumbotron-small jumbotron-list-container bg-light mat-elevation-z5 mb-0">
                <div class="jumbotron-heading align-items-center justify-content-between row">
                    <div class="col-xl-6">
                        <h2 class="shadowed">Resource Reservations</h2>
                        <p class="shadowed">View and manage resource reservations</p>
                    </div>
                    <div class="col-xl-6 text-xl-right">
                        <button type="button" class="btn btn-success" routerLink="/{{appService.portalDomain}}/resource_reservation_update">
                            <i class="fas fa-clipboard-list mr-2"></i>New  Reservation
                        </button>
                    </div>
                </div>

                <div class="filter-container pt-3 px-3 row">
                    <!-- <input class="form-control " (keyup)="applyFilter($event.target.value)" placeholder="Apply Filter..."> -->
                    <mat-form-field appearance="" class="white-background col-12">
                        <mat-label>Apply Filter...</mat-label>
                        <input matInput (keyup)="applyFilter($event.target.value)">
                    </mat-form-field>
                </div>

                <div class="table-responsive mat-elevation-z1" >

                    <table mat-table [dataSource]="dataSource" matSort class="table table-generic">

                        <ng-container matColumnDef="name">
                            <th mat-header-cell *matHeaderCellDef mat-sort-header> Name </th>
                            <td mat-cell *matCellDef="let element">
                                <a routerLink="/{{appService.portalDomain}}/resource_reservation_update/{{element.id}}">
                                    <span *ngIf="element.name">{{element.name | slice:0:49}}<span *ngIf="element.name.length > 49">...</span> </span> 
                                </a> 
                            </td>
                        </ng-container>

                       
                        <ng-container matColumnDef="requestedPeriodStartDateTime">
                            <th mat-header-cell *matHeaderCellDef mat-sort-header> Requested Start DateTime (Local) </th>
                            <td mat-cell *matCellDef="let element">{{element.requestedPeriodStartDateTime | date:'d MMM y, h:mm a'}}</td>
                        </ng-container>

                        <ng-container matColumnDef="requestedPeriodEndDateTime">
                            <th mat-header-cell *matHeaderCellDef mat-sort-header> Requested End DateTime (Local) </th>
                            <td mat-cell *matCellDef="let element">{{element.requestedPeriodEndDateTime | date:'d MMM y, h:mm a'}}</td>
                        </ng-container>

                        <ng-container matColumnDef="actions">
                            <th mat-header-cell *matHeaderCellDef>Actions</th>
                            <td mat-cell *matCellDef="let element">
                                <a routerLink="/{{appService.portalDomain}}/resource_reservation_update/{{element.id}}">
                                    <button class="btn btn-warning btn-sm my-1 mr-xl-1"><i
                                    class="far fa-edit"></i></button>
                                </a>
                                
                                <button class="btn btn-danger btn-sm my-1 m-xl-0" (click)="openResourceReservationDeleteDialog(element)"><i
                                        class="far fa-trash-alt"></i></button>
                                        
                            </td>
                        </ng-container>

                        <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
                        <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
                    </table>

                    <mat-paginator [pageSizeOptions]="[20, 50, 100]" showFirstLastButtons></mat-paginator>
                </div>
            </div>
        </div>

        <div class="col-lg-6">
            <div class="jumbotron jumbotron-small jumbotron-list-container bg-light mat-elevation-z5 mb-0">
                <div class="jumbotron-heading align-items-center justify-content-between row">
                    <div class="col-xl-8">
                        <h2 class="shadowed">Resource Reservation Calendar</h2>
                        <p class="shadowed">View resource reservations in calendar</p>
                    </div>

                    <div class="col-xl-4 text-xl-right">
                        <button type="button" class="btn btn-success" routerLink="/{{appService.portalDomain}}/resource_reservations_calendar">
                            <i class="fas fa-expand-alt mr-2"></i>Full screen calendar
                        </button>
                    </div>
                    
                </div>

                    <full-calendar class="mt-4" [options]='calendarOptions'></full-calendar>
                    


            </div>
        </div>
    </div>
</div>