Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added filtering on status to the requests page
- Loading branch information
Jamie Rees
committed
May 4, 2020
1 parent
1ea6a6d
commit 4a8c1cd
Showing
10 changed files
with
150 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 70 additions & 54 deletions
124
src/Ombi/ClientApp/src/app/requests-list/components/movies-grid/movies-grid.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,73 @@ | ||
<div class="mat-elevation-z8"> | ||
<grid-spinner [loading]="isLoadingResults"></grid-spinner> | ||
|
||
<mat-form-field> | ||
<mat-select placeholder="Requests to Display" [(value)]="gridCount" (selectionChange)="ngAfterViewInit()"> | ||
<mat-option value="10">10</mat-option> | ||
<mat-option value="15">15</mat-option> | ||
<mat-option value="30">30</mat-option> | ||
<mat-option value="100">100</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
|
||
<table mat-table [dataSource]="dataSource" class="table" matSort [matSortActive]="defaultSort" | ||
matSortDisableClear [matSortDirection]="defaultOrder"> | ||
|
||
|
||
<ng-container matColumnDef="requestedUser.requestedBy"> | ||
<th mat-header-cell *matHeaderCellDef > Requested By </th> | ||
<td mat-cell *matCellDef="let element"> {{element.requestedUser?.userAlias}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="title"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Title </th> | ||
<td mat-cell *matCellDef="let element"> {{element.title}} ({{element.releaseDate | amLocal | amDateFormat: | ||
'YYYY'}}) </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="requestedDate"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Request Date </th> | ||
<td mat-cell *matCellDef="let element"> {{element.requestedDate | amLocal | amDateFormat: 'LL'}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="status"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Status </th> | ||
<td mat-cell *matCellDef="let element"> {{element.status}} </td> | ||
</ng-container> | ||
|
||
|
||
<ng-container matColumnDef="requestStatus"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Request Status </th> | ||
<td mat-cell *matCellDef="let element"> {{element.requestStatus | translate}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="actions" > | ||
<th mat-header-cell *matHeaderCellDef> </th> | ||
<td mat-cell *matCellDef="let element" > | ||
<button mat-raised-button color="accent" [routerLink]="'/details/movie/' + element.theMovieDbId">Details</button> | ||
<button mat-raised-button color="warn" (click)="openOptions(element)" *ngIf="isAdmin">Options</button> | ||
</td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr> | ||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> | ||
</table> | ||
|
||
<mat-paginator [length]="resultsLength" [pageSize]="gridCount"></mat-paginator> | ||
</div> | ||
|
||
<!-- <div class="row"> --> | ||
<div class="row justify-content-md-center top-spacing"> | ||
<div class="btn-group" role="group"> | ||
<button type="button" (click)="switchFilter(RequestFilter.All)" [attr.color]="currentFilter === RequestFilter.All ? 'accent' : 'primary'" [ngClass]="currentFilter === RequestFilter.All ? 'mat-accent' : 'mat-primary'" mat-raised-button class="btn grow">{{'Requests.AllRequests' | translate}}</button> | ||
<button type="button" (click)="switchFilter(RequestFilter.Pending)" [attr.color]="currentFilter === RequestFilter.Pending ? 'accent' : 'primary'" [ngClass]="currentFilter === RequestFilter.Pending ? 'mat-accent' : 'mat-primary'" mat-raised-button class="btn grow">{{'Requests.PendingRequests' | translate}}</button> | ||
<button type="button" (click)="switchFilter(RequestFilter.Processing)" [attr.color]="currentFilter === RequestFilter.Processing ? 'accent' : 'primary'" [ngClass]="currentFilter === RequestFilter.Processing ? 'mat-accent' : 'mat-primary'" mat-raised-button | ||
class="btn grow">{{'Requests.ProcessingRequests' | translate}}</button> | ||
<button type="button" (click)="switchFilter(RequestFilter.Available)" [attr.color]="currentFilter === RequestFilter.Available ? 'accent' : 'primary'" [ngClass]="currentFilter === RequestFilter.Available ? 'mat-accent' : 'mat-primary'" mat-raised-button | ||
class="btn grow">{{'Requests.AvailableRequests' | translate}}</button> | ||
<button type="button" (click)="switchFilter(RequestFilter.Denied)" [attr.color]="currentFilter === RequestFilter.Denied ? 'accent' : 'primary'" [ngClass]="currentFilter === RequestFilter.Denied ? 'mat-accent' : 'mat-primary'" mat-raised-button class="btn grow">{{'Requests.DeniedRequests' | translate}}</button> | ||
</div> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="col-md-2 offset-md-10"> | ||
<mat-form-field> | ||
<mat-select placeholder="Requests to Display" [(value)]="gridCount" (selectionChange)="ngAfterViewInit()"> | ||
<mat-option value="10">10</mat-option> | ||
<mat-option value="15">15</mat-option> | ||
<mat-option value="30">30</mat-option> | ||
<mat-option value="100">100</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
</div> | ||
</div> | ||
<!-- </div> --> | ||
<table mat-table [dataSource]="dataSource" class="table" matSort [matSortActive]="defaultSort" matSortDisableClear [matSortDirection]="defaultOrder"> | ||
|
||
|
||
<ng-container matColumnDef="requestedUser.requestedBy"> | ||
<th mat-header-cell *matHeaderCellDef> Requested By </th> | ||
<td mat-cell *matCellDef="let element"> {{element.requestedUser?.userAlias}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="title"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Title </th> | ||
<td mat-cell *matCellDef="let element"> {{element.title}} ({{element.releaseDate | amLocal | amDateFormat: 'YYYY'}}) </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="requestedDate"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Request Date </th> | ||
<td mat-cell *matCellDef="let element"> {{element.requestedDate | amLocal | amDateFormat: 'LL'}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="status"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Status </th> | ||
<td mat-cell *matCellDef="let element"> {{element.status}} </td> | ||
</ng-container> | ||
|
||
|
||
<ng-container matColumnDef="requestStatus"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header disableClear> Request Status </th> | ||
<td mat-cell *matCellDef="let element"> {{element.requestStatus | translate}} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="actions"> | ||
<th mat-header-cell *matHeaderCellDef> </th> | ||
<td mat-cell *matCellDef="let element"> | ||
<button mat-raised-button color="accent" [routerLink]="'/details/movie/' + element.theMovieDbId">Details</button> | ||
<button mat-raised-button color="warn" (click)="openOptions(element)" *ngIf="isAdmin">Options</button> | ||
</td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr> | ||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> | ||
</table> | ||
|
||
<mat-paginator [length]="resultsLength" [pageSize]="gridCount"></mat-paginator> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
src/Ombi/ClientApp/src/app/requests-list/models/RequestFilterType.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export enum RequestFilterType { | ||
All, | ||
Pending, | ||
Processing, | ||
Available, | ||
Denied | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters