Fix: Add missing kobo progress bar and stats (#1942)
* fix: added missing kobo progress bar from book card * fix: added kobo progress bar to metadata viewer * fix: consider kobo progress in stats
This commit is contained in:
+30
-19
@@ -49,25 +49,36 @@
|
||||
(onChange)="toggleSelection($event)">
|
||||
</p-checkbox>
|
||||
}
|
||||
|
||||
@if (progressPercentage !== null) {
|
||||
<p-progressBar
|
||||
[value]="progressPercentage"
|
||||
[showValue]="false"
|
||||
class="cover-progress-bar"
|
||||
[ngClass]="{ 'progress-complete': progressPercentage === 100, 'progress-incomplete': progressPercentage < 100 }">
|
||||
</p-progressBar>
|
||||
}
|
||||
@if (koProgressPercentage !== null) {
|
||||
<p-progressBar
|
||||
[value]="koProgressPercentage"
|
||||
[showValue]="false"
|
||||
[ngClass]="[
|
||||
progressPercentage == null ? 'cover-progress-bar-ko-only' : 'cover-progress-bar-ko-both',
|
||||
koProgressPercentage === 100 ? 'progress-complete-ko' : 'progress-incomplete-ko'
|
||||
]">
|
||||
</p-progressBar>
|
||||
}
|
||||
<div class="cover-progress-bar-container">
|
||||
@if (progressPercentage !== null) {
|
||||
<p-progressBar
|
||||
[value]="progressPercentage"
|
||||
[showValue]="false"
|
||||
class="cover-progress-bar"
|
||||
[ngClass]="{ 'progress-complete': progressPercentage === 100, 'progress-incomplete': progressPercentage < 100 }">
|
||||
</p-progressBar>
|
||||
}
|
||||
@if (koProgressPercentage !== null) {
|
||||
<p-progressBar
|
||||
[value]="koProgressPercentage"
|
||||
[showValue]="false"
|
||||
class="cover-progress-bar"
|
||||
[ngClass]="[
|
||||
koProgressPercentage === 100 ? 'progress-complete-ko' : 'progress-incomplete-ko'
|
||||
]">
|
||||
</p-progressBar>
|
||||
}
|
||||
@if (koboProgressPercentage !== null) {
|
||||
<p-progressBar
|
||||
[value]="koboProgressPercentage"
|
||||
[showValue]="false"
|
||||
class="cover-progress-bar"
|
||||
[ngClass]="[
|
||||
koboProgressPercentage === 100 ? 'progress-complete-kobo' : 'progress-incomplete-kobo'
|
||||
]">
|
||||
</p-progressBar>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div [hidden]="bottomBarHidden">
|
||||
|
||||
+21
-16
@@ -123,10 +123,19 @@
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
.cover-progress-bar,
|
||||
.cover-progress-bar-ko-both,
|
||||
.cover-progress-bar-ko-only {
|
||||
.cover-progress-bar-container {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 7.5px;
|
||||
z-index: 2;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.cover-progress-bar {
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 2.5px;
|
||||
@@ -134,18 +143,6 @@
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.cover-progress-bar {
|
||||
bottom: 2.5px;
|
||||
}
|
||||
|
||||
.cover-progress-bar-ko-both {
|
||||
bottom: 0;
|
||||
}
|
||||
|
||||
.cover-progress-bar-ko-only {
|
||||
bottom: 2.5px;
|
||||
}
|
||||
|
||||
.series-number-overlay {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
@@ -231,7 +228,15 @@
|
||||
background-color: #8b5cf6;
|
||||
}
|
||||
|
||||
::ng-deep p-progressbar {
|
||||
::ng-deep .progress-incomplete-kobo .p-progressbar-value {
|
||||
background-color: #bf0000;
|
||||
}
|
||||
|
||||
::ng-deep .progress-complete-kobo .p-progressbar-value {
|
||||
background-color: #f65c9c;
|
||||
}
|
||||
|
||||
::ng-deep .cover-progress-bar {
|
||||
--p-progressbar-border-radius: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -110,6 +110,13 @@ export class BookCardComponent implements OnInit, OnChanges, OnDestroy {
|
||||
return null;
|
||||
}
|
||||
|
||||
get koboProgressPercentage(): number | null {
|
||||
if (this.book.koboProgress?.percentage != null) {
|
||||
return this.book.koboProgress.percentage;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
get displayTitle(): string | undefined {
|
||||
return (this.isSeriesCollapsed && this.book.metadata?.seriesName) ? this.book.metadata?.seriesName : this.book.metadata?.title;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user