feat: Series Enhancements (#1086)
* show active comic in the series banner * Hide pi-info button in series banner when book is active * When collapsed series: displays series title instead of book title, substitutes series number overlay by series count * New series page w/ redirections from other pages * Update booklore-ui/src/app/book/components/book-card-lite/book-card-lite-component.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update booklore-ui/src/app/book/components/series-page/series-page.component.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * removed commented unused status * cleaned minor warnings --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -277,15 +277,16 @@
|
||||
<div
|
||||
class="virtual-scroller-item relative"
|
||||
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
||||
<app-book-card
|
||||
[index]="i"
|
||||
[book]="book"
|
||||
[isCheckboxEnabled]="true"
|
||||
[onBookSelect]="handleBookSelect.bind(this)"
|
||||
[isSeriesCollapsed]="seriesCollapseFilter.isSeriesCollapsed"
|
||||
(checkboxClick)="onCheckboxClicked($event)"
|
||||
[isSelected]="selectedBooks.has(book.id)">
|
||||
</app-book-card>
|
||||
<app-book-card
|
||||
[index]="i"
|
||||
[book]="book"
|
||||
[isCheckboxEnabled]="true"
|
||||
[readButtonHidden]="book.seriesCount ? true : false"
|
||||
[onBookSelect]="handleBookSelect.bind(this)"
|
||||
[isSeriesCollapsed]="seriesCollapseFilter.isSeriesCollapsed"
|
||||
(checkboxClick)="onCheckboxClicked($event)"
|
||||
[isSelected]="selectedBooks.has(book.id)">
|
||||
</app-book-card>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
+11
-7
@@ -14,24 +14,28 @@
|
||||
[src]="urlHelper.getThumbnailUrl(book.id, book.metadata?.coverUpdatedOn)"
|
||||
class="book-cover"
|
||||
[class.loaded]="isImageLoaded"
|
||||
alt="Cover of {{ book.metadata?.title }}"
|
||||
alt="Cover of {{ displayTitle }}"
|
||||
loading="lazy"
|
||||
(load)="onImageLoad()"/>
|
||||
</div>
|
||||
|
||||
@if (book.metadata?.seriesNumber != null) {
|
||||
@if (!book.seriesCount && book.metadata?.seriesNumber != null) {
|
||||
<div class="series-number-overlay">
|
||||
#{{ book.metadata?.seriesNumber }}
|
||||
</div>
|
||||
}
|
||||
|
||||
@if (book.seriesCount != null && book.seriesCount! > 1) {
|
||||
<div class="series-count-overlay">
|
||||
@if (book.seriesCount && book.seriesCount! >= 1) {
|
||||
<div class="series-items-count-overlay">
|
||||
{{ book.seriesCount }}
|
||||
</div>
|
||||
}
|
||||
|
||||
<p-button [rounded]="true" icon="pi pi-info" class="info-btn" (click)="openBookInfo(book)"></p-button>
|
||||
@if (book.seriesCount && book.seriesCount! >= 1) {
|
||||
<p-button [rounded]="true" icon="pi pi-info" class="info-btn" (click)="openSeriesInfo()"></p-button>
|
||||
} @else {
|
||||
<p-button [rounded]="true" icon="pi pi-info" class="info-btn" (click)="openBookInfo(book)"></p-button>
|
||||
}
|
||||
|
||||
<p-button [hidden]="readButtonHidden" [rounded]="true" icon="pi pi-book" class="read-btn" (click)="readBook(book)"></p-button>
|
||||
|
||||
@@ -70,8 +74,8 @@
|
||||
<h4 class="book-title m-0 pl-2"
|
||||
tooltipPosition="bottom"
|
||||
tooltipStyleClass="text-xs text-center"
|
||||
[pTooltip]="book.metadata?.title">
|
||||
{{ book.metadata?.title }}
|
||||
[pTooltip]="displayTitle">
|
||||
{{ displayTitle }}
|
||||
</h4>
|
||||
<p-tieredmenu #menu [model]="items" [popup]="true" appendTo="body"></p-tieredmenu>
|
||||
<p-button
|
||||
|
||||
@@ -157,9 +157,9 @@
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.series-count-overlay {
|
||||
.series-items-count-overlay {
|
||||
position: absolute;
|
||||
bottom: 8px;
|
||||
top: 8px;
|
||||
left: 8px;
|
||||
background-color: var(--primary-color);
|
||||
color: var(--primary-text-color-dark);
|
||||
|
||||
@@ -109,6 +109,11 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
|
||||
return null;
|
||||
}
|
||||
|
||||
get displayTitle(): string | undefined {
|
||||
return (this.isSeriesCollapsed && this.book.metadata?.seriesName) ? this.book.metadata?.seriesName : this.book.metadata?.title;
|
||||
// return (this.isSeriesCollapsed && this.book.metadata?.seriesName) ? this.book.metadata.seriesName : this.book.metadata?.title;
|
||||
}
|
||||
|
||||
onImageLoad(): void {
|
||||
this.isImageLoaded = true;
|
||||
}
|
||||
@@ -462,6 +467,15 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
|
||||
});
|
||||
}
|
||||
|
||||
openSeriesInfo(): void {
|
||||
const seriesName = this.book?.metadata?.seriesName;
|
||||
if (this.isSeriesCollapsed && seriesName) {
|
||||
this.router.navigate(['/series', seriesName]);
|
||||
} else {
|
||||
this.openBookInfo(this.book);
|
||||
}
|
||||
}
|
||||
|
||||
openBookInfo(book: Book): void {
|
||||
if (this.metadataCenterViewMode === 'route') {
|
||||
this.router.navigate(['/book', book.id], {
|
||||
|
||||
Reference in New Issue
Block a user