(Kavita+) External Series Detail (#2309)

This commit is contained in:
Joe Milazzo 2023-10-11 19:31:40 -05:00 committed by GitHub
parent bd62e00ec5
commit 6067c9233c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 2354 additions and 726 deletions

View file

@ -1,4 +1,4 @@
<img #img class="lazyload img-placeholder" src="data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
<img #img class="lazyload img-placeholder {{classes}}" src="data:image/gif;base64,R0lGODlhAQABAPAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw=="
[attr.data-src]="imageUrl"
(error)="imageService.updateErroredImage($event)"
aria-hidden="true"

View file

@ -64,6 +64,7 @@ export class ImageComponent implements OnChanges {
* If the image component should respond to cover updates
*/
@Input() processEvents: boolean = true;
@Input() classes: string = '';
@ViewChild('img', {static: true}) imgElem!: ElementRef<HTMLImageElement>;
private readonly destroyRef = inject(DestroyRef);

View file

@ -1,8 +1,15 @@
<div class="tagbadge cursor clickable" *ngIf="person !== undefined">
<div class="d-flex">
<i class="fa fa-user-circle align-self-center me-2" aria-hidden="true"></i>
<ng-container *ngIf="isStaff && staff.imageUrl && !staff.imageUrl.endsWith('default.jpg'); else localPerson">
<app-image height="24px" width="24px" objectFit="contain" [imageUrl]="staff.imageUrl"></app-image>
</ng-container>
<ng-template #localPerson>
<i class="fa fa-user-circle align-self-center me-2" aria-hidden="true"></i>
</ng-template>
<div class="flex-grow-1">
<span class="mt-0 mb-0">{{person.name}}</span>
<span class="mt-0 mb-0">
{{person.name}}
</span>
</div>
</div>
</div>

View file

@ -1,18 +1,28 @@
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, inject, Input, OnInit} from '@angular/core';
import { Person } from '../../_models/metadata/person';
import {CommonModule} from "@angular/common";
import {SeriesStaff} from "../../_models/series-detail/external-series-detail";
import {ImageComponent} from "../image/image.component";
@Component({
selector: 'app-person-badge',
standalone: true,
imports: [CommonModule],
imports: [CommonModule, ImageComponent],
templateUrl: './person-badge.component.html',
styleUrls: ['./person-badge.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PersonBadgeComponent {
export class PersonBadgeComponent implements OnInit {
@Input({required: true}) person!: Person;
@Input({required: true}) person!: Person | SeriesStaff;
@Input() isStaff = false;
constructor() { }
private readonly cdRef = inject(ChangeDetectorRef);
staff!: SeriesStaff;
ngOnInit() {
this.staff = this.person as SeriesStaff;
this.cdRef.markForCheck();
}
}