More Bugfixes (#2874)

This commit is contained in:
Joe Milazzo 2024-04-14 17:37:22 -05:00 committed by GitHub
parent f02e1f7d1f
commit 6d9a5d8f65
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
20 changed files with 303 additions and 108 deletions

View file

@ -2,12 +2,14 @@
<div class="d-flex flex-row g-0 mb-2 reading-list-item">
<div class="pe-2">
<app-image width="106px" maxHeight="125px" class="img-top me-3" [imageUrl]="imageService.getChapterCoverImage(item.chapterId)"></app-image>
<ng-container *ngIf="item.pagesRead === 0 && item.pagesTotal > 0">
@if (item.pagesRead === 0 && item.pagesTotal > 0) {
<div class="not-read-badge" ></div>
</ng-container>
<div class="progress-banner" *ngIf="item.pagesRead < item.pagesTotal && item.pagesTotal > 0 && item.pagesRead !== item.pagesTotal">
<p><ngb-progressbar type="primary" height="5px" [value]="item.pagesRead" [max]="item.pagesTotal"></ngb-progressbar></p>
</div>
}
@if (item.pagesRead < item.pagesTotal && item.pagesTotal > 0 && item.pagesRead !== item.pagesTotal) {
<div class="progress-banner">
<p><ngb-progressbar type="primary" height="5px" [value]="item.pagesRead" [max]="item.pagesTotal"></ngb-progressbar></p>
</div>
}
</div>
<div class="flex-grow-1">
@ -37,9 +39,11 @@
<!-- TODO: Let's add summary here-->
<div class="ps-1 mt-2" *ngIf="item.releaseDate !== '0001-01-01T00:00:00'">
Released: {{item.releaseDate | date:'longDate'}}
</div>
@if (item.releaseDate !== '0001-01-01T00:00:00') {
<div class="ps-1 mt-2">
Released: {{item.releaseDate | date:'longDate'}}
</div>
}
</div>
</div>

View file

@ -1,4 +1,4 @@
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core';
import {ChangeDetectionStrategy, Component, EventEmitter, inject, Input, Output} from '@angular/core';
import { LibraryType } from 'src/app/_models/library/library';
import { MangaFormat } from 'src/app/_models/manga-format';
import { ReadingListItem } from 'src/app/_models/reading-list';
@ -6,7 +6,7 @@ import { ImageService } from 'src/app/_services/image.service';
import { MangaFormatIconPipe } from '../../../_pipes/manga-format-icon.pipe';
import { MangaFormatPipe } from '../../../_pipes/manga-format.pipe';
import { NgbProgressbar } from '@ng-bootstrap/ng-bootstrap';
import { NgIf, DatePipe } from '@angular/common';
import { DatePipe } from '@angular/common';
import { ImageComponent } from '../../../shared/image/image.component';
import {TranslocoDirective} from "@ngneat/transloco";
import {SeriesFormatComponent} from "../../../shared/series-format/series-format.component";
@ -17,10 +17,13 @@ import {SeriesFormatComponent} from "../../../shared/series-format/series-format
styleUrls: ['./reading-list-item.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [ImageComponent, NgIf, NgbProgressbar, DatePipe, MangaFormatPipe, MangaFormatIconPipe, TranslocoDirective, SeriesFormatComponent]
imports: [ImageComponent, NgbProgressbar, DatePipe, MangaFormatPipe, MangaFormatIconPipe, TranslocoDirective, SeriesFormatComponent]
})
export class ReadingListItemComponent {
protected readonly imageService = inject(ImageService);
protected readonly MangaFormat = MangaFormat;
@Input({required: true}) item!: ReadingListItem;
@Input() position: number = 0;
@Input() libraryTypes: {[key: number]: LibraryType} = {};
@ -32,15 +35,7 @@ export class ReadingListItemComponent {
@Output() read: EventEmitter<ReadingListItem> = new EventEmitter();
@Output() remove: EventEmitter<ReadingListItem> = new EventEmitter();
get MangaFormat(): typeof MangaFormat {
return MangaFormat;
}
constructor(public imageService: ImageService) { }
readChapter(item: ReadingListItem) {
this.read.emit(item);
}
}