Some small fixes!

pull/3338/head
tidusjar 5 years ago
parent 822ca2df94
commit 5ad8ccf33d

@ -43,6 +43,11 @@ namespace Ombi.Store.Entities.Requests
return "Common.Available";
}
if (Denied ?? false)
{
return "Common.Denied";
}
if (Approved & !Available)
{
return "Common.ProcessingRequest";

@ -35,6 +35,7 @@
"angular-bootstrap-md": "^7.5.4",
"angular-router-loader": "^0.8.5",
"angular2-template-loader": "^0.6.2",
"angularx-qrcode": "^1.7.0-beta.5",
"aspnet-prerendering": "^3.0.1",
"awesome-typescript-loader": "^5.2.0",
"bootstrap": "^4.2.1",

@ -1,7 +1,7 @@
<div class="card-spacing" *ngIf="result">
<mat-card class="mat-elevation-z8 dark-card grow">
<a [routerLink]="result.type === RequestType.movie ? '/details/movie/' + result.id : '/details/tv/' + result.id">
<img id="cardImage" mat-card-image src="{{result.posterPath}}" class="card-poster" [ngClass]="(result.type === RequestType.movie)?'movie-image':'tv-image'" alt="{{result.title}}">
<img id="cardImage" mat-card-image src="{{result.posterPath}}" class="card-poster" [ngClass]="getStatusClass()" alt="{{result.title}}">
</a>
<mat-card-content>

@ -21,14 +21,22 @@ $card-background: #2b2b2b;
}
$border-width: 3px;
.movie-image {
border-bottom: $border-width orange solid;
}
.tv-image {
.available {
border-bottom: $border-width #1DE9B6 solid;
}
.approved {
border-bottom: $border-width #ff5722 solid;
}
.requested {
border-bottom: $border-width #ffd740 solid;
}
.notrequested {
border-bottom: $border-width #303030 solid;
}
.expand {
text-align: center;
}

@ -27,23 +27,33 @@ export class DiscoverCardComponent implements OnInit {
this.getExtraMovieInfo();
}
}
public openDetails(details: IDiscoverCardResult) {
const ref = this.dialog.open(DiscoverCardDetailsComponent, { width:"700px", data: details, panelClass: 'modal-panel' })
ref.afterClosed().subscribe(result => {
console.log('The dialog was closed');
});
public openDetails(details: IDiscoverCardResult) {
this.dialog.open(DiscoverCardDetailsComponent, { width: "700px", data: details, panelClass: 'modal-panel' })
}
public async getExtraTvInfo() {
var result = await this.searchService.getTvInfo(this.result.id);
this.setTvDefaults(result);
this.updateTvItem(result);
}
public getStatusClass(): string {
if (this.result.available) {
return "available";
}
if (this.result.approved) {
return "approved";
}
if (this.result.requested) {
return "requested";
}
return "notrequested";
}
private getExtraMovieInfo() {
if(!this.result.imdbid) {
if (!this.result.imdbid) {
this.searchService.getFullMovieDetails(this.result.id)
.subscribe(m => {
this.updateMovieItem(m);
@ -52,7 +62,7 @@ export class DiscoverCardComponent implements OnInit {
}
private updateMovieItem(updated: ISearchMovieResultV2) {
this.result.url = "http://www.imdb.com/title/" + updated.imdbId + "/";
this.result.url = "http://www.imdb.com/title/" + updated.imdbId + "/";
this.result.available = updated.available;
this.result.requested = updated.requested;
this.result.requested = updated.requestProcessing;

@ -46,7 +46,7 @@
</ng-template>
</span>
<span *ngIf="isAdmin && hasRequest">
<button (click)="approve()" mat-raised-button class="btn-spacing" color="accent">
<button *ngIf="!movie.approved" (click)="approve()" mat-raised-button class="btn-spacing" color="accent">
<i class="fa fa-plus"></i> {{ 'Common.Approve' | translate }}
</button>
<button *ngIf="!movie.available" (click)="markAvailable()" mat-raised-button class="btn-spacing"

@ -5,6 +5,6 @@
</mat-form-field>
</div>
<div mat-dialog-actions>
<button mat-button (click)="onNoClick()" [mat-dialog-close]="data.denied">Cancel</button>
<button mat-button (click)="deny()" [mat-dialog-close]="data.denied" cdkFocusInitial>Deny</button>
<button mat-raised-button (click)="onNoClick()" [mat-dialog-close]="data.denied">Cancel</button>
<button mat-raised-button (click)="deny()" color="danger" [mat-dialog-close]="data.denied" cdkFocusInitial>Deny</button>
</div>

@ -1,41 +1,49 @@
<mat-sidenav-container *ngIf="showNav" class="sidenav-container">
<mat-sidenav #drawer class="sidenav" fixedInViewport="true" [attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'"
[mode]="(isHandset$ | async) ? 'over' : 'side'" [opened]="!(isHandset$ | async)">
<mat-sidenav #drawer class="sidenav" fixedInViewport="true"
[attr.role]="(isHandset$ | async) ? 'dialog' : 'navigation'" [mode]="(isHandset$ | async) ? 'over' : 'side'"
[opened]="!(isHandset$ | async)">
<mat-toolbar>{{applicationName}}</mat-toolbar>
<mat-nav-list>
<span *ngFor="let nav of navItems">
<a *ngIf="nav.requiresAdmin && isAdmin || !nav.requiresAdmin" mat-list-item [routerLink]="nav.link"
[routerLinkActive]="getTheme()" >
<mat-icon aria-label="Side nav toggle icon">{{nav.icon}}</mat-icon>
&nbsp;{{nav.name | translate}}
</a> </span>
<a class="bottom-nav-link" mat-list-item [routerLinkActive]="theme === 'dark' ? 'active-list-item-dark' : 'active-list-item'" aria-label="Toggle sidenav" (click)="logOut();">
<a *ngIf="nav.requiresAdmin && isAdmin || !nav.requiresAdmin" mat-list-item [routerLink]="nav.link"
[routerLinkActive]="getTheme()">
<mat-icon aria-label="Side nav toggle icon">{{nav.icon}}</mat-icon>
&nbsp;{{nav.name | translate}}
</a> </span>
<a class="bottom-nav-link" mat-list-item
[routerLinkActive]="theme === 'dark' ? 'active-list-item-dark' : 'active-list-item'" aria-label="Toggle sidenav"
(click)="logOut();">
<mat-icon aria-label="Side nav toggle icon">exit_to_app</mat-icon>
{{ 'NavigationBar.Logout' | translate }}
</a>
<a mat-list-item aria-label="Toggle sidenav" (click)="switchTheme();">
<mat-slide-toggle>
{{ 'NavigationBar.ChangeTheme' | translate }}
</mat-slide-toggle>
</a>
</mat-nav-list>
</mat-sidenav>
<mat-sidenav-content>
<mat-toolbar color="primary">
<button type="button" aria-label="Toggle sidenav" mat-icon-button (click)="drawer.toggle()" *ngIf="isHandset$ | async">
<button type="button" aria-label="Toggle sidenav" mat-icon-button (click)="drawer.toggle()"
*ngIf="isHandset$ | async">
<mat-icon aria-label="Side nav toggle icon">menu</mat-icon>
</button>
<div class="col-12">
<span class="middle justify-content-center align-items-center">
<!-- Search Bar -->
<app-nav-search></app-nav-search>
</span>
</div>
<div class="col-10 offset-1">
<span class="middle justify-content-center align-items-center">
<!-- Search Bar -->
<app-nav-search></app-nav-search>
</span>
</div>
<div class="col-1">
<div class="float-right">
<a mat-list-item (click)="switchTheme()">
<mat-icon *ngIf="theme === 'dark'" aria-label="Side nav toggle icon">brightness_7</mat-icon>
<mat-icon *ngIf="theme === 'light'" aria-label="Side nav toggle icon">brightness_4</mat-icon>
</a>
</div>
</div>
</mat-toolbar>
<!-- Page -->

@ -2,8 +2,9 @@
placeholder="{{'NavigationBar.Search' | translate}}" aria-label="Search" [ngbTypeahead]="searchModel"
[resultFormatter]="formatter" [inputFormatter]="formatter" [resultTemplate]="template" (selectItem)="selected($event)">
<ng-template #template let-result="result">
<ng-template #template let-result="result">
<div *ngIf="result.mediaType === 'movie'">
<i class="fa fa-film"></i> &nbsp;
<span >{{result.title}}</span>
@ -26,6 +27,4 @@
</div>
<!-- Collection -->
<!-- <i class="fa fa-file-video-o" aria-hidden="true"></i> -->
</ng-template>

@ -1,17 +1,26 @@
<div class="small-middle-container" *ngIf="username">
<h3 [translate]="'UserPreferences.Welcome'" [translateParams]="{username: username}"></h3>
<hr>
<div>
<mat-form-field>
<mat-label [translate]="'UserPreferences.OmbiLanguage'"></mat-label>
<mat-select [(value)]="selectedLang" (selectionChange)="languageSelected();">
<mat-option *ngFor="let lang of availableLanguages" [value]="lang.value">
{{lang.display}}
</mat-option>
</mat-select>
</mat-form-field>
<!--
/*<qrcode *ngIf="qrCodeEnabled" [qrdata]="qrCode" [size]="256" [level]="'L'"></qrcode> */ -->
<div class="row justify-content-md-center top-spacing">
<div class="col-md">
<div>
<mat-form-field>
<mat-label [translate]="'UserPreferences.OmbiLanguage'"></mat-label>
<mat-select [(value)]="selectedLang" (selectionChange)="languageSelected();">
<mat-option *ngFor="let lang of availableLanguages" [value]="lang.value">
{{lang.display}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
<div>
</div>
</div>
<div class="col-md">
<qrcode *ngIf="qrCodeEnabled" [qrdata]="qrCode" [size]="256" [level]="'L'"></qrcode>
</div>
</div>
</div>
</div>

@ -28,7 +28,6 @@ export class UserPreferenceComponent implements OnInit {
if (user.name) {
this.username = user.name;
}
debugger;
const customization = await this.settingsService.getCustomization().toPromise();
const accessToken = await this.identityService.getAccessToken().toPromise();

@ -1,6 +1,8 @@
import { NgModule } from "@angular/core";
import { RouterModule } from "@angular/router"
/*import { QRCodeModule } from 'angularx-qrcode';*/
import { QRCodeModule } from 'angularx-qrcode';
import { MatCheckboxModule } from '@angular/material';
import { SharedModule } from "../shared/shared.module";
@ -11,7 +13,8 @@ import * as fromComponents from './components';
imports: [
RouterModule.forChild(fromComponents.routes),
SharedModule,
/* QRCodeModule,*/
QRCodeModule,
MatCheckboxModule,
],
declarations: [
...fromComponents.components
@ -20,7 +23,7 @@ import * as fromComponents from './components';
RouterModule,
],
providers: [
],
],
})
export class UserPreferencesModule { }

@ -11,8 +11,7 @@ function configExists(url) {
return req.status==200;
}
debugger;
var probePath = 'main.js';
var probePath = 'styles/please-wait.js';
var origin = document.location.origin;
var pathSegments = document.location.pathname.split('/');

@ -239,6 +239,7 @@
},
"UserPreferences": {
"Welcome":"Welcome {{username}}!",
"OmbiLanguage":"Ombi Language"
"OmbiLanguage":"Language",
"DarkMode":"Dark Mode"
}
}

Loading…
Cancel
Save