mirror of https://github.com/Ombi-app/Ombi
parent
1829786f8b
commit
10ac48e608
@ -0,0 +1,47 @@
|
||||
<table *ngIf="dataSource" mat-table [dataSource]="dataSource.collection" class="mat-elevation-z8 table">
|
||||
|
||||
<!--- Note that these columns can be defined in any order.
|
||||
The actual rendered columns are set as a property on the row definition" -->
|
||||
|
||||
<ng-container matColumnDef="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> 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> 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> Status </th>
|
||||
<td mat-cell *matCellDef="let element"> {{element.status}} </td>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<ng-container matColumnDef="requestStatus">
|
||||
<th mat-header-cell *matHeaderCellDef> Request Status </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<div *ngIf="element.approved && !element.available">{{'Common.ProcessingRequest' | translate}}</div>
|
||||
<div *ngIf="element.requested && !element.approved && !element.available">{{'Common.PendingApproval' | translate}}
|
||||
</div>
|
||||
<div *ngIf="!element.requested && !element.available && !element.approved">{{'Common.NotRequested' | translate}}
|
||||
</div>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef> </th>
|
||||
<td mat-cell *matCellDef="let element">
|
||||
<button mat-raised-button color="primary" [routerLink]="">Details</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
|
||||
</table>
|
@ -0,0 +1,23 @@
|
||||
import { Component, OnInit } from "@angular/core";
|
||||
import { RequestService } from "../../../services";
|
||||
import { IMovieRequests, OrderType, FilterType, IRequestsViewModel } from "../../../interfaces";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./movies-grid.component.html",
|
||||
selector: "movies-grid",
|
||||
styleUrls: ["../requests-list.component.scss"]
|
||||
})
|
||||
export class MoviesGridComponent implements OnInit {
|
||||
public dataSource: IRequestsViewModel<IMovieRequests>;
|
||||
|
||||
public displayedColumns: string[] = ['requestedBy', 'title', 'requestedDate', 'status', 'requestStatus', 'actions'];
|
||||
|
||||
constructor(private requestService: RequestService) {
|
||||
|
||||
}
|
||||
|
||||
public async ngOnInit() {
|
||||
this.dataSource = await this.requestService.getMovieRequests(30,0, OrderType.RequestedDateDesc,
|
||||
{availabilityFilter: FilterType.None, statusFilter: FilterType.None}).toPromise();
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
<div class="small-middle-container">
|
||||
<mat-tab-group>
|
||||
<mat-tab label="Movies">
|
||||
<movies-grid></movies-grid>
|
||||
</mat-tab>
|
||||
<mat-tab label="TV Shows">
|
||||
<h1>Some more tab content</h1>
|
||||
<p>...</p>
|
||||
</mat-tab>
|
||||
<mat-tab label="Albums">
|
||||
<h1>Some more tab content</h1>
|
||||
<p>...</p>
|
||||
</mat-tab>
|
||||
</mat-tab-group>
|
||||
|
||||
</div>
|
@ -0,0 +1,8 @@
|
||||
.small-middle-container{
|
||||
margin: auto;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.table {
|
||||
width: 100%;
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
import { Component } from "@angular/core";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./requests-list.component.html",
|
||||
styleUrls: ["./requests-list.component.scss"]
|
||||
})
|
||||
export class RequestsListComponent {
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
import { NgModule } from "@angular/core";
|
||||
import { RouterModule, Routes } from "@angular/router";
|
||||
|
||||
import { RequestService } from "../services";
|
||||
|
||||
import { SharedModule } from "../shared/shared.module";
|
||||
import { PipeModule } from "../pipes/pipe.module";
|
||||
|
||||
import { AuthGuard } from "../auth/auth.guard";
|
||||
|
||||
import * as fromComponents from './components';
|
||||
import { RequestsListComponent } from "./components/requests-list.component";
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: "", component: RequestsListComponent, canActivate: [AuthGuard] },
|
||||
];
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild(routes),
|
||||
SharedModule,
|
||||
PipeModule,
|
||||
],
|
||||
declarations: [
|
||||
...fromComponents.components
|
||||
],
|
||||
exports: [
|
||||
RouterModule,
|
||||
],
|
||||
entryComponents: [
|
||||
],
|
||||
providers: [
|
||||
RequestService,
|
||||
],
|
||||
|
||||
})
|
||||
export class RequestsListModule { }
|
Loading…
Reference in new issue