diff --git a/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts b/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts index f85d3fa85..1608b9fdd 100644 --- a/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts +++ b/booklore-ui/src/app/book/components/book-browser/book-browser.component.ts @@ -105,9 +105,10 @@ export class BookBrowserComponent implements OnInit, AfterViewInit { {label: 'Locked', icon: '', field: 'locked', command: () => this.sortBooks('locked')}, {label: 'Publisher', icon: '', field: 'publisher', command: () => this.sortBooks('publisher')}, {label: 'Published Date', icon: '', field: 'publishedDate', command: () => this.sortBooks('publishedDate')}, - {label: 'Rating (Legacy)', icon: '', field: 'rating', command: () => this.sortBooks('rating')}, {label: 'Amazon Rating', icon: '', field: 'amazonRating', command: () => this.sortBooks('amazonRating')}, + {label: 'Amazon #', icon: '', field: 'amazonReviewCount', command: () => this.sortBooks('amazonReviewCount')}, {label: 'Goodreads Rating', icon: '', field: 'goodreadsRating', command: () => this.sortBooks('goodreadsRating')}, + {label: 'Goodreads #', icon: '', field: 'goodreadsReviewCount', command: () => this.sortBooks('goodreadsReviewCount')}, {label: 'Pages', icon: '', field: 'pageCount', command: () => this.sortBooks('pageCount')} ]; 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 f20caebca..7bbdf59d7 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 @@ -21,13 +21,18 @@ Title Authors Publisher + Genres Published - Genres - ISBN - Language - Rating + Last Read + Added + Lang Pages - Reviews + Amazon + Amz # + Goodreads + GR # + Rating (L) + Reviews (L) @@ -49,25 +54,59 @@ Book Cover - {{ metadata.title }} - {{ getAuthorNames(metadata.authors) }} - {{ metadata.publisher }} - {{ metadata.publishedDate }} - {{ getGenres(metadata.categories) }} - {{ metadata.isbn10 }} + {{ metadata.title }} + {{ getAuthorNames(metadata.authors) }} + {{ metadata.publisher }} + {{ getGenres(metadata.categories) }} + + {{ metadata.publishedDate ? (metadata.publishedDate | date: 'dd-MMM-yyyy') : '' }} + + + {{ book.lastReadTime ? (book.lastReadTime | date: 'dd-MMM-yyyy') : '' }} + + + {{ book.addedOn ? (book.addedOn | date: 'dd-MMM-yyyy') : '' }} + {{ metadata.language }} - - + {{ metadata.pageCount }} + + + [style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)"> - + ({{ metadata.amazonRating?.toFixed(1) }}) + - {{ metadata.pageCount }} - {{ metadata.reviewCount }} + + {{ metadata.amazonReviewCount ?? '' }} + + + + + + ({{ metadata.goodreadsRating?.toFixed(1) }}) + + + + {{ metadata.goodreadsReviewCount ?? '' }} + + + + + ({{ metadata.rating?.toFixed(1) }}) + + {{ metadata.reviewCount }} diff --git a/booklore-ui/src/app/book/components/book-browser/book-table/book-table.component.ts b/booklore-ui/src/app/book/components/book-browser/book-table/book-table.component.ts index b3e2c12aa..ace7eecae 100644 --- a/booklore-ui/src/app/book/components/book-browser/book-table/book-table.component.ts +++ b/booklore-ui/src/app/book/components/book-browser/book-table/book-table.component.ts @@ -1,6 +1,6 @@ import {Component, EventEmitter, inject, Input, OnChanges, Output} from '@angular/core'; import {TableModule} from 'primeng/table'; -import {NgIf} from '@angular/common'; +import {DatePipe, NgIf} from '@angular/common'; import {Rating} from 'primeng/rating'; import {FormsModule} from '@angular/forms'; import {Book, BookMetadata} from '../../../model/book.model'; @@ -20,7 +20,8 @@ import {Router} from '@angular/router'; NgIf, Rating, FormsModule, - Button + Button, + DatePipe ], styleUrl: './book-table.component.scss' })