Cleaned up file to use conditional labelling rather than conditional html fragments

This commit is contained in:
Joseph Milazzo 2021-10-04 17:28:48 -05:00
parent 0c42714ab7
commit 0e6fc7eb48

View file

@ -3,7 +3,8 @@
<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>
<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>
<button type="button" class="close" aria-label="Close" (click)="close()">
<span aria-hidden="true">&times;</span>
</button>
@ -29,34 +30,19 @@
</div>
</ng-container>
<h4 *ngIf="!utilityService.isChapter(data)">
<span *ngIf="libraryType !== LibraryType.Comic; else comicName">Chapters</span>
<ng-template #comicName><span>Issues</span>
</ng-template>
</h4>
<h4 *ngIf="!utilityService.isChapter(data)">{{libraryType !== LibraryType.Comic ? 'Chapters' : 'Issues'}}</h4>
<ul class="list-unstyled">
<li class="media my-4" *ngFor="let chapter of chapters">
<a (click)="readChapter(chapter)" href="javascript:void(0);" *ngIf="libraryType !== LibraryType.Comic; else comicLink" title="Read Chapter {{chapter.number}}">
<a (click)="readChapter(chapter)" href="javascript:void(0);" title="Read {{libraryType !== LibraryType.Comic ? 'Chapter ' : 'Issue #'}} {{chapter.number}}">
<img class="mr-3" style="width: 74px" [src]="chapter.coverImage">
</a>
<ng-template #comicLink>
<a (click)="readChapter(chapter)" href="javascript:void(0);" title="Read Issue #{{chapter.number}}">
<img class="mr-3" style="width: 74px" [src]="chapter.coverImage">
</a>
</ng-template>
<div class="media-body">
<h5 class="mt-0 mb-1">
<span *ngIf="chapter.number !== '0'; else specialHeader">
<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;
Chapter {{formatChapterNumber(chapter)}}
<span >
<app-card-actionables (actionHandler)="performAction($event, chapter)" [actions]="chapterActions" [labelBy]="libraryType !== LibraryType.Comic ? 'Chapter ' : 'Issue #' + formatChapterNumber(chapter)"></app-card-actionables>&nbsp;
{{libraryType !== LibraryType.Comic ? 'Chapter' : 'Issue #' }} {{formatChapterNumber(chapter)}}
</span>
<ng-template #comicAction>
<span class="">
<app-card-actionables (actionHandler)="performAction($event, chapter)" [actions]="chapterActions" [labelBy]="'Chapter' + formatChapterNumber(chapter)"></app-card-actionables>&nbsp;
Issue #{{formatChapterNumber(chapter)}}
</span>
</ng-template>
<span class="badge badge-primary badge-pill">
<span *ngIf="chapter.pagesRead > 0 && chapter.pagesRead < chapter.pages">{{chapter.pagesRead}} / {{chapter.pages}}</span>
<span *ngIf="chapter.pagesRead === 0">UNREAD</span>