Moved the admin details cog (for movies) into the new social banner

pull/4016/head v4.0.1036
tidusjar 4 years ago
parent e1ee1866de
commit 85068d81b4

@ -7,8 +7,26 @@
<top-banner [background]="movie.background" [available]="movie.available" [title]="movie.title" [releaseDate]="movie.releaseDate" [tagline]="movie.tagline"></top-banner> <top-banner [background]="movie.background" [available]="movie.available" [title]="movie.title" [releaseDate]="movie.releaseDate" [tagline]="movie.tagline"></top-banner>
<div class="social-icons-container"> <div class="social-icons-container">
<social-icons [homepage]="movie.homepage" [theMoviedbId]="movie.id" [hasTrailer]="movie.videos?.results?.length > 0" (openTrailer)="openDialog()" [imdbId]="movie.imdbId" [twitter]="movie.externalIds.twitterId" [facebook]="movie.externalIds.facebookId" <social-icons
[instagram]="movie.externalIds.instagramId" [available]="movie.available" [plexUrl]="movie.plexUrl" [embyUrl]="movie.embyUrl" [jellyfinUrl]="movie.jellyfinUrl"></social-icons> [homepage]="movie.homepage"
[theMoviedbId]="movie.id"
[hasTrailer]="movie.videos?.results?.length > 0"
[imdbId]="movie.imdbId"
[twitter]="movie.externalIds.twitterId"
[facebook]="movie.externalIds.facebookId"
[instagram]="movie.externalIds.instagramId"
[available]="movie.available"
[plexUrl]="movie.plexUrl"
[embyUrl]="movie.embyUrl"
[jellyfinUrl]="movie.jellyfinUrl"
[isAdmin]="isAdmin"
[canRequestOnBehalf]="!hasRequest && !movie.available"
[canShowAdvanced]="showAdvanced && movieRequest"
(openTrailer)="openDialog()"
(onRequestBehalf)="openRequestOnBehalf()"
(onAdvancedOptions)="openAdvancedOptions()"
>
</social-icons>
</div> </div>
<section id="info-wrapper"> <section id="info-wrapper">
@ -19,7 +37,7 @@
<media-poster [posterPath]="'https://image.tmdb.org/t/p/w300/' + movie.posterPath"></media-poster> <media-poster [posterPath]="'https://image.tmdb.org/t/p/w300/' + movie.posterPath"></media-poster>
<!--Next to poster--> <!--Next to poster-->
<div class="col-12 col-lg-8 col-xl-8 media-row"> <div class="col-12 col-lg-9 col-xl-9 media-row">
<span *ngIf="movie.available"> <span *ngIf="movie.available">
<a *ngIf="movie.plexUrl" href="{{movie.plexUrl}}" mat-raised-button target="_blank" class="btn-spacing viewon-btn plex"> <a *ngIf="movie.plexUrl" href="{{movie.plexUrl}}" mat-raised-button target="_blank" class="btn-spacing viewon-btn plex">
{{'Search.ViewOnPlex' | translate}} {{'Search.ViewOnPlex' | translate}}
@ -77,23 +95,6 @@
<i class="fa fa-list"></i> {{'MediaDetails.ViewCollection' | translate}} <i class="fa fa-list"></i> {{'MediaDetails.ViewCollection' | translate}}
</button> </button>
</div> </div>
<!-- Setting/Configuration admin area -->
<div class="col-12 col-lg-1 col-xl-1 media-row content-end">
<button *ngIf="isAdmin" mat-icon-button [matMenuTriggerFor]="menu">
<mat-icon>settings</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item (click)="openRequestOnBehalf()" [disabled]="hasRequest || movie.available">
<mat-icon>supervised_user_circle</mat-icon>
<span>{{'MediaDetails.RequestOnBehalf' | translate}}</span>
</button>
<button mat-menu-item [disabled]="!showAdvanced || !movieRequest" (click)="openAdvancedOptions()">
<mat-icon>movie_filter</mat-icon>
<span>{{'MediaDetails.RadarrConfiguration' | translate}}</span>
</button>
</mat-menu>
</div>
</div> </div>
<div class="row"> <div class="row">

@ -24,4 +24,18 @@
</a> <a *ngIf="instagram" class="media-icons" [href]="doNotAppend ? instagram : 'https://instagram.com/' + instagram" target="_blank"> </a> <a *ngIf="instagram" class="media-icons" [href]="doNotAppend ? instagram : 'https://instagram.com/' + instagram" target="_blank">
<i matTooltip="Instagram" class="fa fa-instagram fa-2x grow-social"></i> <i matTooltip="Instagram" class="fa fa-instagram fa-2x grow-social"></i>
</a> </a>
<!-- Setting/Configuration admin area -->
<button *ngIf="isAdmin" mat-icon-button [matMenuTriggerFor]="menu">
<mat-icon>settings</mat-icon>
</button>
<mat-menu #menu="matMenu">
<button mat-menu-item (click)="openRequestOnBehalf()" [disabled]="!canRequestOnBehalf">
<mat-icon>supervised_user_circle</mat-icon>
<span>{{'MediaDetails.RequestOnBehalf' | translate}}</span>
</button>
<button mat-menu-item [disabled]="!canShowAdvanced" (click)="openAdvancedOptions()">
<mat-icon>movie_filter</mat-icon>
<span>{{'MediaDetails.RadarrConfiguration' | translate}}</span>
</button>
</mat-menu>
</div> </div>

@ -1,12 +1,10 @@
import { Component, Inject, Input, Output, EventEmitter } from "@angular/core"; import { Component, Input, Output, EventEmitter } from "@angular/core";
@Component({ @Component({
selector: "social-icons", selector: "social-icons",
templateUrl: "./social-icons.component.html", templateUrl: "./social-icons.component.html",
styleUrls: ["./social-icons.component.scss"] styleUrls: ["./social-icons.component.scss"]
}) })
export class SocialIconsComponent { export class SocialIconsComponent {
@Input() homepage: string; @Input() homepage: string;
@Input() theMoviedbId: number; @Input() theMoviedbId: number;
@Input() hasTrailer: boolean; @Input() hasTrailer: boolean;
@ -21,10 +19,24 @@ export class SocialIconsComponent {
@Input() jellyfinUrl: string; @Input() jellyfinUrl: string;
@Input() doNotAppend: boolean; @Input() doNotAppend: boolean;
@Input() isAdmin: boolean;
@Input() canRequestOnBehalf: boolean;
@Input() canShowAdvanced: boolean;
@Output() openTrailer: EventEmitter<any> = new EventEmitter(); @Output() openTrailer: EventEmitter<any> = new EventEmitter();
@Output() onRequestBehalf: EventEmitter<any> = new EventEmitter();
@Output() onAdvancedOptions: EventEmitter<any> = new EventEmitter();
public openDialog() { public openDialog() {
this.openTrailer.emit(); this.openTrailer.emit();
} }
public openRequestOnBehalf() {
this.onRequestBehalf.emit();
}
public openAdvancedOptions() {
this.onAdvancedOptions.emit();
}
} }

@ -7,7 +7,6 @@ import { DomSanitizer, SafeStyle } from "@angular/platform-browser";
styleUrls: ["top-banner.component.scss"] styleUrls: ["top-banner.component.scss"]
}) })
export class TopBannerComponent { export class TopBannerComponent {
@Input() title: string; @Input() title: string;
@Input() releaseDate: Date; @Input() releaseDate: Date;
@Input() tagline: string; @Input() tagline: string;

Loading…
Cancel
Save