Enhanced metadata viewer, editor, picker and searcher
This commit is contained in:
committed by
Aditya Chandel
parent
ceac960943
commit
538854b397
+14
-7
@@ -4,13 +4,20 @@
|
|||||||
(mouseout)="isHovered = false">
|
(mouseout)="isHovered = false">
|
||||||
|
|
||||||
<div class="cover-container" [ngClass]="{ 'shimmer': !isImageLoaded, 'center-info-btn': readButtonHidden }">
|
<div class="cover-container" [ngClass]="{ 'shimmer': !isImageLoaded, 'center-info-btn': readButtonHidden }">
|
||||||
<img
|
<div
|
||||||
[src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
|
class="cover-container"
|
||||||
class="book-cover"
|
[ngClass]="{
|
||||||
[class.loaded]="isImageLoaded"
|
'center-info-btn': readButtonHidden,
|
||||||
alt="Cover of {{ book.metadata?.title }}"
|
'loaded': isImageLoaded
|
||||||
loading="lazy"
|
}">
|
||||||
(load)="onImageLoad()"/>
|
<img
|
||||||
|
[src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
|
||||||
|
class="book-cover"
|
||||||
|
[class.loaded]="isImageLoaded"
|
||||||
|
alt="Cover of {{ book.metadata?.title }}"
|
||||||
|
loading="lazy"
|
||||||
|
(load)="onImageLoad()" />
|
||||||
|
</div>
|
||||||
|
|
||||||
@if (book.metadata?.seriesNumber != null) {
|
@if (book.metadata?.seriesNumber != null) {
|
||||||
<div class="series-number-overlay">
|
<div class="series-number-overlay">
|
||||||
|
|||||||
+7
-14
@@ -1,6 +1,6 @@
|
|||||||
.book-card {
|
.book-card {
|
||||||
background-color: var(--card-background);
|
background-color: var(--card-background);
|
||||||
border-radius: 0 0 8px 8px;
|
border-radius: 8px 8px 8px 8px;
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: border 0.2s;
|
transition: border 0.2s;
|
||||||
@@ -13,25 +13,18 @@
|
|||||||
.cover-container {
|
.cover-container {
|
||||||
position: relative;
|
position: relative;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
aspect-ratio: 5/7;
|
||||||
|
background-color: var(--card-background);
|
||||||
|
border-radius: 8px 8px 0 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
|
transition: background-color 0.3s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.cover-container.shimmer {
|
.cover-container.loaded {
|
||||||
/*background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
|
background-color: transparent;
|
||||||
background-size: 200% 100%;
|
|
||||||
animation: shimmer 2.5s infinite linear;*/
|
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes shimmer {
|
|
||||||
0% {
|
|
||||||
background-position: -200% 0;
|
|
||||||
}
|
|
||||||
100% {
|
|
||||||
background-position: 200% 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.book-cover {
|
.book-cover {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Component, ElementRef, EventEmitter, inject, Input, OnDestroy, OnInit, Optional, Output, ViewChild} from '@angular/core';
|
import {Component, ElementRef, EventEmitter, inject, Input, OnDestroy, OnInit, Output, ViewChild} from '@angular/core';
|
||||||
import {Book, BookMetadata} from '../../../model/book.model';
|
import {Book} from '../../../model/book.model';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {MenuModule} from 'primeng/menu';
|
import {MenuModule} from 'primeng/menu';
|
||||||
import {ConfirmationService, MenuItem, MessageService} from 'primeng/api';
|
import {ConfirmationService, MenuItem, MessageService} from 'primeng/api';
|
||||||
@@ -20,7 +20,6 @@ import {TieredMenu} from 'primeng/tieredmenu';
|
|||||||
import {BookSenderComponent} from '../../book-sender/book-sender.component';
|
import {BookSenderComponent} from '../../book-sender/book-sender.component';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {ProgressBar} from 'primeng/progressbar';
|
import {ProgressBar} from 'primeng/progressbar';
|
||||||
import {BookMetadataHostService} from '../../../../book-metadata-host-service';
|
|
||||||
import {BookMetadataCenterComponent} from '../../../metadata/book-metadata-center/book-metadata-center.component';
|
import {BookMetadataCenterComponent} from '../../../metadata/book-metadata-center/book-metadata-center.component';
|
||||||
import {takeUntil} from 'rxjs/operators';
|
import {takeUntil} from 'rxjs/operators';
|
||||||
|
|
||||||
@@ -32,9 +31,10 @@ import {takeUntil} from 'rxjs/operators';
|
|||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
export class BookCardComponent implements OnInit, OnDestroy {
|
export class BookCardComponent implements OnInit, OnDestroy {
|
||||||
@Input() index!: number;
|
|
||||||
@Output() checkboxClick = new EventEmitter<{ index: number; bookId: number; selected: boolean; shiftKey: boolean }>();
|
@Output() checkboxClick = new EventEmitter<{ index: number; bookId: number; selected: boolean; shiftKey: boolean }>();
|
||||||
|
|
||||||
|
@Input() index!: number;
|
||||||
@Input() book!: Book;
|
@Input() book!: Book;
|
||||||
@Input() isCheckboxEnabled: boolean = false;
|
@Input() isCheckboxEnabled: boolean = false;
|
||||||
@Input() onBookSelect?: (bookId: number, selected: boolean) => void;
|
@Input() onBookSelect?: (bookId: number, selected: boolean) => void;
|
||||||
|
|||||||
+103
-63
@@ -1,14 +1,14 @@
|
|||||||
@if (book$ | async; as book) {
|
@if (book$ | async; as book) {
|
||||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="flex flex-col h-full min-w-[80rem]">
|
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="flex flex-col h-full md:min-w-[80rem]">
|
||||||
@if (isLoading) {
|
@if (isLoading) {
|
||||||
<div class="absolute inset-0 bg-black opacity-25 z-10 "></div>
|
<div class="absolute inset-0 bg-black opacity-25 z-10 "></div>
|
||||||
}
|
}
|
||||||
@if (isLoading) {
|
@if (isLoading) {
|
||||||
<p-progressSpinner [style]="{position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)'}"></p-progressSpinner>
|
<p-progressSpinner [style]="{position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)'}"></p-progressSpinner>
|
||||||
}
|
}
|
||||||
<div class="flex-grow overflow-auto py-2 px-2">
|
<div class="flex-grow overflow-auto md:py-2 md:px-2 ">
|
||||||
<div class="flex flex-row w-full gap-4">
|
<div class="flex flex-col md:flex-row w-full gap-4">
|
||||||
<div class="flex flex-col items-center gap-2 relative">
|
<div class="flex flex-col items-center gap-4 relative">
|
||||||
<img
|
<img
|
||||||
[attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
|
[attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)"
|
||||||
alt="Image"
|
alt="Image"
|
||||||
@@ -56,8 +56,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col flex-grow pl-2">
|
<div class="flex flex-col flex-grow pl-2">
|
||||||
|
|
||||||
<div class="flex flex-row w-full gap-4 pb-1">
|
<div class="flex flex-col md:flex-row w-full gap-4 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-2/3">
|
<div class="flex flex-col gap-1 md:w-2/3">
|
||||||
<label for="title">Title</label>
|
<label for="title">Title</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="title" formControlName="title" class="w-full"/>
|
<input pInputText id="title" formControlName="title" class="w-full"/>
|
||||||
@@ -69,7 +69,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/3">
|
<div class="flex flex-col gap-1 md:w-1/3">
|
||||||
<label for="subtitle">Subtitle</label>
|
<label for="subtitle">Subtitle</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="subtitle" formControlName="subtitle" class="w-full"/>
|
<input pInputText id="subtitle" formControlName="subtitle" class="w-full"/>
|
||||||
@@ -83,8 +83,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-col md:flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex flex-col gap-1 basis-[71%]">
|
<div class="flex flex-col gap-1 md:basis-[71%]">
|
||||||
<label for="authors">Authors</label>
|
<label for="authors">Authors</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<div class="w-full">
|
<div class="w-full">
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 basis-[20%]">
|
<div class="flex flex-col gap-1 md:basis-[20%]">
|
||||||
<label for="publisher">Publisher</label>
|
<label for="publisher">Publisher</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="publisher" formControlName="publisher" class="w-full"/>
|
<input pInputText id="publisher" formControlName="publisher" class="w-full"/>
|
||||||
@@ -110,7 +110,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 basis-[14%]">
|
<div class="flex flex-col gap-1 md:basis-[14%]">
|
||||||
<label for="language">Language</label>
|
<label for="language">Language</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="language" formControlName="language" class="w-full"/>
|
<input pInputText id="language" formControlName="language" class="w-full"/>
|
||||||
@@ -124,7 +124,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-col md:flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-full">
|
<div class="flex flex-col gap-1 w-full">
|
||||||
<label for="categories">Categories</label>
|
<label for="categories">Categories</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
@@ -140,11 +140,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
|
||||||
<div class="flex flex-col gap-1 basis-[75%]">
|
<div class="flex flex-col md:flex-row w-full gap-4 mt-2 pb-1">
|
||||||
|
<div class="flex flex-col gap-1 md:basis-[75%]">
|
||||||
<label for="seriesName">Series Name</label>
|
<label for="seriesName">Series Name</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="seriesName" formControlName="seriesName" class="w-full" />
|
<input pInputText id="seriesName" formControlName="seriesName" class="w-full"/>
|
||||||
@if (!book.metadata!['seriesNameLocked']) {
|
@if (!book.metadata!['seriesNameLocked']) {
|
||||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="success"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="success"></p-button>
|
||||||
}
|
}
|
||||||
@@ -154,10 +155,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-[10%]">
|
<div class="flex flex-col gap-1 md:basis-[10%]">
|
||||||
<label for="seriesNumber">Book #</label>
|
<label for="seriesNumber">Book #</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="seriesNumber" formControlName="seriesNumber" class="w-full" />
|
<input pInputText id="seriesNumber" formControlName="seriesNumber" class="w-full"/>
|
||||||
@if (!book.metadata!['seriesNumberLocked']) {
|
@if (!book.metadata!['seriesNumberLocked']) {
|
||||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="success"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="success"></p-button>
|
||||||
}
|
}
|
||||||
@@ -167,10 +168,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-[10%]">
|
<div class="flex flex-col gap-1 md:basis-[10%]">
|
||||||
<label for="seriesTotal">Total Books</label>
|
<label for="seriesTotal">Total Books</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="seriesTotal" formControlName="seriesTotal" class="w-full" />
|
<input pInputText id="seriesTotal" formControlName="seriesTotal" class="w-full"/>
|
||||||
@if (!book.metadata!['seriesTotalLocked']) {
|
@if (!book.metadata!['seriesTotalLocked']) {
|
||||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="success"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="success"></p-button>
|
||||||
}
|
}
|
||||||
@@ -180,10 +181,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-[15%]">
|
<div class="flex flex-col gap-1 md:basis-[15%]">
|
||||||
<label for="publishedDate">Publish Date</label>
|
<label for="publishedDate">Publish Date</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="publishedDate" formControlName="publishedDate" class="w-full" />
|
<input pInputText id="publishedDate" formControlName="publishedDate" class="w-full"/>
|
||||||
@if (!book.metadata!['publishedDateLocked']) {
|
@if (!book.metadata!['publishedDateLocked']) {
|
||||||
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('publishedDate')" severity="success"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('publishedDate')" severity="success"></p-button>
|
||||||
}
|
}
|
||||||
@@ -194,8 +195,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-col md:flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="isbn10">ISBN 10</label>
|
<label for="isbn10">ISBN 10</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="isbn10" formControlName="isbn10" class="w-full"/>
|
<input pInputText id="isbn10" formControlName="isbn10" class="w-full"/>
|
||||||
@@ -207,7 +208,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="isbn13">ISBN 13</label>
|
<label for="isbn13">ISBN 13</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="isbn13" formControlName="isbn13" class="w-full"/>
|
<input pInputText id="isbn13" formControlName="isbn13" class="w-full"/>
|
||||||
@@ -219,7 +220,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="asin">ASIN (Amazon ID)</label>
|
<label for="asin">ASIN (Amazon ID)</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="asin" formControlName="asin" class="w-full"/>
|
<input pInputText id="asin" formControlName="asin" class="w-full"/>
|
||||||
@@ -231,7 +232,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="amazonRating">Amazon ★</label>
|
<label for="amazonRating">Amazon ★</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="amazonRating" formControlName="amazonRating" class="w-full"/>
|
<input pInputText id="amazonRating" formControlName="amazonRating" class="w-full"/>
|
||||||
@@ -243,7 +244,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="amazonRatingCount">Amazon Reviews</label>
|
<label for="amazonRatingCount">Amazon Reviews</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="amazonRatingCount" formControlName="amazonReviewCount" class="w-full"/>
|
<input pInputText id="amazonRatingCount" formControlName="amazonReviewCount" class="w-full"/>
|
||||||
@@ -255,7 +256,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="googleId">Google Books ID</label>
|
<label for="googleId">Google Books ID</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="googleId" formControlName="googleId" class="w-full"/>
|
<input pInputText id="googleId" formControlName="googleId" class="w-full"/>
|
||||||
@@ -269,8 +270,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-col md:flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="goodreadsId">Goodreads ID</label>
|
<label for="goodreadsId">Goodreads ID</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="goodreadsId" formControlName="goodreadsId" class="w-full"/>
|
<input pInputText id="goodreadsId" formControlName="goodreadsId" class="w-full"/>
|
||||||
@@ -282,7 +283,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="goodreadsRating">Goodreads ★</label>
|
<label for="goodreadsRating">Goodreads ★</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="goodreadsRating" formControlName="goodreadsRating" class="w-full"/>
|
<input pInputText id="goodreadsRating" formControlName="goodreadsRating" class="w-full"/>
|
||||||
@@ -294,7 +295,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="goodreadsReviewCount">Goodreads Reviews</label>
|
<label for="goodreadsReviewCount">Goodreads Reviews</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount" class="w-full"/>
|
<input pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount" class="w-full"/>
|
||||||
@@ -306,7 +307,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="hardcoverId">Hardcover ID</label>
|
<label for="hardcoverId">Hardcover ID</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="hardcoverId" formControlName="hardcoverId" class="w-full"/>
|
<input pInputText id="hardcoverId" formControlName="hardcoverId" class="w-full"/>
|
||||||
@@ -318,7 +319,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="hardcoverRating">Hardcover ★</label>
|
<label for="hardcoverRating">Hardcover ★</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="hardcoverRating" formControlName="hardcoverRating" class="w-full"/>
|
<input pInputText id="hardcoverRating" formControlName="hardcoverRating" class="w-full"/>
|
||||||
@@ -330,7 +331,7 @@
|
|||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 md:w-1/6">
|
||||||
<label for="hardcoverReviewCount">Hardcover Reviews</label>
|
<label for="hardcoverReviewCount">Hardcover Reviews</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount" class="w-full"/>
|
<input pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount" class="w-full"/>
|
||||||
@@ -353,7 +354,7 @@
|
|||||||
<p-tab value="editor">WYSIWYG Editor</p-tab>
|
<p-tab value="editor">WYSIWYG Editor</p-tab>
|
||||||
<p-tab value="html">HTML Editor</p-tab>
|
<p-tab value="html">HTML Editor</p-tab>
|
||||||
</p-tablist>
|
</p-tablist>
|
||||||
<p-tabpanels>
|
<p-tabpanels class="custom-tab-padding">
|
||||||
<p-tabpanel value="editor">
|
<p-tabpanel value="editor">
|
||||||
<form [formGroup]="metadataForm">
|
<form [formGroup]="metadataForm">
|
||||||
<p-editor #quillEditor formControlName="description" [readonly]="quillDisabled()" [style]="{ height: '200px' }">
|
<p-editor #quillEditor formControlName="description" [readonly]="quillDisabled()" [style]="{ height: '200px' }">
|
||||||
@@ -412,35 +413,74 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="mt-auto">
|
<div class="mt-auto">
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
<div class="flex justify-between px-2 pt-1 pb-4 z-10">
|
<div class="flex flex-col gap-2 px-2 pt-1 md:pb-4 z-10">
|
||||||
@if (showNavigationButtons) {
|
|
||||||
<div class="flex gap-x-4">
|
<!-- Desktop Buttons -->
|
||||||
<p-button label="Close" icon="pi pi-times" [outlined]="true" severity="danger" (onClick)="closeDialog()"></p-button>
|
<div class="hidden sm:flex justify-between w-full gap-4">
|
||||||
<p-divider layout="vertical"/>
|
@if (showNavigationButtons) {
|
||||||
<p-button label="Previous Book" [disabled]="disablePrevious" icon="pi pi-arrow-left" [outlined]="true" severity="info" (onClick)="onPrevious()"></p-button>
|
<div class="flex gap-x-4">
|
||||||
<p-button label="Next Book" [disabled]="disableNext" icon="pi pi-arrow-right" iconPos="right" [outlined]="true" severity="info" (onClick)="onNext()"></p-button>
|
<p-button label="Close" icon="pi pi-times" [outlined]="true" severity="danger" (onClick)="closeDialog()"></p-button>
|
||||||
</div>
|
<p-divider layout="vertical" />
|
||||||
}
|
<p-button label="Previous Book" [disabled]="disablePrevious" icon="pi pi-arrow-left" [outlined]="true" severity="info" (onClick)="onPrevious()"></p-button>
|
||||||
<div class="flex gap-x-4 items-center ml-auto">
|
<p-button label="Next Book" [disabled]="disableNext" icon="pi pi-arrow-right" iconPos="right" [outlined]="true" severity="info" (onClick)="onNext()"></p-button>
|
||||||
<p-button
|
</div>
|
||||||
[label]="isAutoFetching ? 'Fetching...' : 'Auto Fetch'"
|
|
||||||
[icon]="isAutoFetching ? 'pi pi-spin pi-spinner' : 'pi pi-bolt'"
|
|
||||||
[outlined]="true"
|
|
||||||
severity="info"
|
|
||||||
(onClick)="autoFetch(book.id)"
|
|
||||||
[disabled]="isAutoFetching"
|
|
||||||
pTooltip="Automatically fetch metadata using default sources"
|
|
||||||
tooltipPosition="top">
|
|
||||||
</p-button>
|
|
||||||
@if (book.bookType === 'PDF' || book.bookType === 'EPUB') {
|
|
||||||
<p-button label="Restore" icon="pi pi-refresh" [outlined]="true" severity="danger" (onClick)="restoreMetadata()" pTooltip="Revert all changes to original metadata" tooltipPosition="top"></p-button>
|
|
||||||
<p-divider layout="vertical"/>
|
|
||||||
}
|
}
|
||||||
<p-button label="Unlock All" icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()" pTooltip="Unlock all metadata fields for editing" tooltipPosition="top"></p-button>
|
|
||||||
<p-button label="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()" pTooltip="Lock all metadata fields to prevent changes" tooltipPosition="top"></p-button>
|
<div class="flex gap-x-4 items-center ml-auto">
|
||||||
<p-divider layout="vertical"/>
|
<p-button
|
||||||
<p-button label="Save" icon="pi pi-check" [loading]="isSaving" [disabled]="isSaving" type="submit"></p-button>
|
[label]="isAutoFetching ? 'Fetching…' : 'Auto Fetch'"
|
||||||
|
[icon]="isAutoFetching ? 'pi pi-spin pi-spinner' : 'pi pi-bolt'"
|
||||||
|
[outlined]="true"
|
||||||
|
severity="info"
|
||||||
|
(onClick)="autoFetch(book.id)"
|
||||||
|
[disabled]="isAutoFetching"
|
||||||
|
pTooltip="Automatically fetch metadata using default sources"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
|
||||||
|
@if (book.bookType === 'PDF' || book.bookType === 'EPUB') {
|
||||||
|
<p-button label="Restore" icon="pi pi-refresh" [outlined]="true" severity="danger" (onClick)="restoreMetadata()" pTooltip="Revert all changes to original metadata" tooltipPosition="top"></p-button>
|
||||||
|
<p-divider layout="vertical" />
|
||||||
|
}
|
||||||
|
|
||||||
|
<p-button label="Unlock All" icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()" pTooltip="Unlock all metadata fields for editing" tooltipPosition="top"></p-button>
|
||||||
|
<p-button label="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()" pTooltip="Lock all metadata fields to prevent changes" tooltipPosition="top"></p-button>
|
||||||
|
<p-divider layout="vertical" />
|
||||||
|
<p-button label="Save" icon="pi pi-check" [loading]="isSaving" [disabled]="isSaving" type="submit"></p-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Mobile Buttons -->
|
||||||
|
<div class="flex sm:hidden justify-between w-full flex-wrap">
|
||||||
|
@if (showNavigationButtons) {
|
||||||
|
<div class="flex gap-2 flex-wrap">
|
||||||
|
<p-button icon="pi pi-times" [outlined]="true" severity="danger" (onClick)="closeDialog()" pTooltip="Close" tooltipPosition="top"></p-button>
|
||||||
|
<p-button icon="pi pi-arrow-left" [disabled]="disablePrevious" [outlined]="true" severity="info" (onClick)="onPrevious()" pTooltip="Previous Book" tooltipPosition="top"></p-button>
|
||||||
|
<p-button icon="pi pi-arrow-right" [disabled]="disableNext" iconPos="right" [outlined]="true" severity="info" (onClick)="onNext()" pTooltip="Next Book" tooltipPosition="top"></p-button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="flex gap-4 items-center flex-wrap ml-auto">
|
||||||
|
<p-button
|
||||||
|
icon="pi pi-bolt"
|
||||||
|
[outlined]="true"
|
||||||
|
severity="info"
|
||||||
|
(onClick)="autoFetch(book.id)"
|
||||||
|
[disabled]="isAutoFetching"
|
||||||
|
pTooltip="Auto Fetch"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
|
||||||
|
@if (book.bookType === 'PDF' || book.bookType === 'EPUB') {
|
||||||
|
<p-button icon="pi pi-refresh" [outlined]="true" severity="danger" (onClick)="restoreMetadata()" pTooltip="Restore" tooltipPosition="top"></p-button>
|
||||||
|
}
|
||||||
|
<p-button icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()" pTooltip="Unlock All" tooltipPosition="top"></p-button>
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()" pTooltip="Lock All" tooltipPosition="top"></p-button>
|
||||||
|
<p-divider layout="vertical" />
|
||||||
|
<p-button label="Save" icon="pi pi-check" [loading]="isSaving" [disabled]="isSaving" type="submit"></p-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
::ng-deep .p-tabpanels .custom-tab-padding {
|
||||||
|
padding: 1rem 0rem 0rem 0.5rem !important;
|
||||||
|
|
||||||
|
@media (min-width: 640px) {
|
||||||
|
padding: var(--p-tabs-tabpanel-padding) !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
@if (book$ | async; as book) {
|
@if (book$ | async; as book) {
|
||||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="flex flex-col h-full w-full">
|
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="flex flex-col h-full w-full">
|
||||||
<div class="flex-grow overflow-auto p-4">
|
<div class="flex-grow overflow-auto p-0 md:p-4">
|
||||||
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
||||||
<p class="ml-3 text-lg">Current Metadata</p>
|
<p class="ml-3 text-lg">Current Metadata</p>
|
||||||
<p-button
|
<p-button
|
||||||
|
|||||||
+44
-20
@@ -7,48 +7,72 @@
|
|||||||
</app-metadata-picker>
|
</app-metadata-picker>
|
||||||
</div>
|
</div>
|
||||||
} @else {
|
} @else {
|
||||||
<form class="flex flex-col w-full h-full pt-2 min-w-[60rem] pr-4" [formGroup]="form" (ngSubmit)="onSubmit()">
|
<form class="flex flex-col w-full h-full pt-2 min-w-full md:min-w-[60rem] pr-0 md:pr-2 pl-0 md:pl-2" [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||||
<div class="flex w-full gap-x-4 items-end">
|
<!-- Responsive search inputs -->
|
||||||
<div class="flex flex-col gap-1 w-3/12">
|
<div class="grid grid-cols-1 md:flex md:flex-row w-full gap-4 md:items-end">
|
||||||
<label>Providers</label>
|
|
||||||
<p-multiselect id="provider" class="w-full" [filter]="false" showToggleAll="false" [options]="providers" formControlName="provider"
|
<div class="flex flex-col gap-1 w-full max-w-full md:w-3/12">
|
||||||
placeholder="Select Providers"></p-multiselect>
|
<label for="provider">Providers</label>
|
||||||
|
<p-multiselect
|
||||||
|
id="provider"
|
||||||
|
class="w-full"
|
||||||
|
[filter]="false"
|
||||||
|
showToggleAll="false"
|
||||||
|
[options]="providers"
|
||||||
|
formControlName="provider"
|
||||||
|
placeholder="Select Providers">
|
||||||
|
</p-multiselect>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-5/12">
|
|
||||||
|
<div class="flex flex-col gap-1 w-full max-w-full md:w-5/12">
|
||||||
<label for="title">Title</label>
|
<label for="title">Title</label>
|
||||||
<input pInputText formControlName="title" id="title" class="w-full"/>
|
<input pInputText formControlName="title" id="title" class="w-full"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-4/12">
|
|
||||||
|
<div class="flex flex-col gap-1 w-full max-w-full md:w-4/12">
|
||||||
<label for="author">Author</label>
|
<label for="author">Author</label>
|
||||||
<input pInputText formControlName="author" id="author" class="w-full"/>
|
<input pInputText formControlName="author" id="author" class="w-full"/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
|
||||||
<p-button label="Search" type="submit" outlined="true" [disabled]="!isSearchEnabled || loading"></p-button>
|
<div class="flex flex-col gap-1 w-full sm:w-fit md:w-auto">
|
||||||
|
<label class="invisible md:visible h-0 md:h-auto">Search</label>
|
||||||
|
<div class="flex justify-center md:justify-start">
|
||||||
|
<p-button
|
||||||
|
label="Search"
|
||||||
|
type="submit"
|
||||||
|
outlined="true"
|
||||||
|
[disabled]="!isSearchEnabled || loading"
|
||||||
|
class="w-full sm:w-fit md:w-auto">
|
||||||
|
</p-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (loading) {
|
@if (loading) {
|
||||||
<div class="flex justify-center items-center">
|
<div class="flex justify-center items-center mt-8">
|
||||||
<p-progress-spinner ariaLabel="loading"/>
|
<p-progress-spinner ariaLabel="loading"/>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (!loading) {
|
@if (!loading) {
|
||||||
<div class="mt-8 flex-1 overflow-y-auto">
|
<div class="mt-4 md:mt-8 flex-1 overflow-y-auto">
|
||||||
@for (metadata of allFetchedMetadata; track metadata) {
|
@for (metadata of allFetchedMetadata; track metadata) {
|
||||||
<div class="book-item flex flex-col w-full">
|
<div class="book-item flex flex-col w-full">
|
||||||
<div class="flex w-full flex-row book-item-content" (click)="onBookClick(metadata)">
|
<div class="flex flex-row w-full book-item-content cursor-pointer" (click)="onBookClick(metadata)">
|
||||||
<img [src]="metadata.thumbnailUrl || 'assets/images/missing-cover.jpg'" alt="Image" class="img-fixed-dimensions pr-2"/>
|
<img [src]="metadata.thumbnailUrl || 'assets/images/missing-cover.jpg'" alt="Image" class="img-fixed-dimensions pr-0 md:pr-2 self-center md:self-start"/>
|
||||||
<div class=" flex flex-col w-full m-2">
|
<div class="flex flex-col w-full m-2">
|
||||||
<div class="flex flex-row gap-4 justify-between">
|
<div class="flex flex-col md:flex-row gap-2 md:gap-4 justify-between">
|
||||||
<p class="font-bold">{{ truncateText(metadata['title']!, 90) }}</p>
|
<p class="font-bold">{{ truncateText(metadata['title']!, 90) }}</p>
|
||||||
<div class="flex gap-2">
|
<div class="flex flex-wrap gap-2 text-sm">
|
||||||
<p>ISBN: {{ metadata['isbn10'] || metadata['asin'] }}</p>
|
<p>ISBN: {{ metadata['isbn10'] || metadata['asin'] }}</p>
|
||||||
<p> | </p>
|
<span class="hidden md:inline">|</span>
|
||||||
<p>Published: {{ metadata['publishedDate'] }}</p>
|
<p>Published: {{ metadata['publishedDate'] }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex gap-2">
|
<div class="flex flex-wrap gap-2 text-sm">
|
||||||
<p>by {{ truncateText(metadata['authors']!.join(', '), 70) }}</p>
|
<p>by {{ truncateText(metadata['authors']!.join(', '), 70) }}</p>
|
||||||
<p> | </p>
|
<span class="hidden md:inline">|</span>
|
||||||
<p>Source: <span [innerHTML]="buildProviderLink(metadata)"></span></p>
|
<p>Source: <span [innerHTML]="buildProviderLink(metadata)"></span></p>
|
||||||
</div>
|
</div>
|
||||||
<p class="mt-4 truncate-text p-secondary">
|
<p class="mt-4 truncate-text p-secondary">
|
||||||
|
|||||||
+296
-269
@@ -1,56 +1,73 @@
|
|||||||
<div class="pt-2 flex flex-col h-full px-2 w-full">
|
<div class="p-0 md:p-2 flex flex-col h-full w-full rounded-xl">
|
||||||
@if (book$ | async; as book) {
|
@if (book$ | async; as book) {
|
||||||
<div>
|
<div class="flex flex-col md:flex-row gap-6 pb-8">
|
||||||
<div class="flex flex-row">
|
|
||||||
<div class="cover-wrapper relative">
|
<div class="flex justify-center md:justify-start">
|
||||||
|
<div class="relative w-[250px] min-w-[250px] md:w-[250px]">
|
||||||
<img
|
<img
|
||||||
[attr.src]="urlHelper.getCoverUrl(book?.metadata!.bookId, book?.metadata!.coverUpdatedOn)"
|
[attr.src]="urlHelper.getCoverUrl(book?.metadata!.bookId, book?.metadata!.coverUpdatedOn)"
|
||||||
class="book-cover placeholder"
|
class="rounded-xl w-full object-cover"
|
||||||
alt="Cover of {{ book?.metadata!.title }}"
|
alt="Cover of {{ book?.metadata!.title }}"
|
||||||
loading="lazy"
|
loading="lazy"
|
||||||
width="225"
|
|
||||||
style="min-width: 225px;"
|
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@if (book?.metadata!.seriesNumber != null) {
|
@if (book?.metadata!.seriesNumber != null) {
|
||||||
<div class="series-number-overlay">
|
<div class="absolute top-2 left-2 bg-black/60 text-white px-2 py-0.5 rounded-lg text-xs font-semibold">
|
||||||
#{{ book?.metadata!.seriesNumber }}
|
#{{ book?.metadata!.seriesNumber }}
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (getProgressPercent(book) !== null) {
|
@if (getProgressPercent(book) !== null) {
|
||||||
<p-progressBar
|
<div class="absolute bottom-0 left-0 right-0">
|
||||||
[value]="getProgressPercent(book)"
|
<p-progressBar
|
||||||
[showValue]="true"
|
[value]="getProgressPercent(book)"
|
||||||
[ngClass]="{ 'progress-complete': getProgressPercent(book) === 100, 'progress-incomplete': getProgressPercent(book)! < 100 }"
|
[showValue]="false"
|
||||||
[style]="{ height: '10px' }">
|
[ngClass]="{
|
||||||
</p-progressBar>
|
'rounded-b-xl': true,
|
||||||
|
'progress-complete': getProgressPercent(book) === 100,
|
||||||
|
'progress-incomplete': getProgressPercent(book)! < 100
|
||||||
|
}"
|
||||||
|
[style]="{ height: '8px' }">
|
||||||
|
</p-progressBar>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col justify-between">
|
</div>
|
||||||
<div class="pl-6 flex flex-col">
|
|
||||||
<div class="flex flex-row items-center justify-between">
|
<div class="flex flex-col justify-between flex-grow">
|
||||||
<div>
|
<div class="space-y-4">
|
||||||
@if (book?.metadata?.seriesName) {
|
|
||||||
<p class="underline hover:opacity-80 cursor-pointer" (click)="goToSeries(book?.metadata?.seriesName!)">
|
<div class="flex items-start justify-between">
|
||||||
{{ book?.metadata?.seriesName }}
|
<div class="flex flex-col text-center md:text-left w-full">
|
||||||
@if (book?.metadata?.seriesNumber) {
|
@if (book?.metadata?.seriesName) {
|
||||||
#{{ book?.metadata?.seriesNumber }}
|
<p
|
||||||
}
|
class="text-blue-600 cursor-pointer hover:underline"
|
||||||
</p>
|
(click)="goToSeries(book?.metadata?.seriesName!)"
|
||||||
}
|
>
|
||||||
<div class="flex items-center gap-2">
|
{{ book?.metadata?.seriesName }}
|
||||||
<p class="text-2xl font-bold m-0">{{ book?.metadata!.title }}</p>
|
@if (book?.metadata?.seriesNumber) {
|
||||||
|
#{{ book?.metadata?.seriesNumber }}
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="flex flex-col items-center md:items-start gap-1">
|
||||||
|
<div class="flex items-center gap-2 justify-center md:justify-start flex-wrap text-center md:text-left">
|
||||||
|
<h2 class="text-3xl font-extrabold text-gray-900 dark:text-white leading-tight">
|
||||||
|
{{ book?.metadata!.title }}
|
||||||
|
</h2>
|
||||||
<i
|
<i
|
||||||
class="pi"
|
class="pi align-middle"
|
||||||
[ngClass]="isMetadataFullyLocked(book?.metadata!) ? 'pi-lock text-red-500' : 'pi-lock-open text-green-500'"
|
[ngClass]="isMetadataFullyLocked(book?.metadata!) ? 'pi-lock text-red-500' : 'pi-lock-open text-green-500'"
|
||||||
[title]="isMetadataFullyLocked(book?.metadata!) ? 'Metadata is locked' : 'Metadata is unlocked'"
|
[title]="isMetadataFullyLocked(book?.metadata!) ? 'Metadata is locked' : 'Metadata is unlocked'"
|
||||||
style="font-size: 1.25rem;"
|
|
||||||
pTooltip="{{ isMetadataFullyLocked(book?.metadata!) ? 'This book metadata is locked.' : 'This book metadata is unlocked.' }}"
|
pTooltip="{{ isMetadataFullyLocked(book?.metadata!) ? 'This book metadata is locked.' : 'This book metadata is unlocked.' }}"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top"
|
||||||
</i>
|
></i>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-lg">
|
|
||||||
|
<p class="text-gray-600 dark:text-gray-300 text-lg">
|
||||||
@for (author of book?.metadata!.authors; track author; let isLast = $last) {
|
@for (author of book?.metadata!.authors; track author; let isLast = $last) {
|
||||||
<a class="underline hover:opacity-80 cursor-pointer" (click)="goToAuthorBooks(author)">
|
<a class="hover:underline dark:text-blue-400 cursor-pointer" (click)="goToAuthorBooks(author)">
|
||||||
{{ author }}
|
{{ author }}
|
||||||
</a>
|
</a>
|
||||||
@if (!isLast) {
|
@if (!isLast) {
|
||||||
@@ -60,12 +77,13 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-2 pt-2">
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-start text-sm w-full">
|
||||||
|
|
||||||
|
<div class="flex justify-center sm:justify-start">
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<i class="pi pi-thumbs-up-fill"
|
<i class="pi pi-thumbs-up-fill text-yellow-500" pTooltip="Personal Rating" tooltipPosition="top"></i>
|
||||||
pTooltip="Personal Rating"
|
|
||||||
tooltipPosition="top">
|
|
||||||
</i>
|
|
||||||
<p-rating
|
<p-rating
|
||||||
[ngModel]="book?.metadata!.personalRating"
|
[ngModel]="book?.metadata!.personalRating"
|
||||||
(onRate)="onPersonalRatingChange(book, $event)"
|
(onRate)="onPersonalRatingChange(book, $event)"
|
||||||
@@ -73,281 +91,290 @@
|
|||||||
[style.--p-rating-icon-active-color]="getStarColorScaled(book?.metadata!.personalRating, 10)">
|
[style.--p-rating-icon-active-color]="getStarColorScaled(book?.metadata!.personalRating, 10)">
|
||||||
</p-rating>
|
</p-rating>
|
||||||
</div>
|
</div>
|
||||||
@if (book?.metadata!.amazonRating || book?.metadata!.goodreadsRating || book?.metadata!.hardcoverRating) {
|
</div>
|
||||||
@if (book?.metadata!.amazonRating) {
|
|
||||||
@if (book?.metadata!.asin) {
|
@if (book?.metadata?.amazonRating || book?.metadata?.goodreadsRating || book?.metadata?.hardcoverRating || book?.metadata?.googleId) {
|
||||||
<span>|</span>
|
<span class="hidden sm:inline text-gray-400 text-xl px-1 leading-none">|</span>
|
||||||
<a class="flex items-center gap-1" [href]="'https://www.amazon.com/dp/' + book?.metadata!.asin" target="_blank" rel="noopener noreferrer">
|
}
|
||||||
<img src="https://www.amazon.com/favicon.ico" alt="Amazon"
|
|
||||||
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"/>
|
<div class="flex flex-wrap justify-center sm:justify-start gap-4 pt-1">
|
||||||
<p class="font-semibold">{{ book?.metadata!.amazonRating }}</p>
|
@if (book?.metadata?.amazonRating) {
|
||||||
</a>
|
<a
|
||||||
} @else {
|
class="flex items-center gap-1"
|
||||||
<span class="flex items-center gap-1">
|
[href]="'https://www.amazon.com/dp/' + (book.metadata?.asin ?? '')"
|
||||||
<img src="https://www.amazon.com/favicon.ico" alt="Amazon" class="w-5 h-5 object-contain"/>
|
target="_blank"
|
||||||
<p class="font-semibold">{{ book?.metadata!.amazonRating }}</p>
|
rel="noopener noreferrer"
|
||||||
</span>
|
[pTooltip]="getRatingTooltip(book, 'amazon')"
|
||||||
}
|
tooltipPosition="top"
|
||||||
<p-rating [ngModel]="book?.metadata!.amazonRating" readonly stars="5"
|
>
|
||||||
[style.--p-rating-icon-active-color]="getStarColorScaled(book?.metadata!.amazonRating)">
|
<img
|
||||||
</p-rating>
|
src="https://www.amazon.com/favicon.ico"
|
||||||
<p class="font-semibold">({{ book?.metadata!.amazonReviewCount | number:'1.0-0' }})</p>
|
alt="Amazon"
|
||||||
@if (book?.metadata!.goodreadsRating || book?.metadata!.hardcoverRating) {
|
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"
|
||||||
<span>|</span>
|
/>
|
||||||
}
|
<span class="font-semibold">
|
||||||
}
|
{{ getRatingPercent(book.metadata!.amazonRating) }}%
|
||||||
@if (book?.metadata!.goodreadsRating) {
|
</span>
|
||||||
@if (book?.metadata!.goodreadsId) {
|
</a>
|
||||||
<a class="flex items-center gap-1" [href]="'https://www.goodreads.com/book/show/' + book?.metadata!.goodreadsId" target="_blank" rel="noopener noreferrer">
|
}
|
||||||
<img src="https://www.goodreads.com/favicon.ico" alt="Goodreads"
|
|
||||||
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"/>
|
@if (book?.metadata?.goodreadsRating) {
|
||||||
<p class="font-semibold">{{ book?.metadata!.goodreadsRating }}</p>
|
<a
|
||||||
</a>
|
class="flex items-center gap-1"
|
||||||
} @else {
|
[href]="'https://www.goodreads.com/book/show/' + (book.metadata?.goodreadsId ?? '')"
|
||||||
<span class="flex items-center gap-1">
|
target="_blank"
|
||||||
<img src="https://www.goodreads.com/favicon.ico" alt="Goodreads" class="w-5 h-5 object-contain"/>
|
rel="noopener noreferrer"
|
||||||
<p class="font-semibold">{{ book?.metadata!.goodreadsRating }}</p>
|
[pTooltip]="getRatingTooltip(book, 'goodreads')"
|
||||||
</span>
|
tooltipPosition="top"
|
||||||
}
|
>
|
||||||
<p-rating [ngModel]="book?.metadata!.goodreadsRating" readonly stars="5"
|
<img
|
||||||
[style.--p-rating-icon-active-color]="getStarColorScaled(book?.metadata!.goodreadsRating)">
|
src="https://www.goodreads.com/favicon.ico"
|
||||||
</p-rating>
|
alt="Goodreads"
|
||||||
<p class="font-semibold">({{ book?.metadata!.goodreadsReviewCount | number:'1.0-0' }})</p>
|
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"
|
||||||
@if (book?.metadata!.hardcoverRating) {
|
/>
|
||||||
<span>|</span>
|
<span class="font-semibold">
|
||||||
}
|
{{ getRatingPercent(book.metadata!.goodreadsRating) }}%
|
||||||
}
|
</span>
|
||||||
@if (book?.metadata!.hardcoverRating) {
|
</a>
|
||||||
@if (book?.metadata!.hardcoverId) {
|
}
|
||||||
<a class="flex items-center gap-1" [href]="'https://hardcover.app/books/' + book?.metadata!.hardcoverId" target="_blank" rel="noopener noreferrer">
|
|
||||||
<img src="https://assets.hardcover.app/static/favicon.ico" alt="Hardcover"
|
@if (book?.metadata?.hardcoverRating) {
|
||||||
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"/>
|
<a
|
||||||
<p class="font-semibold">{{ book?.metadata!.hardcoverRating }}</p>
|
class="flex items-center gap-1"
|
||||||
</a>
|
[href]="'https://hardcover.app/books/' + (book.metadata?.hardcoverId ?? '')"
|
||||||
} @else {
|
target="_blank"
|
||||||
<span class="flex items-center gap-1">
|
rel="noopener noreferrer"
|
||||||
<img src="https://assets.hardcover.app/static/favicon.ico" alt="Hardcover" class="w-5 h-5 object-contain"/>
|
[pTooltip]="getRatingTooltip(book, 'hardcover')"
|
||||||
<p class="font-semibold">{{ book?.metadata!.hardcoverRating }}</p>
|
tooltipPosition="top"
|
||||||
</span>
|
>
|
||||||
}
|
<img
|
||||||
<p-rating [ngModel]="book?.metadata!.hardcoverRating" readonly stars="5"
|
src="https://assets.hardcover.app/static/favicon.ico"
|
||||||
[style.--p-rating-icon-active-color]="getStarColorScaled(book?.metadata!.hardcoverRating)">
|
alt="Hardcover"
|
||||||
</p-rating>
|
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"
|
||||||
<p class="font-semibold">({{ book?.metadata!.hardcoverReviewCount | number:'1.0-0' }})</p>
|
/>
|
||||||
@if ((book?.metadata!.amazonRating || book?.metadata!.goodreadsRating || book?.metadata!.hardcoverRating) && book?.metadata!.googleId) {
|
<span class="font-semibold">
|
||||||
<span>|</span>
|
{{ getRatingPercent(book.metadata!.hardcoverRating) }}%
|
||||||
}
|
</span>
|
||||||
}
|
</a>
|
||||||
@if (book?.metadata!.googleId) {
|
}
|
||||||
<a class="flex items-center gap-1" [href]="'https://books.google.com/books?id=' + book?.metadata!.googleId" target="_blank" rel="noopener noreferrer">
|
|
||||||
<img src="https://books.google.com/favicon.ico" alt="Google Books"
|
@if (book?.metadata?.googleId) {
|
||||||
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"/>
|
<a
|
||||||
</a>
|
class="flex items-center gap-1"
|
||||||
}
|
[href]="'https://books.google.com/books?id=' + book.metadata!.googleId"
|
||||||
|
target="_blank"
|
||||||
|
rel="noopener noreferrer"
|
||||||
|
>
|
||||||
|
<img
|
||||||
|
src="https://books.google.com/favicon.ico"
|
||||||
|
alt="Google Books"
|
||||||
|
class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="overflow-x-auto pt-4 scrollbar-hide max-w-full w-full">
|
</div>
|
||||||
|
|
||||||
|
@if (book?.metadata?.categories?.length) {
|
||||||
|
<div class="overflow-x-auto scrollbar-hide max-w-7xl pt-2 md:pt-0">
|
||||||
<div class="flex gap-2 w-max max-w-[1150px]">
|
<div class="flex gap-2 w-max max-w-[1150px]">
|
||||||
@for (category of book?.metadata!.categories; track category) {
|
@for (category of book.metadata!.categories; track category) {
|
||||||
<a (click)="goToCategory(category)" class="shrink-0 no-underline cursor-pointer">
|
<a (click)="goToCategory(category)" class="shrink-0 no-underline cursor-pointer">
|
||||||
<p-tag [value]="category"></p-tag>
|
<p-tag [value]="category"></p-tag>
|
||||||
</a>
|
</a>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="grid gap-x-20 gap-y-2 pt-6" style="grid-template-columns: repeat(5, max-content);">
|
}
|
||||||
<div>
|
|
||||||
<p class="whitespace-nowrap flex items-center gap-2">
|
<div class="grid md:grid-cols-3 gap-y-2.5 text-sm pt-2 md:pt-4 text-gray-700 dark:text-gray-300 max-w-5xl">
|
||||||
<span class="font-bold">Read Status:</span>
|
<p class="whitespace-nowrap max-w-[250px] overflow-hidden text-ellipsis">
|
||||||
<p-tag
|
<span class="font-bold">Publisher: </span>
|
||||||
class="cursor-pointer text-white"
|
@if (book?.metadata?.publisher) {
|
||||||
[severity]="getStatusSeverity(selectedReadStatus)"
|
<span class="underline hover:opacity-80 cursor-pointer" (click)="goToPublisher(book?.metadata?.publisher!)">
|
||||||
(click)="menu.toggle($event)">
|
|
||||||
{{ getStatusLabel(selectedReadStatus) }}
|
|
||||||
</p-tag>
|
|
||||||
<p-menu #menu [popup]="true" [model]="readStatusMenuItems"></p-menu>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<p class="whitespace-nowrap max-w-[250px] overflow-hidden text-ellipsis">
|
|
||||||
<span class="font-bold">Publisher: </span>
|
|
||||||
@if (book?.metadata?.publisher) {
|
|
||||||
<span class="underline hover:opacity-80 cursor-pointer" (click)="goToPublisher(book?.metadata?.publisher!)">
|
|
||||||
{{ book?.metadata?.publisher }}
|
{{ book?.metadata?.publisher }}
|
||||||
</span>
|
</span>
|
||||||
} @else {
|
} @else {
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
}
|
}
|
||||||
</p>
|
</p>
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">Published:</span> {{ book?.metadata!.publishedDate || '-' }}</p>
|
<p><strong>Published:</strong> {{ book?.metadata!.publishedDate || '-' }}</p>
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">Language:</span> {{ book?.metadata!.language || '-' }}</p>
|
<p><strong>Language:</strong> {{ book?.metadata!.language || '-' }}</p>
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">ISBN 10:</span> {{ book?.metadata!.isbn10 || '-' }}</p>
|
<p class="whitespace-nowrap flex items-center gap-2">
|
||||||
|
<span class="font-bold">File Type:</span>
|
||||||
<p class="whitespace-nowrap flex items-center gap-2">
|
<span
|
||||||
<span class="font-bold">File Type:</span>
|
class="inline-block px-2 py-0.5 rounded-lg text-xs font-bold text-gray-200"
|
||||||
<span
|
[ngClass]="getFileTypeColorClass(getFileExtension(book?.filePath))">
|
||||||
class="inline-block px-2 py-0.5 rounded-lg text-xs font-bold text-gray-200"
|
|
||||||
[ngClass]="getFileTypeColorClass(getFileExtension(book?.filePath))">
|
|
||||||
{{ getFileExtension(book?.filePath) || '-' }}
|
{{ getFileExtension(book?.filePath) || '-' }}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="whitespace-nowrap flex items-center">
|
<p><strong>File Size:</strong> {{ getFileSizeInMB(book) }}</p>
|
||||||
<span class="font-bold mr-2">Progress:</span>
|
<p>
|
||||||
<span class="inline-flex items-center">
|
<strong>ISBN:</strong>
|
||||||
|
@if (book?.metadata?.isbn13 || book?.metadata?.isbn10) {
|
||||||
|
{{ book.metadata!.isbn13 }}
|
||||||
|
@if (book?.metadata?.isbn13 && book?.metadata?.isbn10) {
|
||||||
|
/
|
||||||
|
}
|
||||||
|
{{ book.metadata!.isbn10 }}
|
||||||
|
} @else {
|
||||||
|
<span>-</span>
|
||||||
|
}
|
||||||
|
</p>
|
||||||
|
<p class="whitespace-nowrap flex items-center gap-2">
|
||||||
|
<span class="font-bold">Read Status:</span>
|
||||||
|
<span
|
||||||
|
class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white cursor-pointer"
|
||||||
|
[ngClass]="getStatusSeverityClass(selectedReadStatus)"
|
||||||
|
(click)="menu.toggle($event)">
|
||||||
|
{{ getStatusLabel(selectedReadStatus) }}
|
||||||
|
</span>
|
||||||
|
<p-menu #menu [popup]="true" [model]="readStatusMenuItems"></p-menu>
|
||||||
|
</p>
|
||||||
|
<p class="whitespace-nowrap flex items-center">
|
||||||
|
<span class="font-bold mr-2">Progress:</span>
|
||||||
|
<span class="inline-flex items-center">
|
||||||
<span
|
<span
|
||||||
class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white"
|
class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white"
|
||||||
[ngClass]="getProgressColorClass(getProgressPercent(book))">
|
[ngClass]="getProgressColorClass(getProgressPercent(book))">
|
||||||
{{ getProgressPercent(book) !== null ? getProgressPercent(book) + '%' : 'N/A' }}
|
{{ getProgressPercent(book) !== null ? getProgressPercent(book) + '%' : 'N/A' }}
|
||||||
</span>
|
</span>
|
||||||
@if (getProgressPercent(book) !== null) {
|
@if (getProgressPercent(book) !== null) {
|
||||||
<p-button
|
<p-button
|
||||||
pTooltip="Reset progress"
|
pTooltip="Reset progress"
|
||||||
tooltipPosition="bottom"
|
tooltipPosition="bottom"
|
||||||
icon="pi pi-refresh"
|
icon="pi pi-refresh"
|
||||||
size="small"
|
size="small"
|
||||||
severity="danger"
|
severity="danger"
|
||||||
text
|
text
|
||||||
class="ml-1"
|
class="ml-1 custom-button-padding"
|
||||||
(onClick)="resetProgress(book)">
|
(onClick)="resetProgress(book)">
|
||||||
</p-button>
|
</p-button>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
</p>
|
</p>
|
||||||
<p class="whitespace-nowrap flex items-center gap-2">
|
<p class="whitespace-nowrap flex items-center gap-2">
|
||||||
<span class="font-bold">Metadata Score:</span>
|
<span class="font-bold">Metadata Match:</span>
|
||||||
@if (book?.metadataMatchScore != null) {
|
@if (book?.metadataMatchScore != null) {
|
||||||
<span
|
<span
|
||||||
class="inline-block px-2 py-0.5 rounded-lg text-xs font-bold text-gray-200 border"
|
class="inline-block px-2 py-0.5 rounded-lg text-xs font-bold text-gray-200 border"
|
||||||
[ngClass]="getMatchScoreColorClass(book?.metadataMatchScore!)">
|
[ngClass]="getMatchScoreColorClass(book?.metadataMatchScore!)">
|
||||||
{{ (book?.metadataMatchScore! * 100) | number:'1.0-0' }}%
|
{{ (book?.metadataMatchScore! * 100) | number:'1.0-0' }}%
|
||||||
</span>
|
</span>
|
||||||
} @else {
|
} @else {
|
||||||
<span>-</span>
|
<span>-</span>
|
||||||
}
|
|
||||||
</p>
|
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">File Size:</span> {{ getFileSizeInMB(book) }}</p>
|
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">ISBN 13:</span> {{ book?.metadata!.isbn13 || '-' }}</p>
|
|
||||||
</div>
|
|
||||||
<div class="pt-2 flex items-center gap-2">
|
|
||||||
<span class="font-semibold flex-shrink-0">File Path:</span>
|
|
||||||
<p-toggleButton
|
|
||||||
[(ngModel)]="showFilePath"
|
|
||||||
onIcon="pi pi-eye-slash"
|
|
||||||
offIcon="pi pi-eye"
|
|
||||||
onLabel=""
|
|
||||||
offLabel=""
|
|
||||||
size="small"
|
|
||||||
class="flex-shrink-0 my-visibility-toggle"></p-toggleButton>
|
|
||||||
@if (showFilePath) {
|
|
||||||
<div
|
|
||||||
class="flex items-center gap-4 flex-grow"
|
|
||||||
style="min-width: 0;">
|
|
||||||
<p
|
|
||||||
class="font-mono text-sm text-gray-400 whitespace-nowrap flex-grow"
|
|
||||||
style="min-width: 0;">
|
|
||||||
{{ book?.filePath }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
</div>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
@if (userService.userState$ | async; as userData) {
|
|
||||||
<div class="pl-6 pt-4 flex flex-row w-full gap-4">
|
<div class="flex items-center gap-2">
|
||||||
@if (book!.bookType === 'PDF') {
|
<span class="font-semibold text-sm">File Path:</span>
|
||||||
@if (readMenuItems$ | async; as readItems) {
|
<i
|
||||||
<p-splitbutton
|
class="pi cursor-pointer text-sm"
|
||||||
label="Read"
|
[ngClass]="showFilePath ? 'pi-eye-slash' : 'pi-eye'"
|
||||||
icon="pi pi-book"
|
(click)="showFilePath = !showFilePath"
|
||||||
[model]="readItems"
|
></i>
|
||||||
(onClick)="read(book.id, 'ngx')"
|
@if (showFilePath) {
|
||||||
severity="info"/>
|
<code class="text-xs font-mono truncate text-gray-300">{{ book?.filePath }}</code>
|
||||||
}
|
}
|
||||||
}
|
</div>
|
||||||
@if (book!.bookType !== 'PDF') {
|
</div>
|
||||||
<p-button
|
|
||||||
|
@if (userService.userState$ | async; as userData) {
|
||||||
|
<div class="flex flex-wrap gap-3 pt-6">
|
||||||
|
@if (book!.bookType === 'PDF') {
|
||||||
|
@if (readMenuItems$ | async; as readItems) {
|
||||||
|
<p-splitbutton
|
||||||
label="Read"
|
label="Read"
|
||||||
icon="pi pi-book"
|
icon="pi pi-book"
|
||||||
(onClick)="read(book?.metadata!.bookId, undefined)"
|
[model]="readItems"
|
||||||
severity="info"/>
|
(onClick)="read(book.id, 'ngx')"
|
||||||
|
severity="primary"/>
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@if (book!.bookType !== 'PDF') {
|
||||||
<p-button
|
<p-button
|
||||||
label="Shelf"
|
label="Read"
|
||||||
icon="pi pi-folder"
|
icon="pi pi-book"
|
||||||
severity="info"
|
(onClick)="read(book?.metadata!.bookId, undefined)"
|
||||||
|
severity="primary"/>
|
||||||
|
}
|
||||||
|
<p-button
|
||||||
|
label="Shelf"
|
||||||
|
icon="pi pi-folder"
|
||||||
|
severity="secondary"
|
||||||
|
outlined
|
||||||
|
(onClick)="assignShelf(book.id)">
|
||||||
|
</p-button>
|
||||||
|
@if (userData.permissions.canDownload || userData.permissions.admin) {
|
||||||
|
<p-button
|
||||||
|
label="Download"
|
||||||
|
icon="pi pi-download"
|
||||||
|
severity="success"
|
||||||
outlined
|
outlined
|
||||||
(onClick)="assignShelf(book.id)">
|
(onClick)="download(book.id)">
|
||||||
</p-button>
|
</p-button>
|
||||||
@if (userData.permissions.canDownload || userData.permissions.admin) {
|
}
|
||||||
<p-button
|
@if (userData.permissions.canEmailBook || userData.permissions.admin) {
|
||||||
label="Download"
|
@if (emailMenuItems$ | async; as emailItems) {
|
||||||
icon="pi pi-download"
|
<p-splitbutton
|
||||||
severity="info"
|
label="Quick Send"
|
||||||
|
icon="pi pi-send"
|
||||||
|
[model]="emailItems"
|
||||||
|
(onClick)="quickSend(book.id)"
|
||||||
outlined
|
outlined
|
||||||
(onClick)="download(book.id)">
|
severity="info">
|
||||||
</p-button>
|
</p-splitbutton>
|
||||||
}
|
}
|
||||||
@if (userData.permissions.canEmailBook || userData.permissions.admin) {
|
}
|
||||||
@if (emailMenuItems$ | async; as emailItems) {
|
@if (userData.permissions.canEditMetadata || userData.permissions.admin) {
|
||||||
<p-splitbutton
|
@if (refreshMenuItems$ | async; as refreshItems) {
|
||||||
label="Quick Send"
|
<p-splitbutton
|
||||||
icon="pi pi-send"
|
[label]="isAutoFetching ? 'Fetching...' : 'Auto Fetch'"
|
||||||
[model]="emailItems"
|
[icon]="isAutoFetching ? 'pi pi-spin pi-spinner' : 'pi pi-bolt'"
|
||||||
(onClick)="quickSend(book.id)"
|
[outlined]="true"
|
||||||
outlined
|
[model]="refreshItems"
|
||||||
severity="info">
|
severity="warn"
|
||||||
</p-splitbutton>
|
(onClick)="quickRefresh(book.id)"
|
||||||
}
|
[disabled]="isAutoFetching"
|
||||||
|
pTooltip="Automatically fetch metadata using default sources"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-splitbutton>
|
||||||
}
|
}
|
||||||
@if (userData.permissions.canEditMetadata || userData.permissions.admin) {
|
}
|
||||||
@if (refreshMenuItems$ | async; as refreshItems) {
|
@if (userData.permissions.canDeleteBook || userData.permissions.admin) {
|
||||||
<p-splitbutton
|
@if (otherItems$ | async; as otherItems) {
|
||||||
[label]="isAutoFetching ? 'Fetching...' : 'Auto Fetch'"
|
<p-button icon="pi pi-ellipsis-v" outlined severity="danger" (click)="entitymenu.toggle($event)"></p-button>
|
||||||
[icon]="isAutoFetching ? 'pi pi-spin pi-spinner' : 'pi pi-bolt'"
|
<p-menu #entitymenu [model]="otherItems" [popup]="true" appendTo="body"></p-menu>
|
||||||
[outlined]="true"
|
|
||||||
[model]="refreshItems"
|
|
||||||
severity="info"
|
|
||||||
(onClick)="quickRefresh(book.id)"
|
|
||||||
[disabled]="isAutoFetching"
|
|
||||||
pTooltip="Automatically fetch metadata using default sources"
|
|
||||||
tooltipPosition="top">
|
|
||||||
</p-splitbutton>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@if (userData.permissions.canDeleteBook || userData.permissions.admin) {
|
}
|
||||||
@if (otherItems$ | async; as otherItems) {
|
</div>
|
||||||
<p-button icon="pi pi-ellipsis-v" outlined severity="info" (click)="entitymenu.toggle($event)"></p-button>
|
}
|
||||||
<p-menu #entitymenu [model]="otherItems" [popup]="true" appendTo="body"></p-menu>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p-divider></p-divider>
|
<div class="px-4 pb-2 pt-4 border border-[var(--border-color)] rounded-xl">
|
||||||
|
|
||||||
<div class="flex-1 space-y-2 px-2 min-w-[40rem]">
|
|
||||||
<div [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }" class="transition-all duration-300 overflow-hidden description-container">
|
<div [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }" class="transition-all duration-300 overflow-hidden description-container">
|
||||||
<div class="readonly-editor px-2">
|
<div class="readonly-editor px-2">
|
||||||
<p-editor #quillEditor [readonly]="true" [style]="{height: '250px'}" [(ngModel)]="book.metadata!.description">
|
<p-editor #quillEditor [readonly]="true" [style]="{height: '225px'}" [(ngModel)]="book.metadata!.description">
|
||||||
<ng-template #header>
|
<ng-template #header>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-editor>
|
</p-editor>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@if (book.metadata!.description && book.metadata!.description.length > 100) {
|
@if (book.metadata!.description && book.metadata!.description.length > 500) {
|
||||||
<div class="text-left">
|
<p-button
|
||||||
<button pButton
|
[label]="isExpanded ? 'Show less' : 'Show more'"
|
||||||
type="button"
|
[icon]="isExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'"
|
||||||
[label]="isExpanded ? 'Show less' : 'Show more'"
|
iconPos="right"
|
||||||
[icon]="isExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'"
|
size="small"
|
||||||
iconPos="right"
|
text
|
||||||
class="p-button-text p-button-sm"
|
(click)="toggleExpand()">
|
||||||
(click)="toggleExpand()">
|
</p-button>
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
}
|
}
|
||||||
<p-divider></p-divider>
|
</div>
|
||||||
|
|
||||||
|
<div class="pt-4 space-y-4 pb-6">
|
||||||
@if (bookInSeries.length > 0) {
|
@if (bookInSeries.length > 0) {
|
||||||
<div>
|
<div>
|
||||||
<h3 class="text-xl font-semibold pt-2">More in the Series</h3>
|
<h3 class="text-xl font-semibold pt-2">More in the Series</h3>
|
||||||
|
|||||||
+8
@@ -84,3 +84,11 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
::ng-deep .custom-button-padding .p-button {
|
||||||
|
padding-block: 0rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
::ng-deep .custom-tag-padding {
|
||||||
|
padding: 0.1rem !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
+53
-13
@@ -1,12 +1,12 @@
|
|||||||
import {Component, DestroyRef, inject, Input, OnChanges, OnInit, Optional, SimpleChanges, ViewChild} from '@angular/core';
|
import {Component, DestroyRef, inject, Input, OnChanges, OnInit, Optional, SimpleChanges, ViewChild} from '@angular/core';
|
||||||
import {Button, ButtonDirective} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {AsyncPipe, DecimalPipe, NgClass} from '@angular/common';
|
import {AsyncPipe, DecimalPipe, NgClass} from '@angular/common';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {BookService} from '../../../service/book.service';
|
import {BookService} from '../../../service/book.service';
|
||||||
import {Rating, RatingRateEvent} from 'primeng/rating';
|
import {Rating, RatingRateEvent} from 'primeng/rating';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {Tag} from 'primeng/tag';
|
import {Tag} from 'primeng/tag';
|
||||||
import {Book, BookMetadata, BookRecommendation, MetadataClearFlags, MetadataUpdateWrapper, ReadStatus} from '../../../model/book.model';
|
import {Book, BookMetadata, BookRecommendation, ReadStatus} from '../../../model/book.model';
|
||||||
import {Divider} from 'primeng/divider';
|
import {Divider} from 'primeng/divider';
|
||||||
import {UrlHelperService} from '../../../../utilities/service/url-helper.service';
|
import {UrlHelperService} from '../../../../utilities/service/url-helper.service';
|
||||||
import {UserService} from '../../../../settings/user-management/user.service';
|
import {UserService} from '../../../../settings/user-management/user.service';
|
||||||
@@ -20,7 +20,6 @@ import {Tooltip} from 'primeng/tooltip';
|
|||||||
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
import {takeUntilDestroyed} from '@angular/core/rxjs-interop';
|
||||||
import {Editor} from 'primeng/editor';
|
import {Editor} from 'primeng/editor';
|
||||||
import {ProgressBar} from 'primeng/progressbar';
|
import {ProgressBar} from 'primeng/progressbar';
|
||||||
import {ToggleButton} from 'primeng/togglebutton';
|
|
||||||
import {MetadataFetchOptionsComponent} from '../../metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component';
|
import {MetadataFetchOptionsComponent} from '../../metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component';
|
||||||
import {MetadataRefreshType} from '../../model/request/metadata-refresh-type.enum';
|
import {MetadataRefreshType} from '../../model/request/metadata-refresh-type.enum';
|
||||||
import {MetadataRefreshRequest} from '../../model/request/metadata-refresh-request.model';
|
import {MetadataRefreshRequest} from '../../model/request/metadata-refresh-request.model';
|
||||||
@@ -35,7 +34,7 @@ import {BookCardLiteComponent} from '../../../components/book-card-lite/book-car
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
templateUrl: './metadata-viewer.component.html',
|
templateUrl: './metadata-viewer.component.html',
|
||||||
styleUrl: './metadata-viewer.component.scss',
|
styleUrl: './metadata-viewer.component.scss',
|
||||||
imports: [Button, AsyncPipe, Rating, FormsModule, Tag, Divider, SplitButton, NgClass, Tooltip, DecimalPipe, ButtonDirective, Editor, ProgressBar, ToggleButton, Menu, InfiniteScrollDirective, BookCardLiteComponent]
|
imports: [Button, AsyncPipe, Rating, FormsModule, Tag, Divider, SplitButton, NgClass, Tooltip, DecimalPipe, Editor, ProgressBar, Menu, InfiniteScrollDirective, BookCardLiteComponent]
|
||||||
})
|
})
|
||||||
export class MetadataViewerComponent implements OnInit, OnChanges {
|
export class MetadataViewerComponent implements OnInit, OnChanges {
|
||||||
|
|
||||||
@@ -341,6 +340,30 @@ export class MetadataViewerComponent implements OnInit, OnChanges {
|
|||||||
return 'bg-red-600 border-red-700';
|
return 'bg-red-600 border-red-700';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getStatusSeverityClass(status: string): string {
|
||||||
|
const normalized = status?.toUpperCase();
|
||||||
|
switch (normalized) {
|
||||||
|
case 'UNREAD':
|
||||||
|
return 'bg-gray-500';
|
||||||
|
case 'PAUSED':
|
||||||
|
return 'bg-zinc-600';
|
||||||
|
case 'READING':
|
||||||
|
return 'bg-blue-600';
|
||||||
|
case 'RE_READING':
|
||||||
|
return 'bg-indigo-600';
|
||||||
|
case 'READ':
|
||||||
|
return 'bg-green-600';
|
||||||
|
case 'PARTIALLY_READ':
|
||||||
|
return 'bg-yellow-600';
|
||||||
|
case 'ABANDONED':
|
||||||
|
return 'bg-red-600';
|
||||||
|
case 'WONT_READ':
|
||||||
|
return 'bg-pink-700';
|
||||||
|
default:
|
||||||
|
return 'bg-gray-600';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getProgressColorClass(progress: number | null | undefined): string {
|
getProgressColorClass(progress: number | null | undefined): string {
|
||||||
if (progress == null) return 'bg-gray-600';
|
if (progress == null) return 'bg-gray-600';
|
||||||
return 'bg-blue-500';
|
return 'bg-blue-500';
|
||||||
@@ -410,14 +433,31 @@ export class MetadataViewerComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getStatusSeverity(status: string): 'success' | 'secondary' | 'info' | 'warn' | 'danger' | undefined {
|
getRatingTooltip(book: Book, source: 'amazon' | 'goodreads' | 'hardcover'): string {
|
||||||
const normalized = status?.toUpperCase();
|
const meta = book?.metadata;
|
||||||
if (['UNREAD', 'PAUSED'].includes(normalized)) return 'secondary';
|
if (!meta) return '';
|
||||||
if (['READING', 'RE_READING'].includes(normalized)) return 'info';
|
|
||||||
if (['READ'].includes(normalized)) return 'success';
|
switch (source) {
|
||||||
if (['PARTIALLY_READ'].includes(normalized)) return 'warn';
|
case 'amazon':
|
||||||
if (['WONT_READ', 'ABANDONED'].includes(normalized)) return 'danger';
|
return meta.amazonRating != null
|
||||||
return undefined;
|
? `★ ${meta.amazonRating} | ${meta.amazonReviewCount?.toLocaleString() ?? '0'} reviews`
|
||||||
|
: '';
|
||||||
|
case 'goodreads':
|
||||||
|
return meta.goodreadsRating != null
|
||||||
|
? `★ ${meta.goodreadsRating} | ${meta.goodreadsReviewCount?.toLocaleString() ?? '0'} reviews`
|
||||||
|
: '';
|
||||||
|
case 'hardcover':
|
||||||
|
return meta.hardcoverRating != null
|
||||||
|
? `★ ${meta.hardcoverRating} | ${meta.hardcoverReviewCount?.toLocaleString() ?? '0'} reviews`
|
||||||
|
: '';
|
||||||
|
default:
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getRatingPercent(rating: number | null | undefined): number {
|
||||||
|
if (rating == null) return 0;
|
||||||
|
return Math.round((rating / 5) * 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
readStatusMenuItems = this.readStatusOptions.map(option => ({
|
readStatusMenuItems = this.readStatusOptions.map(option => ({
|
||||||
@@ -426,7 +466,7 @@ export class MetadataViewerComponent implements OnInit, OnChanges {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
getStatusLabel(value: string): string {
|
getStatusLabel(value: string): string {
|
||||||
return this.readStatusOptions.find(o => o.value === value)?.label ?? 'Unknown';
|
return this.readStatusOptions.find(o => o.value === value)?.label.toUpperCase() ?? 'N/A';
|
||||||
}
|
}
|
||||||
|
|
||||||
updateReadStatus(status: ReadStatus): void {
|
updateReadStatus(status: ReadStatus): void {
|
||||||
|
|||||||
Reference in New Issue
Block a user