Refactored to use Getter

This commit is contained in:
Joseph Milazzo 2021-10-04 17:22:57 -05:00
parent 27a7f19446
commit 0c42714ab7

View file

@ -1,6 +1,6 @@
<div *ngIf="data !== undefined"> <div *ngIf="data !== undefined">
<div class="modal-header"> <div class="modal-header">
<h4 *ngIf="libraryType != 1; else comicHeader" class="modal-title" id="modal-basic-title"> <h4 *ngIf="libraryType !== LibraryType.Comic else comicHeader" class="modal-title" id="modal-basic-title">
{{parentName}} - {{data.number != 0 ? (isChapter ? 'Chapter ' : 'Volume ') + data.number : 'Special'}} Details</h4> {{parentName}} - {{data.number != 0 ? (isChapter ? 'Chapter ' : 'Volume ') + data.number : 'Special'}} Details</h4>
<ng-template #comicHeader><h4 class="modal-title" id="modal-basic-title"> <ng-template #comicHeader><h4 class="modal-title" id="modal-basic-title">
{{parentName}} - {{data.number != 0 ? (isChapter ? 'Issue #' : 'Volume ') + data.number : 'Special'}} Details</h4></ng-template> {{parentName}} - {{data.number != 0 ? (isChapter ? 'Issue #' : 'Volume ') + data.number : 'Special'}} Details</h4></ng-template>
@ -30,13 +30,13 @@
</ng-container> </ng-container>
<h4 *ngIf="!utilityService.isChapter(data)"> <h4 *ngIf="!utilityService.isChapter(data)">
<span *ngIf="libraryType != 1; else comicName">Chapters</span> <span *ngIf="libraryType !== LibraryType.Comic; else comicName">Chapters</span>
<ng-template #comicName><span>Issues</span> <ng-template #comicName><span>Issues</span>
</ng-template> </ng-template>
</h4> </h4>
<ul class="list-unstyled"> <ul class="list-unstyled">
<li class="media my-4" *ngFor="let chapter of chapters"> <li class="media my-4" *ngFor="let chapter of chapters">
<a (click)="readChapter(chapter)" href="javascript:void(0);" *ngIf="libraryType != 1; else comicLink" title="Read Chapter {{chapter.number}}"> <a (click)="readChapter(chapter)" href="javascript:void(0);" *ngIf="libraryType !== LibraryType.Comic; else comicLink" title="Read Chapter {{chapter.number}}">
<img class="mr-3" style="width: 74px" [src]="chapter.coverImage"> <img class="mr-3" style="width: 74px" [src]="chapter.coverImage">
</a> </a>
<ng-template #comicLink> <ng-template #comicLink>
@ -47,7 +47,7 @@
<div class="media-body"> <div class="media-body">
<h5 class="mt-0 mb-1"> <h5 class="mt-0 mb-1">
<span *ngIf="chapter.number !== '0'; else specialHeader"> <span *ngIf="chapter.number !== '0'; else specialHeader">
<span *ngIf="libraryType != 1; else comicAction" class=""> <span *ngIf="libraryType !== LibraryType.Comic; else comicAction" class="">
<app-card-actionables (actionHandler)="performAction($event, chapter)" [actions]="chapterActions" [labelBy]="'Chapter' + formatChapterNumber(chapter)"></app-card-actionables>&nbsp; <app-card-actionables (actionHandler)="performAction($event, chapter)" [actions]="chapterActions" [labelBy]="'Chapter' + formatChapterNumber(chapter)"></app-card-actionables>&nbsp;
Chapter {{formatChapterNumber(chapter)}} Chapter {{formatChapterNumber(chapter)}}
</span> </span>