+ @if (shouldShowStatusIcon()) {
+
+
+
+ }
+ [pTooltip]="'Title: ' + displayTitle">
{{ displayTitle }}
diff --git a/booklore-ui/src/app/book/components/book-browser/book-card/book-card.component.scss b/booklore-ui/src/app/book/components/book-browser/book-card/book-card.component.scss
index 3250ee074..9062ec1af 100644
--- a/booklore-ui/src/app/book/components/book-browser/book-card/book-card.component.scss
+++ b/booklore-ui/src/app/book/components/book-browser/book-card/book-card.component.scss
@@ -112,6 +112,7 @@
transition: opacity 0.2s ease, visibility 0.2s ease;
z-index: 2;
}
+
.select-checkbox .p-checkbox {
vertical-align: top;
}
@@ -174,6 +175,42 @@
box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
}
+.read-status-indicator {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ font-weight: bold;
+ margin-left: 0.5rem;
+}
+
+.status-read {
+ color: #22c55e;
+}
+
+.status-reading {
+ color: #3b82f6;
+}
+
+.status-re-reading {
+ color: #06b6d4;
+}
+
+.status-partially-read {
+ color: #f59e0b;
+}
+
+.status-paused {
+ color: #eab308;
+}
+
+.status-abandoned {
+ color: #ef4444;
+}
+
+.status-wont-read {
+ color: #ec4899;
+}
+
::ng-deep .progress-incomplete .p-progressbar-value {
background-color: #3b82f6;
}
diff --git a/booklore-ui/src/app/book/components/book-browser/book-card/book-card.component.ts b/booklore-ui/src/app/book/components/book-browser/book-card/book-card.component.ts
index cdb96c0ff..cbe4131a3 100644
--- a/booklore-ui/src/app/book/components/book-browser/book-card/book-card.component.ts
+++ b/booklore-ui/src/app/book/components/book-browser/book-card/book-card.component.ts
@@ -25,6 +25,7 @@ import {BookMetadataCenterComponent} from '../../../../metadata/book-metadata-ce
import {take, takeUntil} from 'rxjs/operators';
import {readStatusLabels} from '../book-filter/book-filter.component';
import {ResetProgressTypes} from '../../../../shared/constants/reset-progress-type';
+import {ReadStatusHelper} from '../../../helpers/read-status.helper';
@Component({
selector: 'app-book-card',
@@ -66,6 +67,7 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
private userPermissions: any;
private metadataCenterViewMode: 'route' | 'dialog' = 'route';
private destroy$ = new Subject
();
+ protected readStatusHelper = inject(ReadStatusHelper);
ngOnInit(): void {
this.userService.userState$
@@ -717,4 +719,20 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
this.destroy$.next();
this.destroy$.complete();
}
+
+ getReadStatusIcon(): string {
+ return this.readStatusHelper.getReadStatusIcon(this.book.readStatus);
+ }
+
+ getReadStatusClass(): string {
+ return this.readStatusHelper.getReadStatusClass(this.book.readStatus);
+ }
+
+ getReadStatusTooltip(): string {
+ return this.readStatusHelper.getReadStatusTooltip(this.book.readStatus);
+ }
+
+ shouldShowStatusIcon(): boolean {
+ return this.readStatusHelper.shouldShowStatusIcon(this.book.readStatus);
+ }
}
diff --git a/booklore-ui/src/app/book/components/book-browser/book-table/book-table.component.html b/booklore-ui/src/app/book/components/book-browser/book-table/book-table.component.html
index 427439dfe..38ca5244c 100644
--- a/booklore-ui/src/app/book/components/book-browser/book-table/book-table.component.html
+++ b/booklore-ui/src/app/book/components/book-browser/book-table/book-table.component.html
@@ -53,7 +53,18 @@
@for (col of visibleColumns; track col.field) {
- @if (col.field === 'amazonRating' || col.field === 'goodreadsRating' || col.field === 'hardcoverRating') {
+ @if (col.field === 'readStatus') {
+
+ @if (shouldShowStatusIcon(book.readStatus)) {
+
+
+
+ }
+ |
+ } @else if (col.field === 'amazonRating' || col.field === 'goodreadsRating' || col.field === 'hardcoverRating') {
();
readonly allColumns = [
+ {field: 'readStatus', header: '📖'},
{field: 'title', header: 'Title'},
{field: 'authors', header: 'Authors'},
{field: 'publisher', header: 'Publisher'},
@@ -189,8 +193,27 @@ export class BookTableComponent implements OnInit, OnDestroy, OnChanges {
return mb >= 1 ? `${mb.toFixed(1)} MB` : `${mb.toFixed(2)} MB`;
}
+ getReadStatusIcon(readStatus: ReadStatus | undefined): string {
+ return this.readStatusHelper.getReadStatusIcon(readStatus);
+ }
+
+ getReadStatusClass(readStatus: ReadStatus | undefined): string {
+ return this.readStatusHelper.getReadStatusClass(readStatus);
+ }
+
+ getReadStatusTooltip(readStatus: ReadStatus | undefined): string {
+ return this.readStatusHelper.getReadStatusTooltip(readStatus);
+ }
+
+ shouldShowStatusIcon(readStatus: ReadStatus | undefined): boolean {
+ return this.readStatusHelper.shouldShowStatusIcon(readStatus);
+ }
+
getCellValue(metadata: BookMetadata, book: Book, field: string): string | number {
switch (field) {
+ case 'readStatus':
+ return this.readStatusHelper.getReadStatusTooltip(book?.readStatus);
+
case 'title':
return metadata.title ?? '';
diff --git a/booklore-ui/src/app/book/components/book-browser/table-column-preference-service.ts b/booklore-ui/src/app/book/components/book-browser/table-column-preference-service.ts
index 291e971b4..dcaf42657 100644
--- a/booklore-ui/src/app/book/components/book-browser/table-column-preference-service.ts
+++ b/booklore-ui/src/app/book/components/book-browser/table-column-preference-service.ts
@@ -14,6 +14,7 @@ export class TableColumnPreferenceService {
readonly preferences$ = this.preferencesSubject.asObservable();
private readonly allAvailableColumns = [
+ {field: 'readStatus', header: 'Read'},
{field: 'title', header: 'Title'},
{field: 'authors', header: 'Authors'},
{field: 'publisher', header: 'Publisher'},
diff --git a/booklore-ui/src/app/book/components/epub-viewer/component/epub-viewer.component.html b/booklore-ui/src/app/book/components/epub-viewer/component/epub-viewer.component.html
index 7ba5ce6e7..c76c78411 100644
--- a/booklore-ui/src/app/book/components/epub-viewer/component/epub-viewer.component.html
+++ b/booklore-ui/src/app/book/components/epub-viewer/component/epub-viewer.component.html
@@ -10,7 +10,7 @@
|