Migrate existing control flow directives to use new control-flow schematic
This commit is contained in:
committed by
Aditya Chandel
parent
246efdaa34
commit
0f852ef068
@@ -10,10 +10,11 @@ categories:
|
|||||||
labels:
|
labels:
|
||||||
- 'bug'
|
- 'bug'
|
||||||
- 'fix'
|
- 'fix'
|
||||||
- title: '🛠️ Refactoring'
|
- title: '🛠️ Refactoring & Maintenance'
|
||||||
labels:
|
labels:
|
||||||
- 'refactor'
|
- 'refactor'
|
||||||
- 'cleanup'
|
- 'cleanup'
|
||||||
|
- 'chore'
|
||||||
- title: '📖 Documentation'
|
- title: '📖 Documentation'
|
||||||
labels:
|
labels:
|
||||||
- 'docs'
|
- 'docs'
|
||||||
|
|||||||
@@ -2,35 +2,47 @@
|
|||||||
<div class="flex flex-col flex-grow">
|
<div class="flex flex-col flex-grow">
|
||||||
<div class="flex justify-between items-center p-2 rounded-t-xl mb-4 bg-[var(--card-background)]">
|
<div class="flex justify-between items-center p-2 rounded-t-xl mb-4 bg-[var(--card-background)]">
|
||||||
<div class="flex items-center pl-2">
|
<div class="flex items-center pl-2">
|
||||||
<ng-container *ngIf="entityType$ | async as entityType">
|
@if (entityType$ | async; as entityType) {
|
||||||
<p *ngIf="entityType !== EntityType.ALL_BOOKS && entityType !== EntityType.UNSHELVED" class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
@if (entityType !== EntityType.ALL_BOOKS && entityType !== EntityType.UNSHELVED) {
|
||||||
|
<p class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
{{ entityType }}: {{ (entity$ | async)?.name }}
|
{{ entityType }}: {{ (entity$ | async)?.name }}
|
||||||
</p>
|
</p>
|
||||||
<p *ngIf="entityType === EntityType.ALL_BOOKS" class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
}
|
||||||
|
@if (entityType === EntityType.ALL_BOOKS) {
|
||||||
|
<p class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
All Books
|
All Books
|
||||||
</p>
|
</p>
|
||||||
<p *ngIf="entityType === EntityType.UNSHELVED" class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
}
|
||||||
|
@if (entityType === EntityType.UNSHELVED) {
|
||||||
|
<p class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
Unshelved Books
|
Unshelved Books
|
||||||
</p>
|
</p>
|
||||||
<div *ngIf="userService.userState$ | async as userData">
|
}
|
||||||
<div *ngIf="entityType !== EntityType.ALL_BOOKS && entityType !== EntityType.UNSHELVED && (userData.permissions.admin || userData.permissions.canManipulateLibrary) ">
|
@if (userService.userState$ | async; as userData) {
|
||||||
|
<div>
|
||||||
|
@if (entityType !== EntityType.ALL_BOOKS && entityType !== EntityType.UNSHELVED && (userData.permissions.admin || userData.permissions.canManipulateLibrary) ) {
|
||||||
|
<div>
|
||||||
<p-button icon="pi pi-ellipsis-v" [rounded]="true" [text]="true" severity="info" (click)="entitymenu.toggle($event)"></p-button>
|
<p-button icon="pi pi-ellipsis-v" [rounded]="true" [text]="true" severity="info" (click)="entitymenu.toggle($event)"></p-button>
|
||||||
<p-menu #entitymenu [model]="entityOptions" [popup]="true" appendTo="body"></p-menu>
|
<p-menu #entitymenu [model]="entityOptions" [popup]="true" appendTo="body"></p-menu>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
}
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center gap-8">
|
<div class="flex items-center gap-8">
|
||||||
|
|
||||||
<div class="flex flex-row items-center gap-6">
|
<div class="flex flex-row items-center gap-6">
|
||||||
<a *ngIf="isFilterActive" class="topbar-items topbar-item" (click)="clearFilter()">
|
@if (isFilterActive) {
|
||||||
|
<a class="topbar-items topbar-item" (click)="clearFilter()">
|
||||||
<i
|
<i
|
||||||
class="pi pi-filter-slash"
|
class="pi pi-filter-slash"
|
||||||
pTooltip="Clear applied filters"
|
pTooltip="Clear applied filters"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
</i>
|
</i>
|
||||||
</a>
|
</a>
|
||||||
|
}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
@@ -71,7 +83,9 @@
|
|||||||
<ng-template pTemplate="item" let-item>
|
<ng-template pTemplate="item" let-item>
|
||||||
<div class="flex justify-between items-center px-4 py-2 cursor-pointer" (click)="sortBooks(item.field)">
|
<div class="flex justify-between items-center px-4 py-2 cursor-pointer" (click)="sortBooks(item.field)">
|
||||||
<span>{{ item.label }}</span>
|
<span>{{ item.label }}</span>
|
||||||
<i *ngIf="item.icon" [class]="item.icon"></i>
|
@if (item.icon) {
|
||||||
|
<i [class]="item.icon"></i>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-menu>
|
</p-menu>
|
||||||
@@ -97,8 +111,8 @@
|
|||||||
(ngModelChange)="onSearchTermChange($event)"
|
(ngModelChange)="onSearchTermChange($event)"
|
||||||
class="search-input"
|
class="search-input"
|
||||||
/>
|
/>
|
||||||
|
@if (bookTitle) {
|
||||||
<p-button
|
<p-button
|
||||||
*ngIf="bookTitle"
|
|
||||||
icon="pi pi-times"
|
icon="pi pi-times"
|
||||||
[text]="true"
|
[text]="true"
|
||||||
size="small"
|
size="small"
|
||||||
@@ -106,6 +120,7 @@
|
|||||||
class="absolute right-2 top-1/2 -translate-y-1/2"
|
class="absolute right-2 top-1/2 -translate-y-1/2"
|
||||||
(click)="clearSearch()">
|
(click)="clearSearch()">
|
||||||
</p-button>
|
</p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</p-fluid>
|
</p-fluid>
|
||||||
|
|
||||||
@@ -121,35 +136,43 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="bookState$ | async as bookState">
|
@if (bookState$ | async; as bookState) {
|
||||||
<div *ngIf="!bookState?.loaded && !bookState?.error">
|
<div>
|
||||||
|
@if (!bookState?.loaded && !bookState?.error) {
|
||||||
|
<div>
|
||||||
<p-progressSpinner></p-progressSpinner>
|
<p-progressSpinner></p-progressSpinner>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<div class="no-books-container" *ngIf="bookState?.error">
|
@if (bookState?.error) {
|
||||||
|
<div class="no-books-container">
|
||||||
<p class="no-books-text">
|
<p class="no-books-text">
|
||||||
{{ entityType === EntityType.LIBRARY ? "Failed to load library's books!" : "Failed to load shelf's books!" }}
|
{{ entityType === EntityType.LIBRARY ? "Failed to load library's books!" : "Failed to load shelf's books!" }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="no-books-container" *ngIf="!bookState?.error && bookState?.loaded && bookState?.books?.length === 0">
|
}
|
||||||
|
@if (!bookState?.error && bookState?.loaded && bookState?.books?.length === 0) {
|
||||||
|
<div class="no-books-container">
|
||||||
<p class="no-books-text">
|
<p class="no-books-text">
|
||||||
This collection has no books!
|
This collection has no books!
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div class="book-card-container" *ngIf="bookState?.books as books">
|
@if (bookState?.books; as books) {
|
||||||
<app-book-table *ngIf="currentViewMode === 'table' && books.length > 0" [books]="books" (selectedBooksChange)="onSelectedBooksChange($event)"
|
<div class="book-card-container">
|
||||||
|
@if (currentViewMode === 'table' && books.length > 0) {
|
||||||
|
<app-book-table [books]="books" (selectedBooksChange)="onSelectedBooksChange($event)"
|
||||||
[sortOption]="selectedSort!"></app-book-table>
|
[sortOption]="selectedSort!"></app-book-table>
|
||||||
|
}
|
||||||
<virtual-scroller *ngIf="currentViewMode === 'grid'" class="virtual-scroller" #scroll [items]="books">
|
@if (currentViewMode === 'grid') {
|
||||||
|
<virtual-scroller class="virtual-scroller" #scroll [items]="books">
|
||||||
<div
|
<div
|
||||||
class="grid"
|
class="grid"
|
||||||
#container
|
#container
|
||||||
[ngStyle]="{'grid-template-columns': 'repeat(auto-fit, minmax(' + gridColumnMinWidth + ', 1fr))'}">
|
[ngStyle]="{'grid-template-columns': 'repeat(auto-fit, minmax(' + gridColumnMinWidth + ', 1fr))'}">
|
||||||
|
@for (book of scroll.viewPortItems; track book) {
|
||||||
<div
|
<div
|
||||||
class="virtual-scroller-item"
|
class="virtual-scroller-item"
|
||||||
*ngFor="let book of scroll.viewPortItems"
|
|
||||||
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
||||||
<app-book-card
|
<app-book-card
|
||||||
[book]="book"
|
[book]="book"
|
||||||
@@ -158,15 +181,18 @@
|
|||||||
[isSelected]="selectedBooks.has(book.id)">
|
[isSelected]="selectedBooks.has(book.id)">
|
||||||
</app-book-card>
|
</app-book-card>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</virtual-scroller>
|
</virtual-scroller>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div class="book-browser-footer bg-[var(--card-background)] bg-opacity-10" *ngIf="selectedBooks.size > 0" [@slideInOut]>
|
@if (selectedBooks.size > 0) {
|
||||||
|
<div class="book-browser-footer bg-[var(--card-background)] bg-opacity-10" [@slideInOut]>
|
||||||
<div class="flex justify-between gap-8">
|
<div class="flex justify-between gap-8">
|
||||||
<ng-container *ngIf="entityType$ | async as entityType">
|
@if (entityType$ | async; as entityType) {
|
||||||
|
@if (entityType === EntityType.LIBRARY || entityType === EntityType.ALL_BOOKS || entityType === EntityType.UNSHELVED) {
|
||||||
<p-button
|
<p-button
|
||||||
*ngIf="entityType === EntityType.LIBRARY || entityType === EntityType.ALL_BOOKS || entityType === EntityType.UNSHELVED"
|
|
||||||
icon="pi pi-bookmark-fill"
|
icon="pi pi-bookmark-fill"
|
||||||
outlined="true"
|
outlined="true"
|
||||||
severity="info"
|
severity="info"
|
||||||
@@ -174,8 +200,9 @@
|
|||||||
pTooltip="Assign to shelf"
|
pTooltip="Assign to shelf"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
</p-button>
|
</p-button>
|
||||||
|
}
|
||||||
|
@if (entityType === EntityType.SHELF) {
|
||||||
<p-button
|
<p-button
|
||||||
*ngIf="entityType === EntityType.SHELF"
|
|
||||||
icon="pi pi-bookmark"
|
icon="pi pi-bookmark"
|
||||||
outlined="true"
|
outlined="true"
|
||||||
severity="info"
|
severity="info"
|
||||||
@@ -183,9 +210,11 @@
|
|||||||
pTooltip="Remove from shelf"
|
pTooltip="Remove from shelf"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
</p-button>
|
</p-button>
|
||||||
<div *ngIf="userService.userState$ | async as userData">
|
}
|
||||||
|
@if (userService.userState$ | async; as userData) {
|
||||||
|
<div>
|
||||||
|
@if (userData.permissions.canEditMetadata) {
|
||||||
<p-button
|
<p-button
|
||||||
*ngIf="userData.permissions.canEditMetadata"
|
|
||||||
icon="pi pi-database"
|
icon="pi pi-database"
|
||||||
outlined="true"
|
outlined="true"
|
||||||
severity="info"
|
severity="info"
|
||||||
@@ -193,7 +222,9 @@
|
|||||||
pTooltip="Update metadata"
|
pTooltip="Update metadata"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
</p-button>
|
</p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<p-button
|
<p-button
|
||||||
outlined="true"
|
outlined="true"
|
||||||
icon="pi pi-lock"
|
icon="pi pi-lock"
|
||||||
@@ -210,11 +241,13 @@
|
|||||||
pTooltip="Deselect all books"
|
pTooltip="Deselect all books"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
</p-button>
|
</p-button>
|
||||||
</ng-container>
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-book-filter [entity$]="entity$" [entityType$]="entityType$" [resetFilter$]="resetFilterSubject"></app-book-filter>
|
<app-book-filter [entity$]="entity$" [entityType$]="entityType$" [resetFilter$]="resetFilterSubject"></app-book-filter>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import {animate, state, style, transition, trigger} from '@angular/animations';
|
|||||||
import {MetadataFetchOptionsComponent} from '../../metadata/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component';
|
import {MetadataFetchOptionsComponent} from '../../metadata/metadata-options-dialog/metadata-fetch-options/metadata-fetch-options.component';
|
||||||
import {MetadataRefreshType} from '../../metadata/model/request/metadata-refresh-type.enum';
|
import {MetadataRefreshType} from '../../metadata/model/request/metadata-refresh-type.enum';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {AsyncPipe, NgClass, NgForOf, NgIf, NgStyle} from '@angular/common';
|
import { AsyncPipe, NgClass, NgStyle } from '@angular/common';
|
||||||
import {VirtualScrollerModule} from '@iharbeck/ngx-virtual-scroller';
|
import {VirtualScrollerModule} from '@iharbeck/ngx-virtual-scroller';
|
||||||
import {BookCardComponent} from './book-card/book-card.component';
|
import {BookCardComponent} from './book-card/book-card.component';
|
||||||
import {ProgressSpinner} from 'primeng/progressspinner';
|
import {ProgressSpinner} from 'primeng/progressspinner';
|
||||||
@@ -65,7 +65,7 @@ const SORT_DIRECTION = {
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
templateUrl: './book-browser.component.html',
|
templateUrl: './book-browser.component.html',
|
||||||
styleUrls: ['./book-browser.component.scss'],
|
styleUrls: ['./book-browser.component.scss'],
|
||||||
imports: [Button, NgIf, VirtualScrollerModule, BookCardComponent, AsyncPipe, ProgressSpinner, Menu, NgForOf, InputText, FormsModule, BookTableComponent, BookFilterComponent, Tooltip, NgClass, Fluid, PrimeTemplate, NgStyle, OverlayPanelModule, Slider, Popover],
|
imports: [Button, VirtualScrollerModule, BookCardComponent, AsyncPipe, ProgressSpinner, Menu, InputText, FormsModule, BookTableComponent, BookFilterComponent, Tooltip, NgClass, Fluid, PrimeTemplate, NgStyle, OverlayPanelModule, Slider, Popover],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('slideInOut', [
|
trigger('slideInOut', [
|
||||||
state('void', style({
|
state('void', style({
|
||||||
|
|||||||
@@ -15,22 +15,24 @@
|
|||||||
<p-button [rounded]="true" icon="pi pi-info" class="info-btn" (click)="openBookInfo(book)"></p-button>
|
<p-button [rounded]="true" icon="pi pi-info" class="info-btn" (click)="openBookInfo(book)"></p-button>
|
||||||
<p-button [hidden]="readButtonHidden" [rounded]="true" icon="pi pi-book" class="read-btn" (click)="readBook(book)"></p-button>
|
<p-button [hidden]="readButtonHidden" [rounded]="true" icon="pi pi-book" class="read-btn" (click)="readBook(book)"></p-button>
|
||||||
|
|
||||||
|
@if (isCheckboxEnabled) {
|
||||||
<p-checkbox
|
<p-checkbox
|
||||||
*ngIf="isCheckboxEnabled"
|
|
||||||
[(ngModel)]="isSelected"
|
[(ngModel)]="isSelected"
|
||||||
binary="true"
|
binary="true"
|
||||||
id="select-checkbox-{{book.id}}"
|
id="select-checkbox-{{book.id}}"
|
||||||
class="select-checkbox"
|
class="select-checkbox"
|
||||||
(ngModelChange)="toggleSelection(isSelected || false)">
|
(ngModelChange)="toggleSelection(isSelected || false)">
|
||||||
</p-checkbox>
|
</p-checkbox>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (progressPercentage !== null) {
|
||||||
<p-progressBar
|
<p-progressBar
|
||||||
*ngIf="progressPercentage !== null"
|
|
||||||
[value]="progressPercentage"
|
[value]="progressPercentage"
|
||||||
[showValue]="false"
|
[showValue]="false"
|
||||||
class="cover-progress-bar"
|
class="cover-progress-bar"
|
||||||
[ngClass]="{ 'progress-complete': progressPercentage === 100, 'progress-incomplete': progressPercentage < 100 }">
|
[ngClass]="{ 'progress-complete': progressPercentage === 100, 'progress-incomplete': progressPercentage < 100 }">
|
||||||
</p-progressBar>
|
</p-progressBar>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div [hidden]="bottomBarHidden">
|
<div [hidden]="bottomBarHidden">
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import {MetadataFetchOptionsComponent} from '../../../metadata/metadata-options-
|
|||||||
import {MetadataRefreshType} from '../../../metadata/model/request/metadata-refresh-type.enum';
|
import {MetadataRefreshType} from '../../../metadata/model/request/metadata-refresh-type.enum';
|
||||||
import {MetadataRefreshRequest} from '../../../metadata/model/request/metadata-refresh-request.model';
|
import {MetadataRefreshRequest} from '../../../metadata/model/request/metadata-refresh-request.model';
|
||||||
import {UrlHelperService} from '../../../../utilities/service/url-helper.service';
|
import {UrlHelperService} from '../../../../utilities/service/url-helper.service';
|
||||||
import {NgClass, NgIf} from '@angular/common';
|
import { NgClass } from '@angular/common';
|
||||||
import {UserService} from '../../../../settings/user-management/user.service';
|
import {UserService} from '../../../../settings/user-management/user.service';
|
||||||
import {filter} from 'rxjs';
|
import {filter} from 'rxjs';
|
||||||
import {EmailService} from '../../../../settings/email/email.service';
|
import {EmailService} from '../../../../settings/email/email.service';
|
||||||
@@ -25,7 +25,7 @@ import {ProgressBar} from 'primeng/progressbar';
|
|||||||
selector: 'app-book-card',
|
selector: 'app-book-card',
|
||||||
templateUrl: './book-card.component.html',
|
templateUrl: './book-card.component.html',
|
||||||
styleUrls: ['./book-card.component.scss'],
|
styleUrls: ['./book-card.component.scss'],
|
||||||
imports: [Button, MenuModule, CheckboxModule, FormsModule, NgIf, NgClass, TieredMenu, ProgressBar],
|
imports: [Button, MenuModule, CheckboxModule, FormsModule, NgClass, TieredMenu, ProgressBar],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
export class BookCardComponent implements OnInit {
|
export class BookCardComponent implements OnInit {
|
||||||
|
|||||||
+22
-12
@@ -1,4 +1,5 @@
|
|||||||
<div *ngIf="showFilters" class="w-[225px] ml-4 h-[calc(100vh-6.5rem)] rounded-xl bg-[var(--card-background)] overflow-hidden">
|
@if (showFilters) {
|
||||||
|
<div class="w-[225px] ml-4 h-[calc(100vh-6.5rem)] rounded-xl bg-[var(--card-background)] overflow-hidden">
|
||||||
<div class="flex items-center justify-between px-4 py-4">
|
<div class="flex items-center justify-between px-4 py-4">
|
||||||
<span class="text font-semibold">Filter Mode</span>
|
<span class="text font-semibold">Filter Mode</span>
|
||||||
<p-selectButton
|
<p-selectButton
|
||||||
@@ -11,18 +12,23 @@
|
|||||||
styleClass="h-8"></p-selectButton>
|
styleClass="h-8"></p-selectButton>
|
||||||
</div>
|
</div>
|
||||||
<p-accordion [value]="0">
|
<p-accordion [value]="0">
|
||||||
<p-accordion-panel *ngFor="let filterType of filterTypes; let i = index" [value]="i">
|
@for (filterType of filterTypes; track filterType; let i = $index) {
|
||||||
|
<p-accordion-panel [value]="i">
|
||||||
<p-accordion-header>
|
<p-accordion-header>
|
||||||
<span class="inline-flex items-center gap-1">
|
<span class="inline-flex items-center gap-1">
|
||||||
{{ filterLabels[filterType] || (filterType | titlecase) }}
|
{{ filterLabels[filterType] || (filterType | titlecase) }}
|
||||||
<span *ngIf="activeFilters[filterType]?.length" class="text-sm text-[var(--primary-color)]">
|
@if (activeFilters[filterType]?.length) {
|
||||||
|
<span class="text-sm text-[var(--primary-color)]">
|
||||||
({{ activeFilters[filterType].length }})
|
({{ activeFilters[filterType].length }})
|
||||||
</span>
|
</span>
|
||||||
|
}
|
||||||
</span>
|
</span>
|
||||||
</p-accordion-header>
|
</p-accordion-header>
|
||||||
<p-accordion-content class="h-[31rem] !overflow-y-auto">
|
<p-accordion-content class="h-[31rem] !overflow-y-auto">
|
||||||
<div *ngIf="filterStreams[filterType] | async as filters">
|
@if (filterStreams[filterType] | async; as filters) {
|
||||||
<div *ngFor="let filter of filters">
|
<div>
|
||||||
|
@for (filter of filters; track filter) {
|
||||||
|
<div>
|
||||||
<div
|
<div
|
||||||
class="cursor-pointer transition-colors duration-200 ease-in-out pb-1 flex items-center gap-2"
|
class="cursor-pointer transition-colors duration-200 ease-in-out pb-1 flex items-center gap-2"
|
||||||
[ngClass]="{
|
[ngClass]="{
|
||||||
@@ -30,20 +36,24 @@
|
|||||||
activeFilters[filterType]?.includes(filter.value?.id || filter.value)
|
activeFilters[filterType]?.includes(filter.value?.id || filter.value)
|
||||||
}"
|
}"
|
||||||
(click)="handleFilterClick(filterType, filter.value?.id || filter.value)">
|
(click)="handleFilterClick(filterType, filter.value?.id || filter.value)">
|
||||||
|
|
||||||
<p-badge [value]="filter.bookCount"></p-badge>
|
<p-badge [value]="filter.bookCount"></p-badge>
|
||||||
<ng-container *ngIf="filterType === 'amazonRating'; else defaultLabel">
|
@if (filterType === 'amazonRating') {
|
||||||
<ng-container *ngIf="filterType === 'amazonRating'; else defaultLabel">
|
@if (filterType === 'amazonRating') {
|
||||||
<span>{{ filter.value.name }}</span>
|
<span>{{ filter.value.name }}</span>
|
||||||
</ng-container>
|
} @else {
|
||||||
</ng-container>
|
|
||||||
<ng-template #defaultLabel>
|
|
||||||
{{ filter.value.name || filter.value }}
|
{{ filter.value.name || filter.value }}
|
||||||
</ng-template>
|
}
|
||||||
|
} @else {
|
||||||
|
{{ filter.value.name || filter.value }}
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</p-accordion-content>
|
</p-accordion-content>
|
||||||
</p-accordion-panel>
|
</p-accordion-panel>
|
||||||
|
}
|
||||||
</p-accordion>
|
</p-accordion>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
+1
-3
@@ -7,7 +7,7 @@ import {Shelf} from '../../../model/shelf.model';
|
|||||||
import {EntityType} from '../book-browser.component';
|
import {EntityType} from '../book-browser.component';
|
||||||
import {Book} from '../../../model/book.model';
|
import {Book} from '../../../model/book.model';
|
||||||
import {Accordion, AccordionContent, AccordionHeader, AccordionPanel} from 'primeng/accordion';
|
import {Accordion, AccordionContent, AccordionHeader, AccordionPanel} from 'primeng/accordion';
|
||||||
import {AsyncPipe, NgClass, NgForOf, NgIf, TitleCasePipe} from '@angular/common';
|
import { AsyncPipe, NgClass, TitleCasePipe } from '@angular/common';
|
||||||
import {Badge} from 'primeng/badge';
|
import {Badge} from 'primeng/badge';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {SelectButton} from 'primeng/selectbutton';
|
import {SelectButton} from 'primeng/selectbutton';
|
||||||
@@ -110,8 +110,6 @@ function getPageCountRangeFilters(pageCount?: number) {
|
|||||||
AccordionPanel,
|
AccordionPanel,
|
||||||
AccordionHeader,
|
AccordionHeader,
|
||||||
AccordionContent,
|
AccordionContent,
|
||||||
NgIf,
|
|
||||||
NgForOf,
|
|
||||||
NgClass,
|
NgClass,
|
||||||
Badge,
|
Badge,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
|
|||||||
+12
-4
@@ -39,7 +39,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
<ng-template #body let-book>
|
<ng-template #body let-book>
|
||||||
<tr *ngIf="book.metadata as metadata" style="height:46px">
|
@if (book.metadata; as metadata) {
|
||||||
|
<tr style="height:46px">
|
||||||
<td class="max-w-16">
|
<td class="max-w-16">
|
||||||
<p-tableCheckbox [value]="book"></p-tableCheckbox>
|
<p-tableCheckbox [value]="book"></p-tableCheckbox>
|
||||||
</td>
|
</td>
|
||||||
@@ -86,7 +87,9 @@
|
|||||||
stars="5"
|
stars="5"
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)">
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)">
|
||||||
</p-rating>
|
</p-rating>
|
||||||
<span *ngIf="metadata.amazonRating != null">({{ metadata.amazonRating?.toFixed(1) }})</span>
|
@if (metadata.amazonRating != null) {
|
||||||
|
<span>({{ metadata.amazonRating?.toFixed(1) }})</span>
|
||||||
|
}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="min-w-[7rem] max-w-[7rem] overflow-hidden truncate text-right">
|
<td class="min-w-[7rem] max-w-[7rem] overflow-hidden truncate text-right">
|
||||||
@@ -100,7 +103,9 @@
|
|||||||
stars="5"
|
stars="5"
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
||||||
</p-rating>
|
</p-rating>
|
||||||
<span *ngIf="metadata.goodreadsRating != null">({{ metadata.goodreadsRating?.toFixed(1) }})</span>
|
@if (metadata.goodreadsRating != null) {
|
||||||
|
<span>({{ metadata.goodreadsRating?.toFixed(1) }})</span>
|
||||||
|
}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="min-w-[7rem] max-w-[7rem] overflow-hidden truncate text-right">
|
<td class="min-w-[7rem] max-w-[7rem] overflow-hidden truncate text-right">
|
||||||
@@ -114,10 +119,13 @@
|
|||||||
stars="5"
|
stars="5"
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
||||||
</p-rating>
|
</p-rating>
|
||||||
<span *ngIf="metadata.hardcoverRating != null">({{ metadata.hardcoverRating?.toFixed(1) }})</span>
|
@if (metadata.hardcoverRating != null) {
|
||||||
|
<span>({{ metadata.hardcoverRating?.toFixed(1) }})</span>
|
||||||
|
}
|
||||||
</span>
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td class="min-w-[6rem] max-w-[6rem] overflow-hidden truncate">{{ metadata.hardcoverReviewCount }}</td>
|
<td class="min-w-[6rem] max-w-[6rem] overflow-hidden truncate">{{ metadata.hardcoverReviewCount }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
}
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-table>
|
</p-table>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, EventEmitter, inject, Input, OnChanges, Output} from '@angular/core';
|
import {Component, EventEmitter, inject, Input, OnChanges, Output} from '@angular/core';
|
||||||
import {TableModule} from 'primeng/table';
|
import {TableModule} from 'primeng/table';
|
||||||
import {DatePipe, NgIf} from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import {Rating} from 'primeng/rating';
|
import {Rating} from 'primeng/rating';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {Book, BookMetadata} from '../../../model/book.model';
|
import {Book, BookMetadata} from '../../../model/book.model';
|
||||||
@@ -17,7 +17,6 @@ import {Router} from '@angular/router';
|
|||||||
templateUrl: './book-table.component.html',
|
templateUrl: './book-table.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
TableModule,
|
TableModule,
|
||||||
NgIf,
|
|
||||||
Rating,
|
Rating,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
Button,
|
Button,
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,7 @@
|
|||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-24 gap-y-4">
|
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-x-24 gap-y-4">
|
||||||
<div *ngFor="let field of lockableFields" class="flex items-center justify-between">
|
@for (field of lockableFields; track field) {
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
<label class="capitalize">{{ fieldLabels[field] || field }}</label>
|
<label class="capitalize">{{ fieldLabels[field] || field }}</label>
|
||||||
<p-button
|
<p-button
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
@@ -10,6 +11,7 @@
|
|||||||
(click)="cycleLockState(field)"
|
(click)="cycleLockState(field)"
|
||||||
></p-button>
|
></p-button>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -1,7 +1,7 @@
|
|||||||
import {Component, inject, OnInit} from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {NgForOf} from '@angular/common';
|
|
||||||
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
import {BookService} from '../../../service/book.service';
|
import {BookService} from '../../../service/book.service';
|
||||||
@@ -13,7 +13,6 @@ import {Divider} from 'primeng/divider';
|
|||||||
imports: [
|
imports: [
|
||||||
Button,
|
Button,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
NgForOf,
|
|
||||||
Divider
|
Divider
|
||||||
],
|
],
|
||||||
templateUrl: './lock-unlock-metadata-dialog.component.html',
|
templateUrl: './lock-unlock-metadata-dialog.component.html',
|
||||||
|
|||||||
@@ -10,31 +10,36 @@
|
|||||||
placeholder="Search books by title or author..."
|
placeholder="Search books by title or author..."
|
||||||
class="search-input"
|
class="search-input"
|
||||||
/>
|
/>
|
||||||
<p-button *ngIf="searchQuery" icon="pi pi-times" (click)="clearSearch()" [text]="true" [rounded]="true" class="clear-btn" aria-label="Clear Search"></p-button>
|
@if (searchQuery) {
|
||||||
|
<p-button icon="pi pi-times" (click)="clearSearch()" [text]="true" [rounded]="true" class="clear-btn" aria-label="Clear Search"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="search-dropdown layout-menu pt-4" [class.show]="(books.length > 0)">
|
<div class="search-dropdown layout-menu pt-4" [class.show]="(books.length > 0)">
|
||||||
<ng-container *ngIf="books.length > 0; else noResults">
|
@if (books.length > 0) {
|
||||||
<div class="search-dropdown-item flex flex-col" *ngFor="let book of books" (click)="onBookClick(book)">
|
@for (book of books; track book) {
|
||||||
|
<div class="search-dropdown-item flex flex-col" (click)="onBookClick(book)">
|
||||||
<div class="flex flex-row w-full px-2">
|
<div class="flex flex-row w-full px-2">
|
||||||
<img [attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)" alt="Book Cover" class="search-book-cover"/>
|
<img [attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)" alt="Book Cover" class="search-book-cover"/>
|
||||||
<div class="search-book-details">
|
<div class="search-book-details">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
<p class="search-book-name text-lg font-medium truncate">{{ book.metadata?.title | slice:0:70 }}</p>
|
<p class="search-book-name text-lg font-medium truncate">{{ book.metadata?.title | slice:0:70 }}</p>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="book.metadata?.authors?.length ?? 0 > 0" class="search-book-authors">
|
@if (book.metadata?.authors?.length ?? 0 > 0) {
|
||||||
|
<div class="search-book-authors">
|
||||||
<p class="italic">by: {{ getAuthorNames(book.metadata?.authors) }}</p>
|
<p class="italic">by: {{ getAuthorNames(book.metadata?.authors) }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
}
|
||||||
|
} @else {
|
||||||
<ng-template #noResults>
|
|
||||||
<div class="search-dropdown-item">
|
<div class="search-dropdown-item">
|
||||||
<span>No results found</span>
|
<span>No results found</span>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import {FormsModule} from '@angular/forms';
|
|||||||
import {InputTextModule} from 'primeng/inputtext';
|
import {InputTextModule} from 'primeng/inputtext';
|
||||||
import {BookService} from '../../service/book.service';
|
import {BookService} from '../../service/book.service';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {NgForOf, NgIf, SlicePipe} from '@angular/common';
|
import { SlicePipe } from '@angular/common';
|
||||||
import {Divider} from 'primeng/divider';
|
import {Divider} from 'primeng/divider';
|
||||||
import {UrlHelperService} from '../../../utilities/service/url-helper.service';
|
import {UrlHelperService} from '../../../utilities/service/url-helper.service';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
@@ -18,8 +18,6 @@ import {Router} from '@angular/router';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
InputTextModule,
|
InputTextModule,
|
||||||
Button,
|
Button,
|
||||||
NgIf,
|
|
||||||
NgForOf,
|
|
||||||
SlicePipe,
|
SlicePipe,
|
||||||
Divider
|
Divider
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -27,9 +27,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="spread-controls" style="display: flex; align-items: center; margin-left: auto;">
|
<div class="spread-controls" style="display: flex; align-items: center; margin-left: auto;">
|
||||||
<button *ngIf="isTwoPageView" (click)="toggleSpreadDirection()" title="Toggle Spread Direction">
|
@if (isTwoPageView) {
|
||||||
|
<button (click)="toggleSpreadDirection()" title="Toggle Spread Direction">
|
||||||
{{ pageSpread === 'ODD' ? '⬅️' : '➡️' }}
|
{{ pageSpread === 'ODD' ? '⬅️' : '➡️' }}
|
||||||
</button>
|
</button>
|
||||||
|
}
|
||||||
<button (click)="toggleView()" title="Toggle View">
|
<button (click)="toggleView()" title="Toggle View">
|
||||||
{{ isTwoPageView ? '1️⃣' : '2️⃣' }}
|
{{ isTwoPageView ? '1️⃣' : '2️⃣' }}
|
||||||
</button>
|
</button>
|
||||||
@@ -37,19 +39,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="image-container" [class.two-page-view]="isTwoPageView">
|
<div class="image-container" [class.two-page-view]="isTwoPageView">
|
||||||
<ng-container *ngIf="!isLoading; else loading">
|
@if (!isLoading) {
|
||||||
<ng-container *ngIf="pages.length > 0; else noPages">
|
@if (pages.length > 0) {
|
||||||
<img *ngFor="let url of imageUrls" [src]="url" alt="Page Image"/>
|
@for (url of imageUrls; track url) {
|
||||||
</ng-container>
|
<img [src]="url" alt="Page Image"/>
|
||||||
</ng-container>
|
}
|
||||||
<ng-template #noPages>
|
} @else {
|
||||||
<p>No pages available.</p>
|
<p>No pages available.</p>
|
||||||
</ng-template>
|
}
|
||||||
<ng-template #loading>
|
} @else {
|
||||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%;">
|
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%;">
|
||||||
<p-progressSpinner></p-progressSpinner>
|
<p-progressSpinner></p-progressSpinner>
|
||||||
<p style="margin-top: 1rem; color: #ccc;">Processing pages... This may take a few seconds on first load. Future loads will be significantly faster.</p>
|
<p style="margin-top: 1rem; color: #ccc;">Processing pages... This may take a few seconds on first load. Future loads will be significantly faster.</p>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import {Component, HostListener, inject, OnInit} from '@angular/core';
|
import {Component, HostListener, inject, OnInit} from '@angular/core';
|
||||||
import {NgFor, NgIf} from '@angular/common';
|
|
||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
import {CbxReaderService} from '../../service/cbx-reader.service';
|
import {CbxReaderService} from '../../service/cbx-reader.service';
|
||||||
import {BookService} from '../../service/book.service';
|
import {BookService} from '../../service/book.service';
|
||||||
@@ -14,7 +14,7 @@ import {NewPdfReaderService} from '../../service/new-pdf-reader.service';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-cbx-reader',
|
selector: 'app-cbx-reader',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgIf, NgFor, ProgressSpinner, FormsModule],
|
imports: [ProgressSpinner, FormsModule],
|
||||||
templateUrl: './cbx-reader.component.html',
|
templateUrl: './cbx-reader.component.html',
|
||||||
styleUrl: './cbx-reader.component.scss'
|
styleUrl: './cbx-reader.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
+18
-12
@@ -1,29 +1,32 @@
|
|||||||
<div #epubContainer class="epub-viewer-container">
|
<div #epubContainer class="epub-viewer-container">
|
||||||
<div *ngIf="isLoading" class="spinner-wrapper">
|
@if (isLoading) {
|
||||||
|
<div class="spinner-wrapper">
|
||||||
<p-progressSpinner></p-progressSpinner>
|
<p-progressSpinner></p-progressSpinner>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="!isLoading">
|
}
|
||||||
|
@if (!isLoading) {
|
||||||
|
<div>
|
||||||
<div class="epub-header">
|
<div class="epub-header">
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p-button size="small" class="menu-toggle-button" (click)="toggleDrawer()" icon="pi pi-bars" severity="secondary"></p-button>
|
<p-button size="small" class="menu-toggle-button" (click)="toggleDrawer()" icon="pi pi-bars" severity="secondary"></p-button>
|
||||||
<p-drawer [(visible)]="isDrawerVisible" [modal]="false" [position]="'left'" header="Chapters">
|
<p-drawer [(visible)]="isDrawerVisible" [modal]="false" [position]="'left'" header="Chapters">
|
||||||
<ul class="chapter-list">
|
<ul class="chapter-list">
|
||||||
<li *ngFor="let chapter of chapters" (click)="navigateToChapter(chapter); $event.stopPropagation()" class="chapter-item">
|
@for (chapter of chapters; track chapter) {
|
||||||
|
<li (click)="navigateToChapter(chapter); $event.stopPropagation()" class="chapter-item">
|
||||||
{{ chapter.label }}
|
{{ chapter.label }}
|
||||||
</li>
|
</li>
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</p-drawer>
|
</p-drawer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>{{ currentChapter }}</p>
|
<p>{{ currentChapter }}</p>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
<div *ngIf="!locationsReady" class="location-indicator" pTooltip="Saving progress not ready yet">
|
@if (!locationsReady) {
|
||||||
|
<div class="location-indicator" pTooltip="Saving progress not ready yet">
|
||||||
<span class="dot"></span>
|
<span class="dot"></span>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div>
|
<div>
|
||||||
<p-button size="small" class="settings-toggle-button" (click)="toggleSettingsDrawer()" icon="pi pi-cog" severity="secondary"></p-button>
|
<p-button size="small" class="settings-toggle-button" (click)="toggleSettingsDrawer()" icon="pi pi-cog" severity="secondary"></p-button>
|
||||||
<p-drawer [(visible)]="isSettingsDrawerVisible" [modal]="false" [position]="'right'" header="Settings">
|
<p-drawer [(visible)]="isSettingsDrawerVisible" [modal]="false" [position]="'right'" header="Settings">
|
||||||
@@ -50,10 +53,13 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="epubContainer" #epubContainer></div>
|
<div id="epubContainer" #epubContainer></div>
|
||||||
|
@if (selectedFlow !== 'scrolled') {
|
||||||
<button *ngIf="selectedFlow !== 'scrolled'" class="epub-controls-left" (click)="prevPage()">←</button>
|
<button class="epub-controls-left" (click)="prevPage()">←</button>
|
||||||
<button *ngIf="selectedFlow !== 'scrolled'" class="epub-controls-right" (click)="nextPage()">→</button>
|
}
|
||||||
|
@if (selectedFlow !== 'scrolled') {
|
||||||
|
<button class="epub-controls-right" (click)="nextPage()">→</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {Component, ElementRef, inject, OnDestroy, OnInit, ViewChild} from '@angu
|
|||||||
import ePub, {EpubCFI} from 'epubjs';
|
import ePub, {EpubCFI} from 'epubjs';
|
||||||
import {Drawer} from 'primeng/drawer';
|
import {Drawer} from 'primeng/drawer';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {NgForOf, NgIf} from '@angular/common';
|
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {Divider} from 'primeng/divider';
|
import {Divider} from 'primeng/divider';
|
||||||
import {ActivatedRoute} from '@angular/router';
|
import {ActivatedRoute} from '@angular/router';
|
||||||
@@ -66,7 +66,7 @@ export function getChapter(book: any, location: any) {
|
|||||||
selector: 'app-epub-viewer',
|
selector: 'app-epub-viewer',
|
||||||
templateUrl: './epub-viewer.component.html',
|
templateUrl: './epub-viewer.component.html',
|
||||||
styleUrls: ['./epub-viewer.component.scss'],
|
styleUrls: ['./epub-viewer.component.scss'],
|
||||||
imports: [Drawer, Button, NgForOf, FormsModule, Divider, Select, ProgressSpinner, NgIf, Tooltip],
|
imports: [Drawer, Button, FormsModule, Divider, Select, ProgressSpinner, Tooltip],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
export class EpubViewerComponent implements OnInit, OnDestroy {
|
export class EpubViewerComponent implements OnInit, OnDestroy {
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
<div *ngIf="isLoading" class="flex justify-center items-center h-screen relative">
|
@if (isLoading) {
|
||||||
|
<div class="flex justify-center items-center h-screen relative">
|
||||||
<p-progressSpinner></p-progressSpinner>
|
<p-progressSpinner></p-progressSpinner>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (!isLoading) {
|
||||||
<ngx-extended-pdf-viewer
|
<ngx-extended-pdf-viewer
|
||||||
*ngIf="!isLoading"
|
|
||||||
[src]="bookData"
|
[src]="bookData"
|
||||||
[handTool]="handTool"
|
[handTool]="handTool"
|
||||||
[height]="'auto'"
|
[height]="'auto'"
|
||||||
@@ -18,3 +20,4 @@
|
|||||||
(zoomChange)="onZoomChange($event)"
|
(zoomChange)="onZoomChange($event)"
|
||||||
(spreadChange)="onSpreadChange($event)">
|
(spreadChange)="onSpreadChange($event)">
|
||||||
</ngx-extended-pdf-viewer>
|
</ngx-extended-pdf-viewer>
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,14 +5,14 @@ import {BookService} from '../../service/book.service';
|
|||||||
import {forkJoin, Subscription} from 'rxjs';
|
import {forkJoin, Subscription} from 'rxjs';
|
||||||
import {BookSetting} from '../../model/book.model';
|
import {BookSetting} from '../../model/book.model';
|
||||||
import {UserService} from '../../../settings/user-management/user.service';
|
import {UserService} from '../../../settings/user-management/user.service';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {ProgressSpinner} from 'primeng/progressspinner';
|
import {ProgressSpinner} from 'primeng/progressspinner';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pdf-viewer',
|
selector: 'app-pdf-viewer',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgxExtendedPdfViewerModule, NgIf, ProgressSpinner],
|
imports: [NgxExtendedPdfViewerModule, ProgressSpinner],
|
||||||
templateUrl: './pdf-viewer.component.html',
|
templateUrl: './pdf-viewer.component.html',
|
||||||
})
|
})
|
||||||
export class PdfViewerComponent implements OnInit, OnDestroy {
|
export class PdfViewerComponent implements OnInit, OnDestroy {
|
||||||
|
|||||||
@@ -2,12 +2,14 @@
|
|||||||
|
|
||||||
<div class="flex flex-col flex-grow">
|
<div class="flex flex-col flex-grow">
|
||||||
<!-- Dynamic shelves content -->
|
<!-- Dynamic shelves content -->
|
||||||
<div *ngFor="let shelf of (shelfState$ | async)?.shelves">
|
@for (shelf of (shelfState$ | async)?.shelves; track shelf) {
|
||||||
|
<div>
|
||||||
<div class="flex flex-row items-center gap-4 py-2">
|
<div class="flex flex-row items-center gap-4 py-2">
|
||||||
<p-checkbox [inputId]="shelf.name" name="group" [value]="shelf" [(ngModel)]="selectedShelves"></p-checkbox>
|
<p-checkbox [inputId]="shelf.name" name="group" [value]="shelf" [(ngModel)]="selectedShelves"></p-checkbox>
|
||||||
<label [for]="shelf.id">{{ shelf.name }}</label>
|
<label [for]="shelf.id">{{ shelf.name }}</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<!-- Button section, anchored to the bottom -->
|
<!-- Button section, anchored to the bottom -->
|
||||||
<div class="flex justify-between items-center pt-4 mt-auto">
|
<div class="flex justify-between items-center pt-4 mt-auto">
|
||||||
@@ -30,13 +32,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="py-4">
|
<div class="py-4">
|
||||||
<label>Shelf Icon</label>
|
<label>Shelf Icon</label>
|
||||||
<div *ngIf="!selectedIcon">
|
@if (!selectedIcon) {
|
||||||
|
<div>
|
||||||
<p-button label="Select Icon" icon="pi pi-search" (onClick)="openIconPicker()"></p-button>
|
<p-button label="Select Icon" icon="pi pi-search" (onClick)="openIconPicker()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="selectedIcon" class="flex items-center gap-4">
|
}
|
||||||
|
@if (selectedIcon) {
|
||||||
|
<div class="flex items-center gap-4">
|
||||||
<i [class]="selectedIcon"></i>
|
<i [class]="selectedIcon"></i>
|
||||||
<p-button icon="pi pi-times" text="true" outlined="true" severity="warn" (onClick)="clearSelectedIcon()"></p-button>
|
<p-button icon="pi pi-times" text="true" outlined="true" severity="warn" (onClick)="clearSelectedIcon()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
<ng-template pTemplate="footer">
|
<ng-template pTemplate="footer">
|
||||||
<p-button label="Cancel" severity="secondary" (onClick)="closeShelfDialog()" class="p-button-text"></p-button>
|
<p-button label="Cancel" severity="secondary" (onClick)="closeShelfDialog()" class="p-button-text"></p-button>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {Shelf} from '../../model/shelf.model';
|
|||||||
import {IconPickerComponent} from '../../../utilities/component/icon-picker/icon-picker.component';
|
import {IconPickerComponent} from '../../../utilities/component/icon-picker/icon-picker.component';
|
||||||
import {ShelfState} from '../../model/state/shelf-state.model';
|
import {ShelfState} from '../../model/state/shelf-state.model';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {AsyncPipe, NgForOf, NgIf} from '@angular/common';
|
import { AsyncPipe } from '@angular/common';
|
||||||
import {Checkbox} from 'primeng/checkbox';
|
import {Checkbox} from 'primeng/checkbox';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {Dialog} from 'primeng/dialog';
|
import {Dialog} from 'primeng/dialog';
|
||||||
@@ -22,14 +22,12 @@ import {InputText} from 'primeng/inputtext';
|
|||||||
templateUrl: './shelf-assigner.component.html',
|
templateUrl: './shelf-assigner.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
Button,
|
Button,
|
||||||
NgForOf,
|
|
||||||
Checkbox,
|
Checkbox,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
IconPickerComponent,
|
IconPickerComponent,
|
||||||
Dialog,
|
Dialog,
|
||||||
InputText,
|
InputText,
|
||||||
NgIf,
|
|
||||||
PrimeTemplate
|
PrimeTemplate
|
||||||
],
|
],
|
||||||
styleUrls: ['./shelf-assigner.component.scss']
|
styleUrls: ['./shelf-assigner.component.scss']
|
||||||
|
|||||||
+6
-2
@@ -6,13 +6,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="flex items-center gap-5">
|
<div class="flex items-center gap-5">
|
||||||
<p>Shelf Icon:</p>
|
<p>Shelf Icon:</p>
|
||||||
<div *ngIf="!selectedIcon">
|
@if (!selectedIcon) {
|
||||||
|
<div>
|
||||||
<p-button label="Select Icon" icon="pi pi-search" (onClick)="openIconPicker()"></p-button>
|
<p-button label="Select Icon" icon="pi pi-search" (onClick)="openIconPicker()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="selectedIcon">
|
}
|
||||||
|
@if (selectedIcon) {
|
||||||
|
<div>
|
||||||
<i [class]="selectedIcon" class="text-xl mr-3"></i>
|
<i [class]="selectedIcon" class="text-xl mr-3"></i>
|
||||||
<p-button icon="pi pi-times" (onClick)="clearSelectedIcon()" [rounded]="true" [text]="true" [outlined]="true" severity="danger"></p-button>
|
<p-button icon="pi pi-times" (onClick)="clearSelectedIcon()" [rounded]="true" [text]="true" [outlined]="true" severity="danger"></p-button>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
|
|||||||
+1
-2
@@ -4,7 +4,7 @@ import {DynamicDialogConfig, DynamicDialogRef} from 'primeng/dynamicdialog';
|
|||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {IconPickerComponent} from '../../../utilities/component/icon-picker/icon-picker.component';
|
import {IconPickerComponent} from '../../../utilities/component/icon-picker/icon-picker.component';
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {Shelf} from '../../model/shelf.model';
|
import {Shelf} from '../../model/shelf.model';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
@@ -15,7 +15,6 @@ import {MessageService} from 'primeng/api';
|
|||||||
Button,
|
Button,
|
||||||
IconPickerComponent,
|
IconPickerComponent,
|
||||||
InputText,
|
InputText,
|
||||||
NgIf,
|
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
FormsModule
|
FormsModule
|
||||||
],
|
],
|
||||||
|
|||||||
+12
-4
@@ -2,19 +2,27 @@
|
|||||||
<p-tabs [value]="tab" lazy="true">
|
<p-tabs [value]="tab" lazy="true">
|
||||||
<p-tablist>
|
<p-tablist>
|
||||||
<p-tab value="view">Book Details</p-tab>
|
<p-tab value="view">Book Details</p-tab>
|
||||||
<p-tab *ngIf="admin || canEditMetadata" value="edit">Edit Metadata</p-tab>
|
@if (admin || canEditMetadata) {
|
||||||
<p-tab *ngIf="admin || canEditMetadata" value="match">Search Metadata</p-tab>
|
<p-tab value="edit">Edit Metadata</p-tab>
|
||||||
|
}
|
||||||
|
@if (admin || canEditMetadata) {
|
||||||
|
<p-tab value="match">Search Metadata</p-tab>
|
||||||
|
}
|
||||||
</p-tablist>
|
</p-tablist>
|
||||||
<p-tabpanels class="h-[calc(100vh-10rem)]">
|
<p-tabpanels class="h-[calc(100vh-10rem)]">
|
||||||
<p-tabpanel value="view">
|
<p-tabpanel value="view">
|
||||||
<app-metadata-viewer [book]="book" [recommendedBooks]="recommendedBooks"></app-metadata-viewer>
|
<app-metadata-viewer [book]="book" [recommendedBooks]="recommendedBooks"></app-metadata-viewer>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
<p-tabpanel *ngIf="admin || canEditMetadata" value="edit">
|
@if (admin || canEditMetadata) {
|
||||||
|
<p-tabpanel value="edit">
|
||||||
<app-metadata-editor></app-metadata-editor>
|
<app-metadata-editor></app-metadata-editor>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
<p-tabpanel *ngIf="admin || canEditMetadata" value="match">
|
}
|
||||||
|
@if (admin || canEditMetadata) {
|
||||||
|
<p-tabpanel value="match">
|
||||||
<app-metadata-searcher></app-metadata-searcher>
|
<app-metadata-searcher></app-metadata-searcher>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
|
}
|
||||||
</p-tabpanels>
|
</p-tabpanels>
|
||||||
</p-tabs>
|
</p-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-2
@@ -8,7 +8,7 @@ import {distinctUntilChanged, filter, map, switchMap, take} from 'rxjs/operators
|
|||||||
import {BookService} from '../../service/book.service';
|
import {BookService} from '../../service/book.service';
|
||||||
import {AppSettingsService} from '../../../core/service/app-settings.service';
|
import {AppSettingsService} from '../../../core/service/app-settings.service';
|
||||||
import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
|
import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {MetadataViewerComponent} from './metadata-viewer/metadata-viewer.component';
|
import {MetadataViewerComponent} from './metadata-viewer/metadata-viewer.component';
|
||||||
import {MetadataEditorComponent} from './metadata-editor/metadata-editor.component';
|
import {MetadataEditorComponent} from './metadata-editor/metadata-editor.component';
|
||||||
import {MetadataSearcherComponent} from './metadata-searcher/metadata-searcher.component';
|
import {MetadataSearcherComponent} from './metadata-searcher/metadata-searcher.component';
|
||||||
@@ -22,7 +22,6 @@ import {MetadataSearcherComponent} from './metadata-searcher/metadata-searcher.c
|
|||||||
TabList,
|
TabList,
|
||||||
Tabs,
|
Tabs,
|
||||||
Tab,
|
Tab,
|
||||||
NgIf,
|
|
||||||
TabPanels,
|
TabPanels,
|
||||||
MetadataViewerComponent,
|
MetadataViewerComponent,
|
||||||
TabPanel,
|
TabPanel,
|
||||||
|
|||||||
+155
-79
@@ -1,26 +1,25 @@
|
|||||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" *ngIf="bookMetadata$ | async as metadata" class="pt-2 flex flex-col h-full">
|
@if (bookMetadata$ | async; as metadata) {
|
||||||
|
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="pt-2 flex flex-col h-full">
|
||||||
<div *ngIf="isLoading" class="absolute inset-0 bg-black opacity-25 z-10"></div>
|
@if (isLoading) {
|
||||||
<p-progressSpinner *ngIf="isLoading" [style]="{position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)'}"></p-progressSpinner>
|
<div class="absolute inset-0 bg-black opacity-25 z-10"></div>
|
||||||
|
}
|
||||||
|
@if (isLoading) {
|
||||||
|
<p-progressSpinner [style]="{position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)'}"></p-progressSpinner>
|
||||||
|
}
|
||||||
<div class="overflow-y-scroll flex-1">
|
<div class="overflow-y-scroll flex-1">
|
||||||
|
|
||||||
<div class="flex flex-row w-full gap-4">
|
<div class="flex flex-row w-full gap-4">
|
||||||
|
|
||||||
<div class="flex flex-col items-center gap-2 relative">
|
<div class="flex flex-col items-center gap-2 relative">
|
||||||
|
|
||||||
<img
|
<img
|
||||||
[attr.src]="urlHelper.getCoverUrl(metadata.bookId, metadata?.coverUpdatedOn)"
|
[attr.src]="urlHelper.getCoverUrl(metadata.bookId, metadata?.coverUpdatedOn)"
|
||||||
alt="Image"
|
alt="Image"
|
||||||
width="250"
|
width="250"
|
||||||
[ngClass]="{ 'brightness-50': isUploading }"
|
[ngClass]="{ 'brightness-50': isUploading }"
|
||||||
class="transition-all duration-300 ease-in-out"/>
|
class="transition-all duration-300 ease-in-out"/>
|
||||||
|
@if (isUploading) {
|
||||||
<p-progressSpinner
|
<p-progressSpinner
|
||||||
*ngIf="isUploading"
|
|
||||||
class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10">
|
class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 z-10">
|
||||||
</p-progressSpinner>
|
</p-progressSpinner>
|
||||||
|
}
|
||||||
<div class="flex items-center gap-6">
|
<div class="flex items-center gap-6">
|
||||||
<p-button
|
<p-button
|
||||||
icon="pi pi-refresh"
|
icon="pi pi-refresh"
|
||||||
@@ -30,7 +29,6 @@
|
|||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
[disabled]="metadata['coverLocked']">
|
[disabled]="metadata['coverLocked']">
|
||||||
</p-button>
|
</p-button>
|
||||||
|
|
||||||
<p-fileupload
|
<p-fileupload
|
||||||
pTooltip="Upload cover"
|
pTooltip="Upload cover"
|
||||||
tooltipPosition="top"
|
tooltipPosition="top"
|
||||||
@@ -47,221 +45,298 @@
|
|||||||
[auto]="true"
|
[auto]="true"
|
||||||
(onBeforeUpload)="onBeforeSend()">
|
(onBeforeUpload)="onBeforeSend()">
|
||||||
</p-fileupload>
|
</p-fileupload>
|
||||||
|
@if (!metadata['coverLocked']) {
|
||||||
<p-button *ngIf="!metadata['coverLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="success"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="success"></p-button>
|
||||||
<p-button *ngIf="metadata['coverLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="warn"></p-button>
|
}
|
||||||
|
@if (metadata['coverLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col flex-grow pl-2">
|
<div class="flex flex-col flex-grow pl-2">
|
||||||
|
|
||||||
<!-- Title and Subtitle -->
|
<!-- Title and Subtitle -->
|
||||||
<div class="flex flex-row w-full gap-4 pb-1">
|
<div class="flex flex-row w-full gap-4 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-2/3">
|
<div class="flex flex-col gap-1 w-2/3">
|
||||||
<label for="title">Title</label>
|
<label for="title">Title</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="title" formControlName="title" class="w-full"/>
|
<input pInputText id="title" formControlName="title" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['titleLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('title')" severity="success"></p-button>
|
@if (!metadata['titleLocked']) {
|
||||||
<p-button *ngIf="metadata['titleLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('title')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('title')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['titleLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('title')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/3">
|
<div class="flex flex-col gap-1 w-1/3">
|
||||||
<label for="subtitle">Subtitle</label>
|
<label for="subtitle">Subtitle</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="subtitle" formControlName="subtitle" class="w-full"/>
|
<input pInputText id="subtitle" formControlName="subtitle" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['subtitleLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('subtitle')" severity="success"></p-button>
|
@if (!metadata['subtitleLocked']) {
|
||||||
<p-button *ngIf="metadata['subtitleLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('subtitle')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('subtitle')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['subtitleLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('subtitle')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Authors and Publisher -->
|
<!-- Authors and Publisher -->
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-2/3">
|
<div class="flex flex-col gap-1 w-2/3">
|
||||||
<label for="authors">Authors</label>
|
<label for="authors">Authors</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="authors" formControlName="authors" class="w-full"/>
|
<input pInputText id="authors" formControlName="authors" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['authorsLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('authors')" severity="success"></p-button>
|
@if (!metadata['authorsLocked']) {
|
||||||
<p-button *ngIf="metadata['authorsLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('authors')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('authors')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['authorsLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('authors')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/3">
|
<div class="flex flex-col gap-1 w-1/3">
|
||||||
<label for="publisher">Publisher</label>
|
<label for="publisher">Publisher</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="publisher" formControlName="publisher" class="w-full"/>
|
<input pInputText id="publisher" formControlName="publisher" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['publisherLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('publisher')" severity="success"></p-button>
|
@if (!metadata['publisherLocked']) {
|
||||||
<p-button *ngIf="metadata['publisherLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('publisher')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('publisher')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['publisherLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('publisher')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Categories and Published Date -->
|
<!-- Categories and Published Date -->
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-3/4">
|
<div class="flex flex-col gap-1 w-3/4">
|
||||||
<label for="categories">Categories</label>
|
<label for="categories">Categories</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="categories" formControlName="categories" class="w-full"/>
|
<input pInputText id="categories" formControlName="categories" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['categoriesLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('categories')" severity="success"></p-button>
|
@if (!metadata['categoriesLocked']) {
|
||||||
<p-button *ngIf="metadata['categoriesLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('categories')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('categories')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['categoriesLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('categories')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/8">
|
<div class="flex flex-col gap-1 w-1/8">
|
||||||
<label for="publishedDate">Publish Date</label>
|
<label for="publishedDate">Publish Date</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="publishedDate" formControlName="publishedDate" class="w-full"/>
|
<input pInputText id="publishedDate" formControlName="publishedDate" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['publishedDateLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('publishedDate')" severity="success"></p-button>
|
@if (!metadata['publishedDateLocked']) {
|
||||||
<p-button *ngIf="metadata['publishedDateLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('publishedDate')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('publishedDate')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['publishedDateLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('publishedDate')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/8">
|
<div class="flex flex-col gap-1 w-1/8">
|
||||||
<label for="language">Language</label>
|
<label for="language">Language</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="language" formControlName="language" class="w-full"/>
|
<input pInputText id="language" formControlName="language" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['languageLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('language')" severity="success"></p-button>
|
@if (!metadata['languageLocked']) {
|
||||||
<p-button *ngIf="metadata['languageLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('language')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('language')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['languageLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('language')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-3/4">
|
<div class="flex flex-col gap-1 basis-3/4">
|
||||||
<label for="seriesName">Series Name</label>
|
<label for="seriesName">Series Name</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="seriesName" formControlName="seriesName" class="w-full"/>
|
<input pInputText id="seriesName" formControlName="seriesName" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['seriesNameLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="success"></p-button>
|
@if (!metadata['seriesNameLocked']) {
|
||||||
<p-button *ngIf="metadata['seriesNameLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['seriesNameLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-1/8">
|
<div class="flex flex-col gap-1 basis-1/8">
|
||||||
<label for="seriesNumber">Book Number</label>
|
<label for="seriesNumber">Book Number</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="seriesNumber" formControlName="seriesNumber" class="w-full"/>
|
<input pInputText id="seriesNumber" formControlName="seriesNumber" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['seriesNumberLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="success"></p-button>
|
@if (!metadata['seriesNumberLocked']) {
|
||||||
<p-button *ngIf="metadata['seriesNumberLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['seriesNumberLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-1/8">
|
<div class="flex flex-col gap-1 basis-1/8">
|
||||||
<label for="seriesTotal">Books in Series</label>
|
<label for="seriesTotal">Books in Series</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="seriesTotal" formControlName="seriesTotal" class="w-full"/>
|
<input pInputText id="seriesTotal" formControlName="seriesTotal" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['seriesTotalLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="success"></p-button>
|
@if (!metadata['seriesTotalLocked']) {
|
||||||
<p-button *ngIf="metadata['seriesTotalLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['seriesTotalLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ISBN, ASIN, Language -->
|
<!-- ISBN, ASIN, Language -->
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="isbn10">ISBN 10</label>
|
<label for="isbn10">ISBN 10</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="isbn10" formControlName="isbn10" class="w-full"/>
|
<input pInputText id="isbn10" formControlName="isbn10" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['isbn10Locked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="success"></p-button>
|
@if (!metadata['isbn10Locked']) {
|
||||||
<p-button *ngIf="metadata['isbn10Locked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['isbn10Locked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="isbn13">ISBN 13</label>
|
<label for="isbn13">ISBN 13</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="isbn13" formControlName="isbn13" class="w-full"/>
|
<input pInputText id="isbn13" formControlName="isbn13" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['isbn13Locked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="success"></p-button>
|
@if (!metadata['isbn13Locked']) {
|
||||||
<p-button *ngIf="metadata['isbn13Locked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['isbn13Locked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="asin">ASIN (Amazon ID)</label>
|
<label for="asin">ASIN (Amazon ID)</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="asin" formControlName="asin" class="w-full"/>
|
<input pInputText id="asin" formControlName="asin" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['asinLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('asin')" severity="success"></p-button>
|
@if (!metadata['asinLocked']) {
|
||||||
<p-button *ngIf="metadata['asinLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('asin')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('asin')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['asinLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('asin')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="amazonRating">Amazon ★</label>
|
<label for="amazonRating">Amazon ★</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="amazonRating" formControlName="amazonRating" class="w-full"/>
|
<input pInputText id="amazonRating" formControlName="amazonRating" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['amazonRatingLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="success"></p-button>
|
@if (!metadata['amazonRatingLocked']) {
|
||||||
<p-button *ngIf="metadata['amazonRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['amazonRatingLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="amazonRatingCount">Amazon Reviews</label>
|
<label for="amazonRatingCount">Amazon Reviews</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="amazonRatingCount" formControlName="amazonReviewCount" class="w-full"/>
|
<input pInputText id="amazonRatingCount" formControlName="amazonReviewCount" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['amazonReviewCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="success"></p-button>
|
@if (!metadata['amazonReviewCountLocked']) {
|
||||||
<p-button *ngIf="metadata['amazonReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['amazonReviewCountLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="googleId">Google Books ID</label>
|
<label for="googleId">Google Books ID</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="googleId" formControlName="googleId" class="w-full"/>
|
<input pInputText id="googleId" formControlName="googleId" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['googleIdLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('googleId')" severity="success"></p-button>
|
@if (!metadata['googleIdLocked']) {
|
||||||
<p-button *ngIf="metadata['googleIdLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('googleId')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('googleId')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['googleIdLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('googleId')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Ratings and Reviews -->
|
<!-- Ratings and Reviews -->
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="goodreadsId">Goodreads ID</label>
|
<label for="goodreadsId">Goodreads ID</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="goodreadsId" formControlName="goodreadsId" class="w-full"/>
|
<input pInputText id="goodreadsId" formControlName="goodreadsId" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['goodreadsIdLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="success"></p-button>
|
@if (!metadata['goodreadsIdLocked']) {
|
||||||
<p-button *ngIf="metadata['goodreadsIdLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['goodreadsIdLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="goodreadsRating">Goodreads ★</label>
|
<label for="goodreadsRating">Goodreads ★</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="goodreadsRating" formControlName="goodreadsRating" class="w-full"/>
|
<input pInputText id="goodreadsRating" formControlName="goodreadsRating" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['goodreadsRatingLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="success"></p-button>
|
@if (!metadata['goodreadsRatingLocked']) {
|
||||||
<p-button *ngIf="metadata['goodreadsRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['goodreadsRatingLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="goodreadsReviewCount">Goodreads Reviews</label>
|
<label for="goodreadsReviewCount">Goodreads Reviews</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount" class="w-full"/>
|
<input pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['goodreadsReviewCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="success"></p-button>
|
@if (!metadata['goodreadsReviewCountLocked']) {
|
||||||
<p-button *ngIf="metadata['goodreadsReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['goodreadsReviewCountLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="hardcoverId">Hardcover ID</label>
|
<label for="hardcoverId">Hardcover ID</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="hardcoverId" formControlName="hardcoverId" class="w-full"/>
|
<input pInputText id="hardcoverId" formControlName="hardcoverId" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['hardcoverIdLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="success"></p-button>
|
@if (!metadata['hardcoverIdLocked']) {
|
||||||
<p-button *ngIf="metadata['hardcoverIdLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['hardcoverIdLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="hardcoverRating">Hardcover ★</label>
|
<label for="hardcoverRating">Hardcover ★</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="hardcoverRating" formControlName="hardcoverRating" class="w-full"/>
|
<input pInputText id="hardcoverRating" formControlName="hardcoverRating" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['hardcoverRatingLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="success"></p-button>
|
@if (!metadata['hardcoverRatingLocked']) {
|
||||||
<p-button *ngIf="metadata['hardcoverRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['hardcoverRatingLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
<label for="hardcoverReviewCount">Hardcover Reviews</label>
|
<label for="hardcoverReviewCount">Hardcover Reviews</label>
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<input pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount" class="w-full"/>
|
<input pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount" class="w-full"/>
|
||||||
<p-button *ngIf="!metadata['hardcoverReviewCountLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="success"></p-button>
|
@if (!metadata['hardcoverReviewCountLocked']) {
|
||||||
<p-button *ngIf="metadata['hardcoverReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['hardcoverReviewCountLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-row w-full pb-1">
|
<div class="flex flex-row w-full pb-1">
|
||||||
<div class="flex flex-col gap-1 w-full">
|
<div class="flex flex-col gap-1 w-full">
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex justify-between items-center gap-2">
|
||||||
@@ -317,17 +392,18 @@
|
|||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
</p-tabpanels>
|
</p-tabpanels>
|
||||||
</p-tabs>
|
</p-tabs>
|
||||||
<p-button *ngIf="!metadata['descriptionLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('description')" severity="success"></p-button>
|
@if (!metadata['descriptionLocked']) {
|
||||||
<p-button *ngIf="metadata['descriptionLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('description')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('description')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['descriptionLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('description')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-x-4 mt-auto">
|
<div class="flex flex-col gap-x-4 mt-auto">
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
|
|
||||||
<div class="flex gap-x-4 justify-end">
|
<div class="flex gap-x-4 justify-end">
|
||||||
<p-button label="Unlock All" icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()"></p-button>
|
<p-button label="Unlock All" icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()"></p-button>
|
||||||
<p-button label="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()"></p-button>
|
<p-button label="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()"></p-button>
|
||||||
@@ -335,5 +411,5 @@
|
|||||||
<p-button label="Save" icon="pi pi-check" type="submit"></p-button>
|
<p-button label="Save" icon="pi pi-check" type="submit"></p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
}
|
||||||
|
|||||||
+1
-2
@@ -5,7 +5,7 @@ import {Divider} from 'primeng/divider';
|
|||||||
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
import {BookMetadataCenterService} from '../book-metadata-center.service';
|
import {BookMetadataCenterService} from '../book-metadata-center.service';
|
||||||
import {AsyncPipe, NgClass, NgIf} from '@angular/common';
|
import { AsyncPipe, NgClass } from '@angular/common';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
import {BookMetadata} from '../../../model/book.model';
|
import {BookMetadata} from '../../../model/book.model';
|
||||||
import {UrlHelperService} from '../../../../utilities/service/url-helper.service';
|
import {UrlHelperService} from '../../../../utilities/service/url-helper.service';
|
||||||
@@ -29,7 +29,6 @@ import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
|
|||||||
Divider,
|
Divider,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
NgIf,
|
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
FileUpload,
|
FileUpload,
|
||||||
ProgressSpinner,
|
ProgressSpinner,
|
||||||
|
|||||||
+36
-18
@@ -1,4 +1,5 @@
|
|||||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" *ngIf="bookMetadata$ | async as metadata" class="h-full flex pt-1 flex-col">
|
@if (bookMetadata$ | async; as metadata) {
|
||||||
|
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="h-full flex pt-1 flex-col">
|
||||||
<div class="overflow-y-scroll flex-1">
|
<div class="overflow-y-scroll flex-1">
|
||||||
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
||||||
<p class="ml-3 text-lg">Current Metadata</p>
|
<p class="ml-3 text-lg">Current Metadata</p>
|
||||||
@@ -18,12 +19,15 @@
|
|||||||
(onClick)="copyAll()"></p-button>
|
(onClick)="copyAll()"></p-button>
|
||||||
<p class="text-lg">Fetched Metadata</p>
|
<p class="text-lg">Fetched Metadata</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label class="label"></label>
|
<label class="label"></label>
|
||||||
<div class="input-container">
|
<div class="input-container">
|
||||||
<p-button *ngIf="!metadata['coverLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="success"></p-button>
|
@if (!metadata['coverLocked']) {
|
||||||
<p-button *ngIf="metadata['coverLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata['coverLocked']) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
<img [src]="metadataForm.get('thumbnailUrl')?.value" alt="Book Thumbnail" class="thumbnail"/>
|
<img [src]="metadataForm.get('thumbnailUrl')?.value" alt="Book Thumbnail" class="thumbnail"/>
|
||||||
<input type="hidden" id="thumbnailUrl" formControlName="thumbnailUrl" class="input"/>
|
<input type="hidden" id="thumbnailUrl" formControlName="thumbnailUrl" class="input"/>
|
||||||
<p-button
|
<p-button
|
||||||
@@ -43,12 +47,16 @@
|
|||||||
<img [src]="fetchedMetadata.thumbnailUrl ?? null" alt="Fetched Thumbnail" class="thumbnail"/>
|
<img [src]="fetchedMetadata.thumbnailUrl ?? null" alt="Fetched Thumbnail" class="thumbnail"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@for (field of metadataFieldsTop; track field) {
|
||||||
<div *ngFor="let field of metadataFieldsTop" class="form-row">
|
<div class="form-row">
|
||||||
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
||||||
<div class="input-container">
|
<div class="input-container">
|
||||||
<p-button *ngIf="!metadata[field.lockedKey]" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
@if (!metadata[field.lockedKey]) {
|
||||||
<p-button *ngIf="metadata[field.lockedKey]" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata[field.lockedKey]) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||||
|
}
|
||||||
<input pInputText id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"/>
|
<input pInputText id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"/>
|
||||||
<p-button
|
<p-button
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
||||||
@@ -66,12 +74,17 @@
|
|||||||
<input pInputText [value]="fetchedMetadata[field.fetchedKey] ?? null" class="input" readonly/>
|
<input pInputText [value]="fetchedMetadata[field.fetchedKey] ?? null" class="input" readonly/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div *ngFor="let field of metadataDescription" class="form-row">
|
@for (field of metadataDescription; track field) {
|
||||||
|
<div class="form-row">
|
||||||
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
||||||
<div class="input-container">
|
<div class="input-container">
|
||||||
<p-button *ngIf="!metadata[field.lockedKey]" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
@if (!metadata[field.lockedKey]) {
|
||||||
<p-button *ngIf="metadata[field.lockedKey]" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata[field.lockedKey]) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||||
|
}
|
||||||
<textarea rows="6" pTextarea id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"></textarea>
|
<textarea rows="6" pTextarea id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"></textarea>
|
||||||
<p-button
|
<p-button
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
||||||
@@ -89,12 +102,17 @@
|
|||||||
<textarea rows="6" pInputText [value]="fetchedMetadata[field.fetchedKey] ?? null" class="input" readonly></textarea>
|
<textarea rows="6" pInputText [value]="fetchedMetadata[field.fetchedKey] ?? null" class="input" readonly></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div *ngFor="let field of metadataFieldsBottom" class="form-row">
|
@for (field of metadataFieldsBottom; track field) {
|
||||||
|
<div class="form-row">
|
||||||
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
||||||
<div class="input-container">
|
<div class="input-container">
|
||||||
<p-button *ngIf="!metadata[field.lockedKey]" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
@if (!metadata[field.lockedKey]) {
|
||||||
<p-button *ngIf="metadata[field.lockedKey]" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||||
|
}
|
||||||
|
@if (metadata[field.lockedKey]) {
|
||||||
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||||
|
}
|
||||||
<input pInputText id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"/>
|
<input pInputText id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"/>
|
||||||
<p-button
|
<p-button
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
||||||
@@ -112,7 +130,7 @@
|
|||||||
<input pInputText [value]="fetchedMetadata[field.fetchedKey] ?? null" class="input" readonly/>
|
<input pInputText [value]="fetchedMetadata[field.fetchedKey] ?? null" class="input" readonly/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
||||||
<p class="ml-3 text-lg">Current Metadata</p>
|
<p class="ml-3 text-lg">Current Metadata</p>
|
||||||
<p-button
|
<p-button
|
||||||
@@ -132,7 +150,6 @@
|
|||||||
<p class="text-lg">Fetched Metadata</p>
|
<p class="text-lg">Fetched Metadata</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-x-4 mt-auto">
|
<div class="flex flex-col gap-x-4 mt-auto">
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
<div class="flex justify-between">
|
<div class="flex justify-between">
|
||||||
@@ -146,3 +163,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
}
|
||||||
|
|||||||
+1
-3
@@ -4,7 +4,7 @@ import {MessageService} from 'primeng/api';
|
|||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormControl, FormGroup, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
import {AsyncPipe, NgClass, NgForOf, NgIf, NgStyle} from '@angular/common';
|
import { AsyncPipe, NgClass, NgStyle } from '@angular/common';
|
||||||
import {Divider} from 'primeng/divider';
|
import {Divider} from 'primeng/divider';
|
||||||
import {BookMetadataCenterService} from '../book-metadata-center.service';
|
import {BookMetadataCenterService} from '../book-metadata-center.service';
|
||||||
import {Observable} from 'rxjs';
|
import {Observable} from 'rxjs';
|
||||||
@@ -22,14 +22,12 @@ import {Textarea} from 'primeng/textarea';
|
|||||||
Button,
|
Button,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
InputText,
|
InputText,
|
||||||
NgIf,
|
|
||||||
Divider,
|
Divider,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
NgClass,
|
NgClass,
|
||||||
NgStyle,
|
NgStyle,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
NgForOf,
|
|
||||||
Textarea
|
Textarea
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
|||||||
+15
-10
@@ -1,31 +1,31 @@
|
|||||||
<form *ngIf="!selectedFetchedMetadata" class="flex flex-col w-full h-full pt-2" [formGroup]="form" (ngSubmit)="onSubmit()">
|
@if (!selectedFetchedMetadata) {
|
||||||
|
<form class="flex flex-col w-full h-full pt-2" [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||||
<div class="flex w-full gap-x-4 items-end">
|
<div class="flex w-full gap-x-4 items-end">
|
||||||
<div class="flex flex-col gap-1 w-3/12">
|
<div class="flex flex-col gap-1 w-3/12">
|
||||||
<label>Providers</label>
|
<label>Providers</label>
|
||||||
<p-multiselect id="provider" class="w-full" [filter]="false" showToggleAll="false" [options]="providers" formControlName="provider" placeholder="Select Providers"></p-multiselect>
|
<p-multiselect id="provider" class="w-full" [filter]="false" showToggleAll="false" [options]="providers" formControlName="provider" placeholder="Select Providers"></p-multiselect>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 w-5/12">
|
<div class="flex flex-col gap-1 w-5/12">
|
||||||
<label for="title">Title</label>
|
<label for="title">Title</label>
|
||||||
<input pInputText formControlName="title" id="title" class="w-full"/>
|
<input pInputText formControlName="title" id="title" class="w-full"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 w-4/12">
|
<div class="flex flex-col gap-1 w-4/12">
|
||||||
<label for="author">Author</label>
|
<label for="author">Author</label>
|
||||||
<input pInputText formControlName="author" id="author" class="w-full"/>
|
<input pInputText formControlName="author" id="author" class="w-full"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p-button label="Search" type="submit" outlined="true" [disabled]="!isSearchEnabled || loading"></p-button>
|
<p-button label="Search" type="submit" outlined="true" [disabled]="!isSearchEnabled || loading"></p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if (loading) {
|
||||||
<div *ngIf="loading" class="flex justify-center items-center">
|
<div class="flex justify-center items-center">
|
||||||
<p-progress-spinner ariaLabel="loading"/>
|
<p-progress-spinner ariaLabel="loading"/>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div *ngIf="!loading" class="mt-8 flex-1 overflow-y-auto">
|
@if (!loading) {
|
||||||
<div *ngFor="let metadata of allFetchedMetadata" class="book-item flex flex-col w-full">
|
<div class="mt-8 flex-1 overflow-y-auto">
|
||||||
|
@for (metadata of allFetchedMetadata; track metadata) {
|
||||||
|
<div class="book-item flex flex-col w-full">
|
||||||
<div class="flex w-full flex-row book-item-content" (click)="onBookClick(metadata)">
|
<div class="flex w-full flex-row book-item-content" (click)="onBookClick(metadata)">
|
||||||
<img [src]="metadata.thumbnailUrl || 'assets/images/missing-cover.jpg'" alt="Image" class="img-fixed-dimensions pr-2"/>
|
<img [src]="metadata.thumbnailUrl || 'assets/images/missing-cover.jpg'" alt="Image" class="img-fixed-dimensions pr-2"/>
|
||||||
<div class=" flex flex-col w-full m-2">
|
<div class=" flex flex-col w-full m-2">
|
||||||
@@ -49,9 +49,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</form>
|
</form>
|
||||||
|
}
|
||||||
|
|
||||||
<div *ngIf="selectedFetchedMetadata" class="h-full flex-auto">
|
@if (selectedFetchedMetadata) {
|
||||||
|
<div class="h-full flex-auto">
|
||||||
<app-metadata-picker [fetchedMetadata]="selectedFetchedMetadata" (goBack)="onGoBack()"></app-metadata-picker>
|
<app-metadata-picker [fetchedMetadata]="selectedFetchedMetadata" (goBack)="onGoBack()"></app-metadata-picker>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ import {FormBuilder, FormGroup, ReactiveFormsModule} from '@angular/forms';
|
|||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
import {Divider} from 'primeng/divider';
|
import {Divider} from 'primeng/divider';
|
||||||
import {NgForOf, NgIf} from '@angular/common';
|
|
||||||
import {FetchMetadataRequest} from '../../model/request/fetch-metadata-request.model';
|
import {FetchMetadataRequest} from '../../model/request/fetch-metadata-request.model';
|
||||||
import {ProgressSpinner} from 'primeng/progressspinner';
|
import {ProgressSpinner} from 'primeng/progressspinner';
|
||||||
import {MetadataPickerComponent} from '../metadata-picker/metadata-picker.component';
|
import {MetadataPickerComponent} from '../metadata-picker/metadata-picker.component';
|
||||||
@@ -21,7 +21,7 @@ import {ActivatedRoute} from '@angular/router';
|
|||||||
selector: 'app-metadata-searcher',
|
selector: 'app-metadata-searcher',
|
||||||
templateUrl: './metadata-searcher.component.html',
|
templateUrl: './metadata-searcher.component.html',
|
||||||
styleUrls: ['./metadata-searcher.component.scss'],
|
styleUrls: ['./metadata-searcher.component.scss'],
|
||||||
imports: [ReactiveFormsModule, Button, InputText, Divider, NgForOf, NgIf, ProgressSpinner, MetadataPickerComponent, MultiSelect],
|
imports: [ReactiveFormsModule, Button, InputText, Divider, ProgressSpinner, MetadataPickerComponent, MultiSelect],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
export class MetadataSearcherComponent implements OnInit, OnDestroy {
|
||||||
|
|||||||
+74
-66
@@ -1,5 +1,6 @@
|
|||||||
<div class="pt-2 flex flex-col h-full overflow-hidden">
|
<div class="pt-2 flex flex-col h-full overflow-hidden">
|
||||||
<div *ngIf="metadata$ | async as metadata">
|
@if (metadata$ | async; as metadata) {
|
||||||
|
<div>
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row">
|
||||||
<div class="cover-wrapper relative">
|
<div class="cover-wrapper relative">
|
||||||
<img
|
<img
|
||||||
@@ -10,21 +11,22 @@
|
|||||||
width="225"
|
width="225"
|
||||||
style="min-width: 225px;"
|
style="min-width: 225px;"
|
||||||
/>
|
/>
|
||||||
|
@if (getProgressPercent() !== null) {
|
||||||
<p-progressBar
|
<p-progressBar
|
||||||
*ngIf="getProgressPercent() !== null"
|
|
||||||
[value]="getProgressPercent()"
|
[value]="getProgressPercent()"
|
||||||
[showValue]="true"
|
[showValue]="true"
|
||||||
[ngClass]="{ 'progress-complete': getProgressPercent() === 100, 'progress-incomplete': getProgressPercent()! < 100 }"
|
[ngClass]="{ 'progress-complete': getProgressPercent() === 100, 'progress-incomplete': getProgressPercent()! < 100 }"
|
||||||
[style]="{ height: '10px' }">
|
[style]="{ height: '10px' }">
|
||||||
</p-progressBar>
|
</p-progressBar>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col justify-between">
|
<div class="flex flex-col justify-between">
|
||||||
<div class="pl-6 flex flex-col w-full">
|
<div class="pl-6 flex flex-col w-full">
|
||||||
<div class="flex flex-row items-center justify-between">
|
<div class="flex flex-row items-center justify-between">
|
||||||
<div>
|
<div>
|
||||||
<p *ngIf="metadata.seriesName" class="italic">{{ metadata.seriesName }} #{{ metadata.seriesNumber }}</p>
|
@if (metadata.seriesName) {
|
||||||
|
<p class="italic">{{ metadata.seriesName }} #{{ metadata.seriesNumber }}</p>
|
||||||
|
}
|
||||||
<div class="flex items-center gap-2">
|
<div class="flex items-center gap-2">
|
||||||
<p class="text-2xl font-bold m-0">{{ metadata.title }}</p>
|
<p class="text-2xl font-bold m-0">{{ metadata.title }}</p>
|
||||||
<i
|
<i
|
||||||
@@ -39,76 +41,77 @@
|
|||||||
<p class="text-xl">{{ getAuthorNames(metadata?.authors || []) }}</p>
|
<p class="text-xl">{{ getAuthorNames(metadata?.authors || []) }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex items-center gap-2 pt-2">
|
<div class="flex items-center gap-2 pt-2">
|
||||||
<ng-container *ngIf="metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating; else legacyRating">
|
@if (metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating) {
|
||||||
<ng-container *ngIf="metadata.amazonRating">
|
@if (metadata.amazonRating) {
|
||||||
<ng-container *ngIf="metadata.asin; else amazonStatic">
|
@if (metadata.asin) {
|
||||||
<a class="flex items-center gap-1" [href]="'https://www.amazon.com/dp/' + metadata.asin" target="_blank" rel="noopener noreferrer">
|
<a class="flex items-center gap-1" [href]="'https://www.amazon.com/dp/' + metadata.asin" target="_blank" rel="noopener noreferrer">
|
||||||
<img src="https://www.amazon.com/favicon.ico" alt="Amazon" class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg" />
|
<img src="https://www.amazon.com/favicon.ico" alt="Amazon" class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg" />
|
||||||
<p class="font-semibold">{{ metadata.amazonRating }}</p>
|
<p class="font-semibold">{{ metadata.amazonRating }}</p>
|
||||||
</a>
|
</a>
|
||||||
</ng-container>
|
} @else {
|
||||||
<ng-template #amazonStatic>
|
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
<img src="https://www.amazon.com/favicon.ico" alt="Amazon" class="w-5 h-5 object-contain" />
|
<img src="https://www.amazon.com/favicon.ico" alt="Amazon" class="w-5 h-5 object-contain" />
|
||||||
<p class="font-semibold">{{ metadata.amazonRating }}</p>
|
<p class="font-semibold">{{ metadata.amazonRating }}</p>
|
||||||
</span>
|
</span>
|
||||||
</ng-template>
|
}
|
||||||
<p-rating [ngModel]="metadata.amazonRating" readonly stars="5"
|
<p-rating [ngModel]="metadata.amazonRating" readonly stars="5"
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)">
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)">
|
||||||
</p-rating>
|
</p-rating>
|
||||||
<p class="font-semibold">({{ metadata.amazonReviewCount | number:'1.0-0' }})</p>
|
<p class="font-semibold">({{ metadata.amazonReviewCount | number:'1.0-0' }})</p>
|
||||||
<span *ngIf="metadata.goodreadsRating || metadata.hardcoverRating">|</span>
|
@if (metadata.goodreadsRating || metadata.hardcoverRating) {
|
||||||
</ng-container>
|
<span>|</span>
|
||||||
|
}
|
||||||
<ng-container *ngIf="metadata.goodreadsRating">
|
}
|
||||||
<ng-container *ngIf="metadata.goodreadsId; else goodreadsStatic">
|
@if (metadata.goodreadsRating) {
|
||||||
|
@if (metadata.goodreadsId) {
|
||||||
<a class="flex items-center gap-1" [href]="'https://www.goodreads.com/book/show/' + metadata.goodreadsId" target="_blank" rel="noopener noreferrer">
|
<a class="flex items-center gap-1" [href]="'https://www.goodreads.com/book/show/' + metadata.goodreadsId" target="_blank" rel="noopener noreferrer">
|
||||||
<img src="https://www.goodreads.com/favicon.ico" alt="Goodreads" class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg" />
|
<img src="https://www.goodreads.com/favicon.ico" alt="Goodreads" class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg" />
|
||||||
<p class="font-semibold">{{ metadata.goodreadsRating }}</p>
|
<p class="font-semibold">{{ metadata.goodreadsRating }}</p>
|
||||||
</a>
|
</a>
|
||||||
</ng-container>
|
} @else {
|
||||||
<ng-template #goodreadsStatic>
|
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
<img src="https://www.goodreads.com/favicon.ico" alt="Goodreads" class="w-5 h-5 object-contain" />
|
<img src="https://www.goodreads.com/favicon.ico" alt="Goodreads" class="w-5 h-5 object-contain" />
|
||||||
<p class="font-semibold">{{ metadata.goodreadsRating }}</p>
|
<p class="font-semibold">{{ metadata.goodreadsRating }}</p>
|
||||||
</span>
|
</span>
|
||||||
</ng-template>
|
}
|
||||||
<p-rating [ngModel]="metadata.goodreadsRating" readonly stars="5"
|
<p-rating [ngModel]="metadata.goodreadsRating" readonly stars="5"
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
||||||
</p-rating>
|
</p-rating>
|
||||||
<p class="font-semibold">({{ metadata.goodreadsReviewCount | number:'1.0-0' }})</p>
|
<p class="font-semibold">({{ metadata.goodreadsReviewCount | number:'1.0-0' }})</p>
|
||||||
<span *ngIf="metadata.hardcoverRating">|</span>
|
@if (metadata.hardcoverRating) {
|
||||||
</ng-container>
|
<span>|</span>
|
||||||
|
}
|
||||||
<ng-container *ngIf="metadata.hardcoverRating">
|
}
|
||||||
<ng-container *ngIf="metadata.hardcoverId; else hardcoverStatic">
|
@if (metadata.hardcoverRating) {
|
||||||
|
@if (metadata.hardcoverId) {
|
||||||
<a class="flex items-center gap-1" [href]="'https://hardcover.app/books/' + metadata.hardcoverId" target="_blank" rel="noopener noreferrer">
|
<a class="flex items-center gap-1" [href]="'https://hardcover.app/books/' + metadata.hardcoverId" target="_blank" rel="noopener noreferrer">
|
||||||
<img src="https://assets.hardcover.app/static/favicon.ico" alt="Hardcover" class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg" />
|
<img src="https://assets.hardcover.app/static/favicon.ico" alt="Hardcover" class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg" />
|
||||||
<p class="font-semibold">{{ metadata.hardcoverRating }}</p>
|
<p class="font-semibold">{{ metadata.hardcoverRating }}</p>
|
||||||
</a>
|
</a>
|
||||||
</ng-container>
|
} @else {
|
||||||
<ng-template #hardcoverStatic>
|
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
<img src="https://assets.hardcover.app/static/favicon.ico" alt="Hardcover" class="w-5 h-5 object-contain" />
|
<img src="https://assets.hardcover.app/static/favicon.ico" alt="Hardcover" class="w-5 h-5 object-contain" />
|
||||||
<p class="font-semibold">{{ metadata.hardcoverRating }}</p>
|
<p class="font-semibold">{{ metadata.hardcoverRating }}</p>
|
||||||
</span>
|
</span>
|
||||||
</ng-template>
|
}
|
||||||
<p-rating [ngModel]="metadata.hardcoverRating" readonly stars="5"
|
<p-rating [ngModel]="metadata.hardcoverRating" readonly stars="5"
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
||||||
</p-rating>
|
</p-rating>
|
||||||
<p class="font-semibold">({{ metadata.hardcoverReviewCount | number:'1.0-0' }})</p>
|
<p class="font-semibold">({{ metadata.hardcoverReviewCount | number:'1.0-0' }})</p>
|
||||||
<span *ngIf="(metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating) && metadata.googleId">|</span>
|
@if ((metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating) && metadata.googleId) {
|
||||||
</ng-container>
|
<span>|</span>
|
||||||
<ng-container *ngIf="metadata.googleId">
|
}
|
||||||
|
}
|
||||||
|
@if (metadata.googleId) {
|
||||||
<a class="flex items-center gap-1" [href]="'https://books.google.com/books?id=' + metadata.googleId" target="_blank" rel="noopener noreferrer">
|
<a class="flex items-center gap-1" [href]="'https://books.google.com/books?id=' + metadata.googleId" target="_blank" rel="noopener noreferrer">
|
||||||
<img src="https://books.google.com/favicon.ico" alt="Google Books" class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg" />
|
<img src="https://books.google.com/favicon.ico" alt="Google Books" class="w-5 h-5 object-contain transform transition duration-200 hover:scale-125 hover:drop-shadow-lg" />
|
||||||
</a>
|
</a>
|
||||||
</ng-container>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ng-template #legacyRating>
|
}
|
||||||
|
|
||||||
|
} @else {
|
||||||
|
|
||||||
<p-rating
|
<p-rating
|
||||||
[(ngModel)]="metadata.rating"
|
[(ngModel)]="metadata.rating"
|
||||||
readonly
|
readonly
|
||||||
@@ -118,13 +121,13 @@
|
|||||||
<p class="font-semibold">
|
<p class="font-semibold">
|
||||||
{{ metadata?.reviewCount ? '(' + (metadata?.reviewCount | number:'1.0-0') + ' Ratings)' : 'No Ratings' }}
|
{{ metadata?.reviewCount ? '(' + (metadata?.reviewCount | number:'1.0-0') + ' Ratings)' : 'No Ratings' }}
|
||||||
</p>
|
</p>
|
||||||
</ng-template>
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex gap-2 pt-4 overflow-x-auto scrollbar-hide">
|
<div class="flex gap-2 pt-4 overflow-x-auto scrollbar-hide">
|
||||||
<p-tag *ngFor="let category of metadata.categories" [value]="category" class="shrink-0"></p-tag>
|
@for (category of metadata.categories; track category) {
|
||||||
|
<p-tag [value]="category" class="shrink-0"></p-tag>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid gap-x-20 gap-y-2 pt-6" style="grid-template-columns: repeat(5, max-content);">
|
<div class="grid gap-x-20 gap-y-2 pt-6" style="grid-template-columns: repeat(5, max-content);">
|
||||||
<p class="whitespace-nowrap flex items-center gap-2">
|
<p class="whitespace-nowrap flex items-center gap-2">
|
||||||
<span class="font-bold">File Type:</span>
|
<span class="font-bold">File Type:</span>
|
||||||
@@ -143,7 +146,6 @@
|
|||||||
<p class="whitespace-nowrap"><span class="font-bold">File Size:</span> {{ getFileSizeInMB() }}</p>
|
<p class="whitespace-nowrap"><span class="font-bold">File Size:</span> {{ getFileSizeInMB() }}</p>
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">Progress:</span> {{ getProgressPercent() !== null ? getProgressPercent() + '%' : '-' }}</p>
|
<p class="whitespace-nowrap"><span class="font-bold">Progress:</span> {{ getProgressPercent() !== null ? getProgressPercent() + '%' : '-' }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pt-2 flex items-center gap-2 w-full">
|
<div class="pt-2 flex items-center gap-2 w-full">
|
||||||
<span class="font-semibold flex-shrink-0">File Path:</span>
|
<span class="font-semibold flex-shrink-0">File Path:</span>
|
||||||
<p-toggleButton
|
<p-toggleButton
|
||||||
@@ -154,9 +156,9 @@
|
|||||||
offLabel=""
|
offLabel=""
|
||||||
size="small"
|
size="small"
|
||||||
class="flex-shrink-0"></p-toggleButton>
|
class="flex-shrink-0"></p-toggleButton>
|
||||||
|
@if (showFilePath) {
|
||||||
<div
|
<div
|
||||||
class="flex items-center gap-4 flex-grow"
|
class="flex items-center gap-4 flex-grow"
|
||||||
*ngIf="showFilePath"
|
|
||||||
style="min-width: 0;">
|
style="min-width: 0;">
|
||||||
<p
|
<p
|
||||||
class="font-mono text-sm text-gray-400 overflow-x-auto whitespace-nowrap flex-grow"
|
class="font-mono text-sm text-gray-400 overflow-x-auto whitespace-nowrap flex-grow"
|
||||||
@@ -164,25 +166,26 @@
|
|||||||
{{ book?.filePath }}
|
{{ book?.filePath }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if (userService.userState$ | async; as userData) {
|
||||||
<div *ngIf="userService.userState$ | async as userData" class="pl-6 pt-4 flex flex-row w-full gap-4">
|
<div class="pl-6 pt-4 flex flex-row w-full gap-4">
|
||||||
|
@if (book!.bookType === 'PDF') {
|
||||||
<p-splitbutton
|
<p-splitbutton
|
||||||
*ngIf="book!.bookType === 'PDF'"
|
|
||||||
label="Read"
|
label="Read"
|
||||||
icon="pi pi-book"
|
icon="pi pi-book"
|
||||||
[model]="readMenuItems"
|
[model]="readMenuItems"
|
||||||
(onClick)="read(metadata.bookId, 'ngx')"
|
(onClick)="read(metadata.bookId, 'ngx')"
|
||||||
severity="info"/>
|
severity="info"/>
|
||||||
|
}
|
||||||
|
@if (book!.bookType !== 'PDF') {
|
||||||
<p-button
|
<p-button
|
||||||
*ngIf="book!.bookType !== 'PDF'"
|
|
||||||
label="Read"
|
label="Read"
|
||||||
icon="pi pi-book"
|
icon="pi pi-book"
|
||||||
(onClick)="read(metadata.bookId, undefined)"
|
(onClick)="read(metadata.bookId, undefined)"
|
||||||
severity="info"/>
|
severity="info"/>
|
||||||
|
}
|
||||||
<p-button
|
<p-button
|
||||||
label="Assign Shelf"
|
label="Assign Shelf"
|
||||||
icon="pi pi-folder"
|
icon="pi pi-folder"
|
||||||
@@ -190,18 +193,17 @@
|
|||||||
outlined
|
outlined
|
||||||
(onClick)="assignShelf(metadata.bookId)">
|
(onClick)="assignShelf(metadata.bookId)">
|
||||||
</p-button>
|
</p-button>
|
||||||
|
@if (userData.permissions.canDownload || userData.permissions.admin) {
|
||||||
<p-button
|
<p-button
|
||||||
*ngIf="userData.permissions.canDownload || userData.permissions.admin"
|
|
||||||
label="Download"
|
label="Download"
|
||||||
icon="pi pi-download"
|
icon="pi pi-download"
|
||||||
severity="info"
|
severity="info"
|
||||||
outlined
|
outlined
|
||||||
(onClick)="download(metadata.bookId)">
|
(onClick)="download(metadata.bookId)">
|
||||||
</p-button>
|
</p-button>
|
||||||
|
}
|
||||||
|
@if (userData.permissions.canEmailBook || userData.permissions.admin) {
|
||||||
<p-splitbutton
|
<p-splitbutton
|
||||||
*ngIf="userData.permissions.canEmailBook || userData.permissions.admin"
|
|
||||||
label="Quick Send"
|
label="Quick Send"
|
||||||
icon="pi pi-send"
|
icon="pi pi-send"
|
||||||
[model]="emailMenuItems"
|
[model]="emailMenuItems"
|
||||||
@@ -209,9 +211,9 @@
|
|||||||
outlined
|
outlined
|
||||||
severity="info">
|
severity="info">
|
||||||
</p-splitbutton>
|
</p-splitbutton>
|
||||||
|
}
|
||||||
|
@if (userData.permissions.canEditMetadata || userData.permissions.admin) {
|
||||||
<p-splitbutton
|
<p-splitbutton
|
||||||
*ngIf="userData.permissions.canEditMetadata || userData.permissions.admin"
|
|
||||||
label="Quick Refresh"
|
label="Quick Refresh"
|
||||||
icon="pi pi-bolt"
|
icon="pi pi-bolt"
|
||||||
[model]="refreshMenuItems"
|
[model]="refreshMenuItems"
|
||||||
@@ -219,14 +221,18 @@
|
|||||||
outlined
|
outlined
|
||||||
severity="info">
|
severity="info">
|
||||||
</p-splitbutton>
|
</p-splitbutton>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
|
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
|
|
||||||
<div *ngIf="metadata$ | async as metadata" class="flex-1 overflow-auto space-y-2 px-2">
|
@if (metadata$ | async; as metadata) {
|
||||||
|
<div class="flex-1 overflow-auto space-y-2 px-2">
|
||||||
<div [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }" class="transition-all duration-300 overflow-hidden description-container">
|
<div [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }" class="transition-all duration-300 overflow-hidden description-container">
|
||||||
<div class="readonly-editor px-2">
|
<div class="readonly-editor px-2">
|
||||||
<p-editor #quillEditor [readonly]="true" [style]="{height: '250px'}" [(ngModel)]="metadata.description">
|
<p-editor #quillEditor [readonly]="true" [style]="{height: '250px'}" [(ngModel)]="metadata.description">
|
||||||
@@ -235,8 +241,8 @@
|
|||||||
</p-editor>
|
</p-editor>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if (metadata.description && metadata.description.length > 100) {
|
||||||
<div *ngIf="metadata.description && metadata.description.length > 100" class="text-left">
|
<div class="text-left">
|
||||||
<button pButton
|
<button pButton
|
||||||
type="button"
|
type="button"
|
||||||
[label]="isExpanded ? 'Show less' : 'Show more'"
|
[label]="isExpanded ? 'Show less' : 'Show more'"
|
||||||
@@ -246,10 +252,9 @@
|
|||||||
(click)="toggleExpand()">
|
(click)="toggleExpand()">
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
|
@if (bookInSeries.length > 0) {
|
||||||
<ng-container *ngIf="bookInSeries.length > 0">
|
|
||||||
<div>
|
<div>
|
||||||
<h3 class="text-xl font-semibold pt-2">More in the Series</h3>
|
<h3 class="text-xl font-semibold pt-2">More in the Series</h3>
|
||||||
<div class="dashboard-scroller-infinite"
|
<div class="dashboard-scroller-infinite"
|
||||||
@@ -257,7 +262,8 @@
|
|||||||
[infiniteScrollDistance]="2"
|
[infiniteScrollDistance]="2"
|
||||||
[infiniteScrollThrottle]="50"
|
[infiniteScrollThrottle]="50"
|
||||||
[horizontal]="true">
|
[horizontal]="true">
|
||||||
<div class="dashboard-scroller-card" *ngFor="let book of bookInSeries">
|
@for (book of bookInSeries; track book) {
|
||||||
|
<div class="dashboard-scroller-card">
|
||||||
<app-book-card
|
<app-book-card
|
||||||
[book]="book"
|
[book]="book"
|
||||||
[isCheckboxEnabled]="false"
|
[isCheckboxEnabled]="false"
|
||||||
@@ -265,12 +271,12 @@
|
|||||||
[bottomBarHidden]="true">
|
[bottomBarHidden]="true">
|
||||||
</app-book-card>
|
</app-book-card>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
</ng-container>
|
}
|
||||||
|
@if (recommendedBooks.length > 0) {
|
||||||
<ng-container *ngIf="recommendedBooks.length > 0">
|
|
||||||
<div>
|
<div>
|
||||||
<h3 class="text-xl font-semibold">Similar Books</h3>
|
<h3 class="text-xl font-semibold">Similar Books</h3>
|
||||||
<div class="dashboard-scroller-infinite"
|
<div class="dashboard-scroller-infinite"
|
||||||
@@ -278,7 +284,8 @@
|
|||||||
[infiniteScrollDistance]="2"
|
[infiniteScrollDistance]="2"
|
||||||
[infiniteScrollThrottle]="50"
|
[infiniteScrollThrottle]="50"
|
||||||
[horizontal]="true">
|
[horizontal]="true">
|
||||||
<div class="dashboard-scroller-card" *ngFor="let book of recommendedBooks">
|
@for (book of recommendedBooks; track book) {
|
||||||
|
<div class="dashboard-scroller-card">
|
||||||
<app-book-card
|
<app-book-card
|
||||||
[book]="book.book"
|
[book]="book.book"
|
||||||
[isCheckboxEnabled]="false"
|
[isCheckboxEnabled]="false"
|
||||||
@@ -286,10 +293,11 @@
|
|||||||
[bottomBarHidden]="true">
|
[bottomBarHidden]="true">
|
||||||
</app-book-card>
|
</app-book-card>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
</ng-container>
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
import {Component, DestroyRef, inject, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
|
import {Component, DestroyRef, inject, Input, OnChanges, OnInit, SimpleChanges, ViewChild} from '@angular/core';
|
||||||
import {Button, ButtonDirective} from 'primeng/button';
|
import {Button, ButtonDirective} from 'primeng/button';
|
||||||
import {AsyncPipe, DecimalPipe, NgClass, NgForOf, NgIf} from '@angular/common';
|
import { AsyncPipe, DecimalPipe, NgClass } from '@angular/common';
|
||||||
import {first, Observable} from 'rxjs';
|
import {first, Observable} from 'rxjs';
|
||||||
import {BookService} from '../../../service/book.service';
|
import {BookService} from '../../../service/book.service';
|
||||||
import {BookMetadataCenterService} from '../book-metadata-center.service';
|
import {BookMetadataCenterService} from '../book-metadata-center.service';
|
||||||
@@ -33,7 +33,7 @@ import {MetadataRefreshRequest} from '../../model/request/metadata-refresh-reque
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
templateUrl: './metadata-viewer.component.html',
|
templateUrl: './metadata-viewer.component.html',
|
||||||
styleUrl: './metadata-viewer.component.scss',
|
styleUrl: './metadata-viewer.component.scss',
|
||||||
imports: [Button, NgForOf, NgIf, AsyncPipe, Rating, FormsModule, Tag, Divider, SplitButton, NgClass, Tooltip, DecimalPipe, InfiniteScrollDirective, BookCardComponent, ButtonDirective, Editor, ProgressBar, ToggleButton]
|
imports: [Button, AsyncPipe, Rating, FormsModule, Tag, Divider, SplitButton, NgClass, Tooltip, DecimalPipe, InfiniteScrollDirective, BookCardComponent, ButtonDirective, Editor, ProgressBar, ToggleButton]
|
||||||
})
|
})
|
||||||
export class MetadataViewerComponent implements OnInit, OnChanges {
|
export class MetadataViewerComponent implements OnInit, OnChanges {
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -43,7 +43,8 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr *ngFor="let field of fields" [hidden]="field === 'cover' && !refreshCovers">
|
@for (field of fields; track field) {
|
||||||
|
<tr [hidden]="field === 'cover' && !refreshCovers">
|
||||||
<td class="px-4 py-2 text-gray-300">{{ formatLabel(field) }}</td>
|
<td class="px-4 py-2 text-gray-300">{{ formatLabel(field) }}</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p4"
|
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p4"
|
||||||
@@ -70,6 +71,7 @@
|
|||||||
</p-select>
|
</p-select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -3,7 +3,7 @@ import {
|
|||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
import {Select, SelectChangeEvent} from 'primeng/select';
|
import {Select, SelectChangeEvent} from 'primeng/select';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {NgForOf} from '@angular/common';
|
|
||||||
import {Checkbox} from 'primeng/checkbox';
|
import {Checkbox} from 'primeng/checkbox';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-metadata-advanced-fetch-options',
|
selector: 'app-metadata-advanced-fetch-options',
|
||||||
templateUrl: './metadata-advanced-fetch-options.component.html',
|
templateUrl: './metadata-advanced-fetch-options.component.html',
|
||||||
imports: [Select, FormsModule, NgForOf, Checkbox, Button],
|
imports: [Select, FormsModule, Checkbox, Button],
|
||||||
styleUrl: './metadata-advanced-fetch-options.component.scss',
|
styleUrl: './metadata-advanced-fetch-options.component.scss',
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -17,13 +17,19 @@
|
|||||||
<div class="p-field">
|
<div class="p-field">
|
||||||
<label for="confirmNewPassword">Confirm New Password</label>
|
<label for="confirmNewPassword">Confirm New Password</label>
|
||||||
<p-password id="confirmNewPassword" [(ngModel)]="confirmNewPassword" name="confirmNewPassword" [feedback]="false" required fluid></p-password>
|
<p-password id="confirmNewPassword" [(ngModel)]="confirmNewPassword" name="confirmNewPassword" [feedback]="false" required fluid></p-password>
|
||||||
<p-message *ngIf="!passwordsMatch && confirmNewPassword" severity="error" text="New passwords do not match."></p-message>
|
@if (!passwordsMatch && confirmNewPassword) {
|
||||||
|
<p-message severity="error" text="New passwords do not match."></p-message>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p-button type="submit" label="Change Password" icon="pi pi-key" class="p-fluid"></p-button>
|
<p-button type="submit" label="Change Password" icon="pi pi-key" class="p-fluid"></p-button>
|
||||||
|
|
||||||
<p-message *ngIf="errorMessage" severity="error" text="{{ errorMessage }}"></p-message>
|
@if (errorMessage) {
|
||||||
<p-message *ngIf="successMessage" severity="success" text="{{ successMessage }}"></p-message>
|
<p-message severity="error" text="{{ errorMessage }}"></p-message>
|
||||||
|
}
|
||||||
|
@if (successMessage) {
|
||||||
|
<p-message severity="success" text="{{ successMessage }}"></p-message>
|
||||||
|
}
|
||||||
</form>
|
</form>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-card>
|
</p-card>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {Button} from 'primeng/button';
|
|||||||
import {Card} from 'primeng/card';
|
import {Card} from 'primeng/card';
|
||||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {Message} from 'primeng/message';
|
import {Message} from 'primeng/message';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {Password} from 'primeng/password';
|
import {Password} from 'primeng/password';
|
||||||
import {MessageService, PrimeTemplate} from 'primeng/api';
|
import {MessageService, PrimeTemplate} from 'primeng/api';
|
||||||
import {UserService} from '../../../settings/user-management/user.service';
|
import {UserService} from '../../../settings/user-management/user.service';
|
||||||
@@ -17,7 +17,6 @@ import {AuthService} from '../../service/auth.service';
|
|||||||
Card,
|
Card,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
Message,
|
Message,
|
||||||
NgIf,
|
|
||||||
Password,
|
Password,
|
||||||
PrimeTemplate,
|
PrimeTemplate,
|
||||||
ReactiveFormsModule
|
ReactiveFormsModule
|
||||||
|
|||||||
@@ -24,11 +24,15 @@
|
|||||||
icon="pi pi-sign-in"
|
icon="pi pi-sign-in"
|
||||||
[disabled]="!loginForm.valid || !username || !password">
|
[disabled]="!loginForm.valid || !username || !password">
|
||||||
</p-button>
|
</p-button>
|
||||||
<p-message *ngIf="errorMessage" severity="error" text="{{ errorMessage }}"></p-message>
|
@if (errorMessage) {
|
||||||
<div *ngIf="oidcEnabled">
|
<p-message severity="error" text="{{ errorMessage }}"></p-message>
|
||||||
|
}
|
||||||
|
@if (oidcEnabled) {
|
||||||
|
<div>
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
<p-button fluid severity="info" type="button" label="Login with OIDC" icon="pi pi-id-card" (click)="loginWithOidc()"></p-button>
|
<p-button fluid severity="info" type="button" label="Login with OIDC" icon="pi pi-id-card" (click)="loginWithOidc()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {Component, inject, OnInit} from '@angular/core';
|
|||||||
import {AuthService} from '../../service/auth.service';
|
import {AuthService} from '../../service/auth.service';
|
||||||
import {Router} from '@angular/router';
|
import {Router} from '@angular/router';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {Card} from 'primeng/card';
|
import {Card} from 'primeng/card';
|
||||||
import {Password} from 'primeng/password';
|
import {Password} from 'primeng/password';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
@@ -20,7 +20,6 @@ import {filter, take} from 'rxjs/operators';
|
|||||||
selector: 'app-login',
|
selector: 'app-login',
|
||||||
imports: [
|
imports: [
|
||||||
FormsModule,
|
FormsModule,
|
||||||
NgIf,
|
|
||||||
Card,
|
Card,
|
||||||
Password,
|
Password,
|
||||||
Button,
|
Button,
|
||||||
|
|||||||
+12
-7
@@ -29,9 +29,11 @@
|
|||||||
[disabled]="!isOidcFormComplete()"
|
[disabled]="!isOidcFormComplete()"
|
||||||
(onChange)="toggleOidcEnabled()">
|
(onChange)="toggleOidcEnabled()">
|
||||||
</p-toggleswitch>
|
</p-toggleswitch>
|
||||||
<div *ngIf="!isOidcFormComplete()" class="text-sm text-gray-400">
|
@if (!isOidcFormComplete()) {
|
||||||
|
<div class="text-sm text-gray-400">
|
||||||
(Fill all required fields to enable)
|
(Fill all required fields to enable)
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class=" pt-8">OIDC Provider Settings:</p>
|
<p class=" pt-8">OIDC Provider Settings:</p>
|
||||||
@@ -137,7 +139,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="oidcEnabled">
|
@if (oidcEnabled) {
|
||||||
|
<div>
|
||||||
<p class=" pt-6">OIDC User Provisioning:</p>
|
<p class=" pt-6">OIDC User Provisioning:</p>
|
||||||
<div class="pl-6 space-y-6 p-4 m-4 custom-border">
|
<div class="pl-6 space-y-6 p-4 m-4 custom-border">
|
||||||
<div>
|
<div>
|
||||||
@@ -156,8 +159,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if (autoUserProvisioningEnabled) {
|
||||||
<div *ngIf="autoUserProvisioningEnabled">
|
<div>
|
||||||
<p class=" pt-8">Default permissions for auto-provisioned users:</p>
|
<p class=" pt-8">Default permissions for auto-provisioned users:</p>
|
||||||
<div class="flex items-center gap-2 pl-6 pt-2">
|
<div class="flex items-center gap-2 pl-6 pt-2">
|
||||||
<p-checkbox
|
<p-checkbox
|
||||||
@@ -168,8 +171,8 @@
|
|||||||
</p-checkbox>
|
</p-checkbox>
|
||||||
<label class="text-sm">Read Books</label>
|
<label class="text-sm">Read Books</label>
|
||||||
</div>
|
</div>
|
||||||
|
@for (perm of availablePermissions; track perm) {
|
||||||
<div *ngFor="let perm of availablePermissions" class="flex items-center gap-2 pl-6">
|
<div class="flex items-center gap-2 pl-6">
|
||||||
<p-checkbox
|
<p-checkbox
|
||||||
[(ngModel)]="perm.selected"
|
[(ngModel)]="perm.selected"
|
||||||
[binary]="true"
|
[binary]="true"
|
||||||
@@ -177,7 +180,7 @@
|
|||||||
</p-checkbox>
|
</p-checkbox>
|
||||||
<label [for]="perm.value" class="text-sm">{{ perm.label }}</label>
|
<label [for]="perm.value" class="text-sm">{{ perm.label }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<p class=" pb-3 pt-6">Default libraries for auto-provisioned users:</p>
|
<p class=" pb-3 pt-6">Default libraries for auto-provisioned users:</p>
|
||||||
<div class="pl-6">
|
<div class="pl-6">
|
||||||
<p-multiSelect
|
<p-multiSelect
|
||||||
@@ -193,8 +196,10 @@
|
|||||||
<p-button label="Save Settings" [outlined]="true" (click)="saveAutoProvisioningSettings()"></p-button>
|
<p-button label="Save Settings" [outlined]="true" (click)="saveAutoProvisioningSettings()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+1
-3
@@ -3,7 +3,7 @@ import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
|||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {DropdownModule} from 'primeng/dropdown';
|
import {DropdownModule} from 'primeng/dropdown';
|
||||||
import {NgForOf, NgIf} from '@angular/common';
|
|
||||||
import {Checkbox} from 'primeng/checkbox';
|
import {Checkbox} from 'primeng/checkbox';
|
||||||
import {ToggleSwitch} from 'primeng/toggleswitch';
|
import {ToggleSwitch} from 'primeng/toggleswitch';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
@@ -24,8 +24,6 @@ import {LibraryService} from '../../../book/service/library.service';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
InputText,
|
InputText,
|
||||||
DropdownModule,
|
DropdownModule,
|
||||||
NgIf,
|
|
||||||
NgForOf,
|
|
||||||
Checkbox,
|
Checkbox,
|
||||||
ToggleSwitch,
|
ToggleSwitch,
|
||||||
Divider,
|
Divider,
|
||||||
|
|||||||
@@ -11,33 +11,41 @@
|
|||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<label for="name">Username</label>
|
<label for="name">Username</label>
|
||||||
<input pInputText id="name" type="text" formControlName="username" required />
|
<input pInputText id="name" type="text" formControlName="username" required />
|
||||||
<small class="text-red-500" *ngIf="setupForm.get('username')?.invalid && setupForm.get('username')?.touched">
|
@if (setupForm.get('username')?.invalid && setupForm.get('username')?.touched) {
|
||||||
|
<small class="text-red-500">
|
||||||
Username is required.
|
Username is required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<label for="name">Name</label>
|
<label for="name">Name</label>
|
||||||
<input pInputText id="name" type="text" formControlName="name" required />
|
<input pInputText id="name" type="text" formControlName="name" required />
|
||||||
<small class="text-red-500" *ngIf="setupForm.get('name')?.invalid && setupForm.get('name')?.touched">
|
@if (setupForm.get('name')?.invalid && setupForm.get('name')?.touched) {
|
||||||
|
<small class="text-red-500">
|
||||||
Name is required.
|
Name is required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<label for="email">Email</label>
|
<label for="email">Email</label>
|
||||||
<input pInputText id="email" type="email" formControlName="email" required />
|
<input pInputText id="email" type="email" formControlName="email" required />
|
||||||
<small class="text-red-500" *ngIf="setupForm.get('email')?.invalid && setupForm.get('email')?.touched">
|
@if (setupForm.get('email')?.invalid && setupForm.get('email')?.touched) {
|
||||||
|
<small class="text-red-500">
|
||||||
Valid email is required.
|
Valid email is required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
<label for="password">Password</label>
|
<label for="password">Password</label>
|
||||||
<p-password fluid id="password" formControlName="password" [feedback]="false" required></p-password>
|
<p-password fluid id="password" formControlName="password" [feedback]="false" required></p-password>
|
||||||
<small class="text-red-500" *ngIf="setupForm.get('password')?.invalid && setupForm.get('password')?.touched">
|
@if (setupForm.get('password')?.invalid && setupForm.get('password')?.touched) {
|
||||||
|
<small class="text-red-500">
|
||||||
Minimum 6 characters required.
|
Minimum 6 characters required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-3 mt-4">
|
<div class="flex flex-col gap-3 mt-4">
|
||||||
@@ -46,8 +54,12 @@
|
|||||||
[disabled]="loading || setupForm.invalid"
|
[disabled]="loading || setupForm.invalid"
|
||||||
icon="pi pi-user-plus">
|
icon="pi pi-user-plus">
|
||||||
</p-button>
|
</p-button>
|
||||||
<p-message *ngIf="error" severity="error" text="{{ error }}"></p-message>
|
@if (error) {
|
||||||
<p-message *ngIf="success" severity="success" text="Admin account created! Redirecting…"></p-message>
|
<p-message severity="error" text="{{ error }}"></p-message>
|
||||||
|
}
|
||||||
|
@if (success) {
|
||||||
|
<p-message severity="success" text="Admin account created! Redirecting…"></p-message>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Component } from '@angular/core';
|
|||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { Router } from '@angular/router';
|
import { Router } from '@angular/router';
|
||||||
import { SetupService } from './setup.service';
|
import { SetupService } from './setup.service';
|
||||||
import { NgIf } from '@angular/common';
|
|
||||||
import { ReactiveFormsModule } from '@angular/forms';
|
import { ReactiveFormsModule } from '@angular/forms';
|
||||||
import { Card } from 'primeng/card';
|
import { Card } from 'primeng/card';
|
||||||
import { PrimeTemplate } from 'primeng/api';
|
import { PrimeTemplate } from 'primeng/api';
|
||||||
@@ -18,7 +18,6 @@ import { Message } from 'primeng/message';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [
|
imports: [
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
NgIf,
|
|
||||||
Card,
|
Card,
|
||||||
PrimeTemplate,
|
PrimeTemplate,
|
||||||
InputText,
|
InputText,
|
||||||
|
|||||||
+11
-6
@@ -1,25 +1,30 @@
|
|||||||
<p class="dashboard-scroller-title">{{ title }}</p>
|
<p class="dashboard-scroller-title">{{ title }}</p>
|
||||||
|
|
||||||
<div class="dashboard-scroller-no-books" *ngIf="!books || books.length === 0">
|
@if (!books || books.length === 0) {
|
||||||
|
<div class="dashboard-scroller-no-books">
|
||||||
<p class="text-sm">
|
<p class="text-sm">
|
||||||
{{ bookListType === 'lastRead' ? "You haven't read any books yet!" : "No books have been added to BookLore!" }}
|
{{ bookListType === 'lastRead' ? "You haven't read any books yet!" : "No books have been added to BookLore!" }}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (books) {
|
||||||
<div class="dashboard-scroller-infinite"
|
<div class="dashboard-scroller-infinite"
|
||||||
*ngIf="books"
|
|
||||||
infiniteScroll
|
infiniteScroll
|
||||||
[infiniteScrollDistance]="2"
|
[infiniteScrollDistance]="2"
|
||||||
[infiniteScrollThrottle]="50"
|
[infiniteScrollThrottle]="50"
|
||||||
#scrollContainer
|
#scrollContainer
|
||||||
[horizontal]="true">
|
[horizontal]="true">
|
||||||
|
@for (book of books; track book) {
|
||||||
<div class="dashboard-scroller-card" *ngFor="let book of books">
|
<div class="dashboard-scroller-card">
|
||||||
<app-book-card [book]="book" [isCheckboxEnabled]="false"></app-book-card>
|
<app-book-card [book]="book" [isCheckboxEnabled]="false"></app-book-card>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<div *ngIf=" books === null">
|
@if ( books === null) {
|
||||||
|
<div>
|
||||||
<p class="text-sm">Failed to load books! :(</p>
|
<p class="text-sm">Failed to load books! :(</p>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
+1
-3
@@ -1,7 +1,7 @@
|
|||||||
import {Component, ElementRef, Input, OnChanges, OnInit, ViewChild} from '@angular/core';
|
import {Component, ElementRef, Input, OnChanges, OnInit, ViewChild} from '@angular/core';
|
||||||
import {BookCardComponent} from '../../../book/components/book-browser/book-card/book-card.component';
|
import {BookCardComponent} from '../../../book/components/book-browser/book-card/book-card.component';
|
||||||
import {InfiniteScrollDirective} from 'ngx-infinite-scroll';
|
import {InfiniteScrollDirective} from 'ngx-infinite-scroll';
|
||||||
import {NgForOf, NgIf} from '@angular/common';
|
|
||||||
import {ProgressSpinnerModule} from 'primeng/progressspinner';
|
import {ProgressSpinnerModule} from 'primeng/progressspinner';
|
||||||
import {Book} from '../../../book/model/book.model';
|
import {Book} from '../../../book/model/book.model';
|
||||||
|
|
||||||
@@ -11,8 +11,6 @@ import {Book} from '../../../book/model/book.model';
|
|||||||
styleUrls: ['./dashboard-scroller.component.scss'],
|
styleUrls: ['./dashboard-scroller.component.scss'],
|
||||||
imports: [
|
imports: [
|
||||||
InfiniteScrollDirective,
|
InfiniteScrollDirective,
|
||||||
NgForOf,
|
|
||||||
NgIf,
|
|
||||||
BookCardComponent,
|
BookCardComponent,
|
||||||
ProgressSpinnerModule
|
ProgressSpinnerModule
|
||||||
],
|
],
|
||||||
|
|||||||
+16
-12
@@ -1,10 +1,16 @@
|
|||||||
<div class="dashboard-container">
|
<div class="dashboard-container">
|
||||||
<p-progressSpinner *ngIf="(bookState$ | async)?.loaded === false" styleClass="spinner center-spinner"></p-progressSpinner>
|
@if ((bookState$ | async)?.loaded === false) {
|
||||||
<div class="dashboard" *ngIf="(bookState$ | async)?.loaded === true">
|
<p-progressSpinner styleClass="spinner center-spinner"></p-progressSpinner>
|
||||||
|
}
|
||||||
|
@if ((bookState$ | async)?.loaded === true) {
|
||||||
|
<div class="dashboard">
|
||||||
|
<div>
|
||||||
|
@if (isLibrariesEmpty$ | async) {
|
||||||
|
<div class="dashboard-no-library">
|
||||||
|
@if ((userService.userState$ | async)?.permissions; as permissions) {
|
||||||
|
<div>
|
||||||
|
@if (permissions.admin || permissions.canManipulateLibrary) {
|
||||||
<div>
|
<div>
|
||||||
<div class="dashboard-no-library" *ngIf="isLibrariesEmpty$ | async; else dashboardScroller">
|
|
||||||
<div *ngIf="(userService.userState$ | async)?.permissions as permissions">
|
|
||||||
<div *ngIf="permissions.admin || permissions.canManipulateLibrary">
|
|
||||||
<h1 class="no-library-header">Looks like you haven't added a library yet. Let's add one!</h1>
|
<h1 class="no-library-header">Looks like you haven't added a library yet. Let's add one!</h1>
|
||||||
<p-button
|
<p-button
|
||||||
label="Add a Library"
|
label="Add a Library"
|
||||||
@@ -13,34 +19,32 @@
|
|||||||
(click)="createNewLibrary()">
|
(click)="createNewLibrary()">
|
||||||
</p-button>
|
</p-button>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
} @else {
|
||||||
<ng-template #dashboardScroller>
|
|
||||||
<app-dashboard-scroller
|
<app-dashboard-scroller
|
||||||
[books]="lastReadBooks$ | async"
|
[books]="lastReadBooks$ | async"
|
||||||
[bookListType]="'lastRead'"
|
[bookListType]="'lastRead'"
|
||||||
[title]="'Last Read Books'">
|
[title]="'Last Read Books'">
|
||||||
</app-dashboard-scroller>
|
</app-dashboard-scroller>
|
||||||
|
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-dashboard-scroller
|
<app-dashboard-scroller
|
||||||
[books]="latestAddedBooks$ | async"
|
[books]="latestAddedBooks$ | async"
|
||||||
[title]="'Latest Added Books'">
|
[title]="'Latest Added Books'">
|
||||||
</app-dashboard-scroller>
|
</app-dashboard-scroller>
|
||||||
|
|
||||||
<div class="mb-6">
|
<div class="mb-6">
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<app-dashboard-scroller
|
<app-dashboard-scroller
|
||||||
[books]="randomBooks$ | async"
|
[books]="randomBooks$ | async"
|
||||||
[title]="'Discover Random Reads'">
|
[title]="'Discover Random Reads'">
|
||||||
</app-dashboard-scroller>
|
</app-dashboard-scroller>
|
||||||
</ng-template>
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {LibraryService} from '../../../book/service/library.service';
|
|||||||
import {filter, Observable, take} from 'rxjs';
|
import {filter, Observable, take} from 'rxjs';
|
||||||
import {map} from 'rxjs/operators';
|
import {map} from 'rxjs/operators';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {AsyncPipe, NgIf} from '@angular/common';
|
import { AsyncPipe } from '@angular/common';
|
||||||
import {DashboardScrollerComponent} from '../dashboard-scroller/dashboard-scroller.component';
|
import {DashboardScrollerComponent} from '../dashboard-scroller/dashboard-scroller.component';
|
||||||
import {BookService} from '../../../book/service/book.service';
|
import {BookService} from '../../../book/service/book.service';
|
||||||
import {BookState} from '../../../book/model/state/book-state.model';
|
import {BookState} from '../../../book/model/state/book-state.model';
|
||||||
@@ -20,7 +20,6 @@ import {ProgressSpinner} from 'primeng/progressspinner';
|
|||||||
styleUrls: ['./main-dashboard.component.scss'],
|
styleUrls: ['./main-dashboard.component.scss'],
|
||||||
imports: [
|
imports: [
|
||||||
Button,
|
Button,
|
||||||
NgIf,
|
|
||||||
DashboardScrollerComponent,
|
DashboardScrollerComponent,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
Divider,
|
Divider,
|
||||||
|
|||||||
@@ -1,34 +1,46 @@
|
|||||||
<div class="flex flex-col h-full">
|
<div class="flex flex-col h-full">
|
||||||
<div>
|
<div>
|
||||||
<ul class="layout-menu">
|
<ul class="layout-menu">
|
||||||
<ng-container *ngIf="homeMenu$ | async as homeMenu">
|
@if (homeMenu$ | async; as homeMenu) {
|
||||||
<ng-container *ngFor="let item of homeMenu; let i = index;">
|
@for (item of homeMenu; track item; let i = $index) {
|
||||||
<li app-menuitem *ngIf="!item.separator" [item]="item" [index]="i" [root]="true"></li>
|
@if (!item.separator) {
|
||||||
<li *ngIf="item.separator" class="menu-separator"></li>
|
<li app-menuitem [item]="item" [index]="i" [root]="true"></li>
|
||||||
</ng-container>
|
}
|
||||||
</ng-container>
|
@if (item.separator) {
|
||||||
|
<li class="menu-separator"></li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="layout-menu">
|
<ul class="layout-menu">
|
||||||
<ng-container *ngIf="libraryMenu$ | async as libraryMenu">
|
@if (libraryMenu$ | async; as libraryMenu) {
|
||||||
<ng-container *ngFor="let item of libraryMenu; let i = index;">
|
@for (item of libraryMenu; track item; let i = $index) {
|
||||||
<li app-menuitem *ngIf="!item.separator" [item]="item" [index]="i" [root]="true"></li>
|
@if (!item.separator) {
|
||||||
<li *ngIf="item.separator" class="menu-separator"></li>
|
<li app-menuitem [item]="item" [index]="i" [root]="true"></li>
|
||||||
</ng-container>
|
}
|
||||||
</ng-container>
|
@if (item.separator) {
|
||||||
|
<li class="menu-separator"></li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<ul class="layout-menu">
|
<ul class="layout-menu">
|
||||||
<ng-container *ngIf="shelfMenu$ | async as shelfMenu">
|
@if (shelfMenu$ | async; as shelfMenu) {
|
||||||
<ng-container *ngFor="let item of shelfMenu; let i = index;">
|
@for (item of shelfMenu; track item; let i = $index) {
|
||||||
<li app-menuitem *ngIf="!item.separator" [item]="item" [index]="i" [root]="true"></li>
|
@if (!item.separator) {
|
||||||
<li *ngIf="item.separator" class="menu-separator"></li>
|
<li app-menuitem [item]="item" [index]="i" [root]="true"></li>
|
||||||
</ng-container>
|
}
|
||||||
</ng-container>
|
@if (item.separator) {
|
||||||
|
<li class="menu-separator"></li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-container *ngIf="versionInfo">
|
@if (versionInfo) {
|
||||||
<div style="margin-top: auto;" class="p-4 text-center w-full text-sm">
|
<div style="margin-top: auto;" class="p-4 text-center w-full text-sm">
|
||||||
<div class="text-gray-200">
|
<div class="text-gray-200">
|
||||||
<a
|
<a
|
||||||
@@ -40,7 +52,8 @@
|
|||||||
{{ versionInfo.current }}
|
{{ versionInfo.current }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="versionInfo.latest && versionInfo.latest !== versionInfo.current">
|
@if (versionInfo.latest && versionInfo.latest !== versionInfo.current) {
|
||||||
|
<div>
|
||||||
<a
|
<a
|
||||||
(click)="openChangelogDialog()"
|
(click)="openChangelogDialog()"
|
||||||
class="cursor-pointer text-orange-400 hover:underline hover:text-orange-300 text-xs"
|
class="cursor-pointer text-orange-400 hover:underline hover:text-orange-300 text-xs"
|
||||||
@@ -48,6 +61,7 @@
|
|||||||
(Update)
|
(Update)
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, inject, OnInit} from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {AppMenuitemComponent} from './app.menuitem.component';
|
import {AppMenuitemComponent} from './app.menuitem.component';
|
||||||
import {AsyncPipe, NgForOf, NgIf} from '@angular/common';
|
import { AsyncPipe } from '@angular/common';
|
||||||
import {MenuModule} from 'primeng/menu';
|
import {MenuModule} from 'primeng/menu';
|
||||||
import {LibraryService} from '../../../book/service/library.service';
|
import {LibraryService} from '../../../book/service/library.service';
|
||||||
import {Observable, of} from 'rxjs';
|
import {Observable, of} from 'rxjs';
|
||||||
@@ -17,7 +17,7 @@ import {UserService} from '../../../settings/user-management/user.service';
|
|||||||
@Component({
|
@Component({
|
||||||
selector: 'app-menu',
|
selector: 'app-menu',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [AppMenuitemComponent, NgIf, NgForOf, MenuModule, AsyncPipe],
|
imports: [AppMenuitemComponent, MenuModule, AsyncPipe],
|
||||||
templateUrl: './app.menu.component.html',
|
templateUrl: './app.menu.component.html',
|
||||||
})
|
})
|
||||||
export class AppMenuComponent implements OnInit {
|
export class AppMenuComponent implements OnInit {
|
||||||
|
|||||||
@@ -1,18 +1,25 @@
|
|||||||
<ng-container>
|
<ng-container>
|
||||||
<div *ngIf="root && item.visible !== false" class="layout-menuitem-root-text">{{ item.label }}</div>
|
@if (root && item.visible !== false) {
|
||||||
|
<div class="layout-menuitem-root-text">{{ item.label }}</div>
|
||||||
|
}
|
||||||
|
|
||||||
<a *ngIf="(!item.routerLink || item.items) && item.visible !== false" [attr.href]="item.url"
|
@if ((!item.routerLink || item.items) && item.visible !== false) {
|
||||||
|
<a [attr.href]="item.url"
|
||||||
(click)="itemClick($event)"
|
(click)="itemClick($event)"
|
||||||
[ngClass]="item.class" [attr.target]="item.target" tabindex="0" pRipple>
|
[ngClass]="item.class" [attr.target]="item.target" tabindex="0" pRipple>
|
||||||
<i [ngClass]="item.icon" class="layout-menuitem-icon"></i>
|
<i [ngClass]="item.icon" class="layout-menuitem-icon"></i>
|
||||||
<span class="layout-menuitem-text">
|
<span class="layout-menuitem-text">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</span>
|
</span>
|
||||||
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
|
@if (item.items) {
|
||||||
|
<i class="pi pi-fw pi-angle-down layout-submenu-toggler"></i>
|
||||||
|
}
|
||||||
</a>
|
</a>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between">
|
<div class="flex flex-row items-center justify-between">
|
||||||
<a *ngIf="(item.routerLink && !item.items) && item.visible !== false" (click)="itemClick($event)"
|
@if ((item.routerLink && !item.items) && item.visible !== false) {
|
||||||
|
<a (click)="itemClick($event)"
|
||||||
[ngClass]="item.class"
|
[ngClass]="item.class"
|
||||||
[routerLink]="item.routerLink" routerLinkActive="active-route"
|
[routerLink]="item.routerLink" routerLinkActive="active-route"
|
||||||
[routerLinkActiveOptions]="item.routerLinkActiveOptions || { paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
|
[routerLinkActiveOptions]="item.routerLinkActiveOptions || { paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
|
||||||
@@ -25,12 +32,16 @@
|
|||||||
<span class="layout-menuitem-text w-full">
|
<span class="layout-menuitem-text w-full">
|
||||||
{{ item.label }}
|
{{ item.label }}
|
||||||
</span>
|
</span>
|
||||||
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
|
@if (item.items) {
|
||||||
|
<i class="pi pi-fw pi-angle-down layout-submenu-toggler"></i>
|
||||||
|
}
|
||||||
</a>
|
</a>
|
||||||
<span *ngIf="(item.routerLink && !item.items) && item.visible !== false">
|
}
|
||||||
<ng-container *ngIf="item.type === 'Library' || item.type === 'Shelf'">
|
@if ((item.routerLink && !item.items) && item.visible !== false) {
|
||||||
|
<span>
|
||||||
|
@if (item.type === 'Library' || item.type === 'Shelf') {
|
||||||
|
@if ((item.type !== 'Library' || (admin || canManipulateLibrary)) && item.label !== 'Unshelved') {
|
||||||
<p-button
|
<p-button
|
||||||
*ngIf="(item.type !== 'Library' || (admin || canManipulateLibrary)) && item.label !== 'Unshelved'"
|
|
||||||
(click)="entitymenu.toggle($event)"
|
(click)="entitymenu.toggle($event)"
|
||||||
(mouseover)="hovered = true"
|
(mouseover)="hovered = true"
|
||||||
(mouseleave)="hovered = false"
|
(mouseleave)="hovered = false"
|
||||||
@@ -43,20 +54,23 @@
|
|||||||
[style.height]="'30px'"
|
[style.height]="'30px'"
|
||||||
[style.display]="'flex'">
|
[style.display]="'flex'">
|
||||||
</p-button>
|
</p-button>
|
||||||
|
}
|
||||||
<p-menu #entitymenu [model]="item.menu" [popup]="true" appendTo="body"></p-menu>
|
<p-menu #entitymenu [model]="item.menu" [popup]="true" appendTo="body"></p-menu>
|
||||||
</ng-container>
|
}
|
||||||
|
@if (item.type === 'Library' && (!admin && !canManipulateLibrary) || item.type === 'All Books' || item.label === 'Unshelved') {
|
||||||
<ng-container *ngIf="item.type === 'Library' && (!admin && !canManipulateLibrary) || item.type === 'All Books' || item.label === 'Unshelved'">
|
|
||||||
<p class="text-[var(--primary-color)] pr-1">
|
<p class="text-[var(--primary-color)] pr-1">
|
||||||
{{ (item.bookCount$ | async)?.toString() || '0' }}
|
{{ (item.bookCount$ | async)?.toString() || '0' }}
|
||||||
</p>
|
</p>
|
||||||
</ng-container>
|
}
|
||||||
</span>
|
</span>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ul *ngIf="item.items && item.visible !== false" [@children]="submenuAnimation">
|
@if (item.items && item.visible !== false) {
|
||||||
<ng-template ngFor let-child let-i="index" [ngForOf]="item.items">
|
<ul [@children]="submenuAnimation">
|
||||||
|
@for (child of item.items; track child; let i = $index) {
|
||||||
<li app-menuitem [item]="child" [index]="i" [parentKey]="key" [class]="child.badgeClass"></li>
|
<li app-menuitem [item]="child" [index]="i" [parentKey]="key" [class]="child.badgeClass"></li>
|
||||||
</ng-template>
|
}
|
||||||
</ul>
|
</ul>
|
||||||
|
}
|
||||||
</ng-container>
|
</ng-container>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {animate, state, style, transition, trigger} from '@angular/animations';
|
|||||||
import {Subscription} from 'rxjs';
|
import {Subscription} from 'rxjs';
|
||||||
import {filter} from 'rxjs/operators';
|
import {filter} from 'rxjs/operators';
|
||||||
import {MenuService} from './service/app.menu.service';
|
import {MenuService} from './service/app.menu.service';
|
||||||
import {AsyncPipe, NgClass, NgForOf, NgIf} from '@angular/common';
|
import { AsyncPipe, NgClass } from '@angular/common';
|
||||||
import {Ripple} from 'primeng/ripple';
|
import {Ripple} from 'primeng/ripple';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {Menu} from 'primeng/menu';
|
import {Menu} from 'primeng/menu';
|
||||||
@@ -19,9 +19,7 @@ import {UserService} from '../../../settings/user-management/user.service';
|
|||||||
RouterLink,
|
RouterLink,
|
||||||
RouterLinkActive,
|
RouterLinkActive,
|
||||||
NgClass,
|
NgClass,
|
||||||
NgForOf,
|
|
||||||
Ripple,
|
Ripple,
|
||||||
NgIf,
|
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
Button,
|
Button,
|
||||||
Menu
|
Menu
|
||||||
|
|||||||
+12
-4
@@ -1,13 +1,19 @@
|
|||||||
<div *ngIf="loading" class="p-4 text-center text-gray-400">
|
@if (loading) {
|
||||||
|
<div class="p-4 text-center text-gray-400">
|
||||||
Loading changelog...
|
Loading changelog...
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<div *ngIf="!loading && changelog.length === 0" class="p-4 text-center text-gray-400">
|
@if (!loading && changelog.length === 0) {
|
||||||
|
<div class="p-4 text-center text-gray-400">
|
||||||
No updates available.
|
No updates available.
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<div *ngIf="!loading && changelog.length > 0" class="space-y-6 p-4 max-h-[70vh] overflow-auto">
|
@if (!loading && changelog.length > 0) {
|
||||||
<div *ngFor="let release of changelog" class="border-b pb-4">
|
<div class="space-y-6 p-4 max-h-[70vh] overflow-auto">
|
||||||
|
@for (release of changelog; track release) {
|
||||||
|
<div class="border-b pb-4">
|
||||||
<p class="font-bold text-2xl pb-2">
|
<p class="font-bold text-2xl pb-2">
|
||||||
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:underline">
|
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:underline">
|
||||||
{{ release.name }}
|
{{ release.name }}
|
||||||
@@ -15,4 +21,6 @@
|
|||||||
</p>
|
</p>
|
||||||
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
|
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
import { Component, inject, OnInit } from '@angular/core';
|
import { Component, inject, OnInit } from '@angular/core';
|
||||||
import { ReleaseNote, VersionService } from '../../../../core/service/version.service';
|
import { ReleaseNote, VersionService } from '../../../../core/service/version.service';
|
||||||
import { NgForOf, NgIf } from '@angular/common';
|
|
||||||
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
|
||||||
import showdown from 'showdown';
|
import showdown from 'showdown';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-version-changelog-dialog',
|
selector: 'app-version-changelog-dialog',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [NgIf, NgForOf],
|
imports: [],
|
||||||
templateUrl: './version-changelog-dialog.component.html',
|
templateUrl: './version-changelog-dialog.component.html',
|
||||||
styleUrl: './version-changelog-dialog.component.scss'
|
styleUrl: './version-changelog-dialog.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -21,18 +21,26 @@
|
|||||||
<app-book-searcher></app-book-searcher>
|
<app-book-searcher></app-book-searcher>
|
||||||
<ul class="topbar-items pl-6">
|
<ul class="topbar-items pl-6">
|
||||||
<div class="flex gap-6">
|
<div class="flex gap-6">
|
||||||
<li *ngIf="userService.userState$ | async as userData">
|
@if (userService.userState$ | async; as userData) {
|
||||||
<a class="topbar-item" *ngIf="userData.permissions.canManipulateLibrary || userData.permissions.admin">
|
<li>
|
||||||
|
@if (userData.permissions.canManipulateLibrary || userData.permissions.admin) {
|
||||||
|
<a class="topbar-item">
|
||||||
<i class="pi pi-plus-circle text-surface-700 dark:text-surface-100" (click)="openLibraryCreatorDialog()"
|
<i class="pi pi-plus-circle text-surface-700 dark:text-surface-100" (click)="openLibraryCreatorDialog()"
|
||||||
pTooltip="Create New Library" tooltipPosition="top"></i>
|
pTooltip="Create New Library" tooltipPosition="top"></i>
|
||||||
</a>
|
</a>
|
||||||
|
}
|
||||||
</li>
|
</li>
|
||||||
<li *ngIf="userService.userState$ | async as userData">
|
}
|
||||||
<a class="topbar-item" *ngIf="userData.permissions.canManipulateLibrary || userData.permissions.admin">
|
@if (userService.userState$ | async; as userData) {
|
||||||
|
<li>
|
||||||
|
@if (userData.permissions.canManipulateLibrary || userData.permissions.admin) {
|
||||||
|
<a class="topbar-item">
|
||||||
<i class="pi pi-upload text-surface-700 dark:text-surface-100" (click)="openFileUploadDialog()"
|
<i class="pi pi-upload text-surface-700 dark:text-surface-100" (click)="openFileUploadDialog()"
|
||||||
pTooltip="Upload Book" tooltipPosition="top"></i>
|
pTooltip="Upload Book" tooltipPosition="top"></i>
|
||||||
</a>
|
</a>
|
||||||
|
}
|
||||||
</li>
|
</li>
|
||||||
|
}
|
||||||
<li>
|
<li>
|
||||||
<a class="topbar-item">
|
<a class="topbar-item">
|
||||||
<i class="pi pi-cog text-surface-700 dark:text-surface-100" (click)="navigateToSettings()"
|
<i class="pi pi-cog text-surface-700 dark:text-surface-100" (click)="navigateToSettings()"
|
||||||
@@ -52,7 +60,9 @@
|
|||||||
[hideOnOutsideClick]="true">
|
[hideOnOutsideClick]="true">
|
||||||
<i class="pi pi-wave-pulse" style="font-size: 1.5rem" [class.pulsating]="eventHighlight" [class.highlight]="eventHighlight"></i>
|
<i class="pi pi-wave-pulse" style="font-size: 1.5rem" [class.pulsating]="eventHighlight" [class.highlight]="eventHighlight"></i>
|
||||||
</button>
|
</button>
|
||||||
<app-live-notification-box class="config-panel notification-box" *ngIf="isHovered"></app-live-notification-box>
|
@if (isHovered) {
|
||||||
|
<app-live-notification-box class="config-panel notification-box"></app-live-notification-box>
|
||||||
|
}
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
<p-divider layout="vertical"/>
|
<p-divider layout="vertical"/>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import {TooltipModule} from 'primeng/tooltip';
|
|||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {InputTextModule} from 'primeng/inputtext';
|
import {InputTextModule} from 'primeng/inputtext';
|
||||||
import {BookSearcherComponent} from '../../../book/components/book-searcher/book-searcher.component';
|
import {BookSearcherComponent} from '../../../book/components/book-searcher/book-searcher.component';
|
||||||
import {AsyncPipe, NgClass, NgIf} from '@angular/common';
|
import { AsyncPipe, NgClass } from '@angular/common';
|
||||||
import {EventService} from '../../../shared/websocket/event.service';
|
import {EventService} from '../../../shared/websocket/event.service';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {StyleClass} from 'primeng/styleclass';
|
import {StyleClass} from 'primeng/styleclass';
|
||||||
@@ -37,7 +37,6 @@ import {GithubSupportDialog} from '../../../github-support-dialog/github-support
|
|||||||
NgClass,
|
NgClass,
|
||||||
Divider,
|
Divider,
|
||||||
LiveNotificationBoxComponent,
|
LiveNotificationBoxComponent,
|
||||||
NgIf,
|
|
||||||
AsyncPipe
|
AsyncPipe
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|||||||
+9
-3
@@ -4,25 +4,31 @@
|
|||||||
<label class="w-40 text-right font-medium">Provider Name:</label>
|
<label class="w-40 text-right font-medium">Provider Name:</label>
|
||||||
<input type="text" pInputText formControlName="name" placeholder="Enter provider name..." class="w-full md:w-80"/>
|
<input type="text" pInputText formControlName="name" placeholder="Enter provider name..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="emailProviderForm.get('name')?.invalid && (emailProviderForm.get('name')?.dirty || emailProviderForm.get('name')?.touched)">
|
@if (emailProviderForm.get('name')?.invalid && (emailProviderForm.get('name')?.dirty || emailProviderForm.get('name')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Provider name is required.
|
Provider name is required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Host:</label>
|
<label class="w-40 text-right font-medium">Host:</label>
|
||||||
<input type="text" pInputText formControlName="host" placeholder="Enter host..." class="w-full md:w-80"/>
|
<input type="text" pInputText formControlName="host" placeholder="Enter host..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="emailProviderForm.get('host')?.invalid && (emailProviderForm.get('host')?.dirty || emailProviderForm.get('host')?.touched)">
|
@if (emailProviderForm.get('host')?.invalid && (emailProviderForm.get('host')?.dirty || emailProviderForm.get('host')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Host is required.
|
Host is required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Port:</label>
|
<label class="w-40 text-right font-medium">Port:</label>
|
||||||
<input type="number" pInputText formControlName="port" placeholder="Enter port..." class="w-full md:w-80"/>
|
<input type="number" pInputText formControlName="port" placeholder="Enter port..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="emailProviderForm.get('port')?.invalid && (emailProviderForm.get('port')?.dirty || emailProviderForm.get('port')?.touched)">
|
@if (emailProviderForm.get('port')?.invalid && (emailProviderForm.get('port')?.dirty || emailProviderForm.get('port')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Port is required and must be a number.
|
Port is required and must be a number.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Username:</label>
|
<label class="w-40 text-right font-medium">Username:</label>
|
||||||
|
|||||||
+1
-2
@@ -2,7 +2,7 @@ import { Component, inject, OnInit } from '@angular/core';
|
|||||||
import { Button } from 'primeng/button';
|
import { Button } from 'primeng/button';
|
||||||
import { Checkbox } from 'primeng/checkbox';
|
import { Checkbox } from 'primeng/checkbox';
|
||||||
import { InputText } from 'primeng/inputtext';
|
import { InputText } from 'primeng/inputtext';
|
||||||
import { NgIf } from '@angular/common';
|
|
||||||
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
||||||
import { EmailProviderService } from '../email-provider/email-provider.service';
|
import { EmailProviderService } from '../email-provider/email-provider.service';
|
||||||
import { MessageService } from 'primeng/api';
|
import { MessageService } from 'primeng/api';
|
||||||
@@ -14,7 +14,6 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
InputText,
|
InputText,
|
||||||
NgIf,
|
|
||||||
ReactiveFormsModule
|
ReactiveFormsModule
|
||||||
],
|
],
|
||||||
templateUrl: './create-email-provider-dialog.component.html',
|
templateUrl: './create-email-provider-dialog.component.html',
|
||||||
|
|||||||
+6
-2
@@ -4,17 +4,21 @@
|
|||||||
<label class="w-40 text-right font-medium">Recipient Name:</label>
|
<label class="w-40 text-right font-medium">Recipient Name:</label>
|
||||||
<input type="text" pInputText formControlName="name" placeholder="Enter recipient name..." class="w-full md:w-80"/>
|
<input type="text" pInputText formControlName="name" placeholder="Enter recipient name..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="emailRecipientForm.get('name')?.invalid && (emailRecipientForm.get('name')?.dirty || emailRecipientForm.get('name')?.touched)">
|
@if (emailRecipientForm.get('name')?.invalid && (emailRecipientForm.get('name')?.dirty || emailRecipientForm.get('name')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Recipient name is required.
|
Recipient name is required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Email Address:</label>
|
<label class="w-40 text-right font-medium">Email Address:</label>
|
||||||
<input type="email" pInputText formControlName="email" placeholder="Enter email address..." class="w-full md:w-80"/>
|
<input type="email" pInputText formControlName="email" placeholder="Enter email address..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="emailRecipientForm.get('email')?.invalid && (emailRecipientForm.get('email')?.dirty || emailRecipientForm.get('email')?.touched)">
|
@if (emailRecipientForm.get('email')?.invalid && (emailRecipientForm.get('email')?.dirty || emailRecipientForm.get('email')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Valid email is required.
|
Valid email is required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Default Recipient:</label>
|
<label class="w-40 text-right font-medium">Default Recipient:</label>
|
||||||
|
|||||||
+2
-3
@@ -5,7 +5,7 @@ import { DynamicDialogRef } from 'primeng/dynamicdialog';
|
|||||||
import { Checkbox } from 'primeng/checkbox';
|
import { Checkbox } from 'primeng/checkbox';
|
||||||
import { Button } from 'primeng/button';
|
import { Button } from 'primeng/button';
|
||||||
import { InputText } from 'primeng/inputtext';
|
import { InputText } from 'primeng/inputtext';
|
||||||
import { NgIf } from '@angular/common';
|
|
||||||
import { EmailRecipientService } from '../email-recipient/email-recipient.service';
|
import { EmailRecipientService } from '../email-recipient/email-recipient.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -14,8 +14,7 @@ import { EmailRecipientService } from '../email-recipient/email-recipient.servic
|
|||||||
Checkbox,
|
Checkbox,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
Button,
|
Button,
|
||||||
InputText,
|
InputText
|
||||||
NgIf
|
|
||||||
],
|
],
|
||||||
templateUrl: './create-email-recipient-dialog.component.html',
|
templateUrl: './create-email-recipient-dialog.component.html',
|
||||||
styleUrls: ['./create-email-recipient-dialog.component.scss']
|
styleUrls: ['./create-email-recipient-dialog.component.scss']
|
||||||
|
|||||||
@@ -38,33 +38,57 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="provider.isEditing" type="text" [(ngModel)]="provider.name" class="p-inputtext w-full"/>
|
@if (provider.isEditing) {
|
||||||
<span *ngIf="!provider.isEditing">{{ provider.name }}</span>
|
<input type="text" [(ngModel)]="provider.name" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!provider.isEditing) {
|
||||||
|
<span>{{ provider.name }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="provider.isEditing" type="text" [(ngModel)]="provider.host" class="p-inputtext w-full"/>
|
@if (provider.isEditing) {
|
||||||
<span *ngIf="!provider.isEditing">{{ provider.host }}</span>
|
<input type="text" [(ngModel)]="provider.host" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!provider.isEditing) {
|
||||||
|
<span>{{ provider.host }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="provider.isEditing" type="number" [(ngModel)]="provider.port" class="p-inputtext w-full"/>
|
@if (provider.isEditing) {
|
||||||
<span *ngIf="!provider.isEditing">{{ provider.port }}</span>
|
<input type="number" [(ngModel)]="provider.port" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!provider.isEditing) {
|
||||||
|
<span>{{ provider.port }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="provider.isEditing" type="text" [(ngModel)]="provider.username" class="p-inputtext w-full"/>
|
@if (provider.isEditing) {
|
||||||
<span *ngIf="!provider.isEditing">{{ provider.username }}</span>
|
<input type="text" [(ngModel)]="provider.username" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!provider.isEditing) {
|
||||||
|
<span>{{ provider.username }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="provider.isEditing" [(ngModel)]="provider.password" class="p-inputtext w-full"/>
|
@if (provider.isEditing) {
|
||||||
<span *ngIf="!provider.isEditing" class="text-gray-400 italic">Hidden</span>
|
<input [(ngModel)]="provider.password" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!provider.isEditing) {
|
||||||
|
<span class="text-gray-400 italic">Hidden</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="provider.isEditing" type="text" [(ngModel)]="provider.fromAddress" class="p-inputtext w-full"/>
|
@if (provider.isEditing) {
|
||||||
<span *ngIf="!provider.isEditing">{{ provider.fromAddress }}</span>
|
<input type="text" [(ngModel)]="provider.fromAddress" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!provider.isEditing) {
|
||||||
|
<span>{{ provider.fromAddress }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
@@ -84,9 +108,15 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-button *ngIf="!provider.isEditing" icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEdit(provider)"></p-button>
|
@if (!provider.isEditing) {
|
||||||
<p-button *ngIf="provider.isEditing" icon="pi pi-check" outlined="true" severity="success" (onClick)="saveProvider(provider)"></p-button>
|
<p-button icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEdit(provider)"></p-button>
|
||||||
<p-button *ngIf="provider.isEditing" icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEdit(provider)"></p-button>
|
}
|
||||||
|
@if (provider.isEditing) {
|
||||||
|
<p-button icon="pi pi-check" outlined="true" severity="success" (onClick)="saveProvider(provider)"></p-button>
|
||||||
|
}
|
||||||
|
@if (provider.isEditing) {
|
||||||
|
<p-button icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEdit(provider)"></p-button>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Component, inject, OnInit} from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {Checkbox} from 'primeng/checkbox';
|
import {Checkbox} from 'primeng/checkbox';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {MessageService, PrimeTemplate} from 'primeng/api';
|
import {MessageService, PrimeTemplate} from 'primeng/api';
|
||||||
import {RadioButton} from 'primeng/radiobutton';
|
import {RadioButton} from 'primeng/radiobutton';
|
||||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
@@ -17,7 +17,6 @@ import {CreateEmailProviderDialogComponent} from '../create-email-provider-dialo
|
|||||||
imports: [
|
imports: [
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
NgIf,
|
|
||||||
PrimeTemplate,
|
PrimeTemplate,
|
||||||
RadioButton,
|
RadioButton,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
|
|||||||
@@ -32,19 +32,33 @@
|
|||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="recipient.isEditing" type="email" [(ngModel)]="recipient.email" class="p-inputtext w-full"/>
|
@if (recipient.isEditing) {
|
||||||
<span *ngIf="!recipient.isEditing">{{ recipient.email }}</span>
|
<input type="email" [(ngModel)]="recipient.email" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!recipient.isEditing) {
|
||||||
|
<span>{{ recipient.email }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="recipient.isEditing" type="text" [(ngModel)]="recipient.name" class="p-inputtext w-full"/>
|
@if (recipient.isEditing) {
|
||||||
<span *ngIf="!recipient.isEditing">{{ recipient.name }}</span>
|
<input type="text" [(ngModel)]="recipient.name" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!recipient.isEditing) {
|
||||||
|
<span>{{ recipient.name }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-button *ngIf="!recipient.isEditing" icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEditRecipient(recipient)"></p-button>
|
@if (!recipient.isEditing) {
|
||||||
<p-button *ngIf="recipient.isEditing" icon="pi pi-check" outlined="true" severity="success" (onClick)="saveRecipient(recipient)"></p-button>
|
<p-button icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEditRecipient(recipient)"></p-button>
|
||||||
<p-button *ngIf="recipient.isEditing" icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEditRecipient(recipient)"></p-button>
|
}
|
||||||
|
@if (recipient.isEditing) {
|
||||||
|
<p-button icon="pi pi-check" outlined="true" severity="success" (onClick)="saveRecipient(recipient)"></p-button>
|
||||||
|
}
|
||||||
|
@if (recipient.isEditing) {
|
||||||
|
<p-button icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEditRecipient(recipient)"></p-button>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, inject, OnInit} from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {MessageService, PrimeTemplate} from 'primeng/api';
|
import {MessageService, PrimeTemplate} from 'primeng/api';
|
||||||
import {RadioButton} from 'primeng/radiobutton';
|
import {RadioButton} from 'primeng/radiobutton';
|
||||||
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
@@ -18,7 +18,6 @@ import {CreateEmailRecipientDialogComponent} from '../create-email-recipient-dia
|
|||||||
selector: 'app-email-recipient',
|
selector: 'app-email-recipient',
|
||||||
imports: [
|
imports: [
|
||||||
Button,
|
Button,
|
||||||
NgIf,
|
|
||||||
PrimeTemplate,
|
PrimeTemplate,
|
||||||
RadioButton,
|
RadioButton,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
|
|||||||
+6
-5
@@ -17,7 +17,8 @@
|
|||||||
</p-toggleswitch>
|
</p-toggleswitch>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="opdsEnabled" class="flex items-center gap-2 mt-4">
|
@if (opdsEnabled) {
|
||||||
|
<div class="flex items-center gap-2 mt-4">
|
||||||
<p class="text-lg py-1">OPDS Endpoint:</p>
|
<p class="text-lg py-1">OPDS Endpoint:</p>
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<input
|
<input
|
||||||
@@ -35,10 +36,10 @@
|
|||||||
</p-button>
|
</p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<div *ngIf="opdsEnabled" class="mt-6">
|
@if (opdsEnabled) {
|
||||||
|
<div class="mt-6">
|
||||||
|
|
||||||
<div class="flex justify-between items-center">
|
<div class="flex justify-between items-center">
|
||||||
<h2 class="text-lg flex items-center gap-2">
|
<h2 class="text-lg flex items-center gap-2">
|
||||||
Current OPDS Users:
|
Current OPDS Users:
|
||||||
@@ -50,7 +51,6 @@
|
|||||||
(onClick)="openCreateUserDialog()">
|
(onClick)="openCreateUserDialog()">
|
||||||
</p-button>
|
</p-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-3">
|
<div class="mt-3">
|
||||||
<p-table [value]="users" [responsiveLayout]="'scroll'">
|
<p-table [value]="users" [responsiveLayout]="'scroll'">
|
||||||
<ng-template pTemplate="header">
|
<ng-template pTemplate="header">
|
||||||
@@ -99,6 +99,7 @@
|
|||||||
</p-table>
|
</p-table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p-dialog
|
<p-dialog
|
||||||
|
|||||||
+1
-2
@@ -1,6 +1,6 @@
|
|||||||
import {Component, inject, OnInit} from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {TableModule} from 'primeng/table';
|
import {TableModule} from 'primeng/table';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
@@ -21,7 +21,6 @@ import {ToggleSwitch} from 'primeng/toggleswitch';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [
|
imports: [
|
||||||
FormsModule,
|
FormsModule,
|
||||||
NgIf,
|
|
||||||
TableModule,
|
TableModule,
|
||||||
Button,
|
Button,
|
||||||
InputText,
|
InputText,
|
||||||
|
|||||||
+36
-12
@@ -9,31 +9,47 @@
|
|||||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium mb-1">Username</label>
|
<label class="block text-sm font-medium mb-1">Username</label>
|
||||||
<p *ngIf="!isEditing" class="text-lg">{{ currentUser?.username || 'N/A' }}</p>
|
@if (!isEditing) {
|
||||||
<input *ngIf="isEditing" disabled id="username" type="text" pInputText [(ngModel)]="editUserData.username" class="w-full"/>
|
<p class="text-lg">{{ currentUser?.username || 'N/A' }}</p>
|
||||||
|
}
|
||||||
|
@if (isEditing) {
|
||||||
|
<input disabled id="username" type="text" pInputText [(ngModel)]="editUserData.username" class="w-full"/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label class="block text-sm font-medium mb-1">Full Name</label>
|
<label class="block text-sm font-medium mb-1">Full Name</label>
|
||||||
<p *ngIf="!isEditing" class="text-lg">{{ currentUser?.name || 'N/A' }}</p>
|
@if (!isEditing) {
|
||||||
<input *ngIf="isEditing" id="fullname" type="text" pInputText [(ngModel)]="editUserData.name" class="w-full"/>
|
<p class="text-lg">{{ currentUser?.name || 'N/A' }}</p>
|
||||||
|
}
|
||||||
|
@if (isEditing) {
|
||||||
|
<input id="fullname" type="text" pInputText [(ngModel)]="editUserData.name" class="w-full"/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="md:col-span-2">
|
<div class="md:col-span-2">
|
||||||
<label class="block text-sm font-medium mb-1">Email</label>
|
<label class="block text-sm font-medium mb-1">Email</label>
|
||||||
<p *ngIf="!isEditing" class="text-lg">{{ currentUser?.email || 'N/A' }}</p>
|
@if (!isEditing) {
|
||||||
<input *ngIf="isEditing" id="email" type="email" pInputText [(ngModel)]="editUserData.email" class="w-full"/>
|
<p class="text-lg">{{ currentUser?.email || 'N/A' }}</p>
|
||||||
|
}
|
||||||
|
@if (isEditing) {
|
||||||
|
<input id="email" type="email" pInputText [(ngModel)]="editUserData.email" class="w-full"/>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-start mt-6">
|
<div class="flex justify-start mt-6">
|
||||||
<div *ngIf="!isEditing">
|
@if (!isEditing) {
|
||||||
|
<div>
|
||||||
<p-button label="Edit" severity="info" icon="pi pi-pencil" (onClick)="toggleEdit()"></p-button>
|
<p-button label="Edit" severity="info" icon="pi pi-pencil" (onClick)="toggleEdit()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="isEditing" class="flex gap-2">
|
}
|
||||||
|
@if (isEditing) {
|
||||||
|
<div class="flex gap-2">
|
||||||
<p-button label="Cancel" severity="secondary" icon="pi pi-times" (onClick)="toggleEdit()"></p-button>
|
<p-button label="Cancel" severity="secondary" icon="pi pi-times" (onClick)="toggleEdit()"></p-button>
|
||||||
<p-button label="Save" severity="success" icon="pi pi-check" (onClick)="updateProfile()"></p-button>
|
<p-button label="Save" severity="success" icon="pi pi-check" (onClick)="updateProfile()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -50,19 +66,25 @@
|
|||||||
<div class="p-field mb-4">
|
<div class="p-field mb-4">
|
||||||
<label for="currentPassword">Current Password</label>
|
<label for="currentPassword">Current Password</label>
|
||||||
<p-password id="currentPassword" formControlName="currentPassword" [feedback]="false" fluid></p-password>
|
<p-password id="currentPassword" formControlName="currentPassword" [feedback]="false" fluid></p-password>
|
||||||
<p-message *ngIf="changePasswordForm.get('currentPassword')?.invalid && changePasswordForm.get('currentPassword')?.touched" severity="error" text="Current password is required."></p-message>
|
@if (changePasswordForm.get('currentPassword')?.invalid && changePasswordForm.get('currentPassword')?.touched) {
|
||||||
|
<p-message severity="error" text="Current password is required."></p-message>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="p-field mb-4">
|
<div class="p-field mb-4">
|
||||||
<label for="newPassword">New Password (at least 6 characters)</label>
|
<label for="newPassword">New Password (at least 6 characters)</label>
|
||||||
<p-password id="newPassword" formControlName="newPassword" [feedback]="false" fluid></p-password>
|
<p-password id="newPassword" formControlName="newPassword" [feedback]="false" fluid></p-password>
|
||||||
<p-message *ngIf="changePasswordForm.get('newPassword')?.errors?.['minlength'] && changePasswordForm.get('newPassword')?.touched" severity="error" text="Password must be at least 6 characters long."></p-message>
|
@if (changePasswordForm.get('newPassword')?.errors?.['minlength'] && changePasswordForm.get('newPassword')?.touched) {
|
||||||
|
<p-message severity="error" text="Password must be at least 6 characters long."></p-message>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="p-field mb-4">
|
<div class="p-field mb-4">
|
||||||
<label for="confirmNewPassword">Confirm New Password</label>
|
<label for="confirmNewPassword">Confirm New Password</label>
|
||||||
<p-password id="confirmNewPassword" formControlName="confirmNewPassword" [feedback]="false" fluid></p-password>
|
<p-password id="confirmNewPassword" formControlName="confirmNewPassword" [feedback]="false" fluid></p-password>
|
||||||
<p-message *ngIf="passwordsMismatch" severity="error" text="Passwords do not match."></p-message>
|
@if (passwordsMismatch) {
|
||||||
|
<p-message severity="error" text="Passwords do not match."></p-message>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-start pt-4">
|
<div class="flex justify-start pt-4">
|
||||||
@@ -76,6 +98,8 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!currentUser" class="flex items-center justify-center min-h-[50vh] text-lg">
|
@if (!currentUser) {
|
||||||
|
<div class="flex items-center justify-center min-h-[50vh] text-lg">
|
||||||
Loading user data...
|
Loading user data...
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
+1
-2
@@ -3,7 +3,7 @@ import {Button} from 'primeng/button';
|
|||||||
import {Divider} from 'primeng/divider';
|
import {Divider} from 'primeng/divider';
|
||||||
import {FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
import {FormBuilder, FormGroup, Validators, FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {Password} from 'primeng/password';
|
import {Password} from 'primeng/password';
|
||||||
import {User, UserService} from '../../user-management/user.service';
|
import {User, UserService} from '../../user-management/user.service';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
@@ -18,7 +18,6 @@ import {Message} from 'primeng/message';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
InputText,
|
InputText,
|
||||||
NgIf,
|
|
||||||
Password,
|
Password,
|
||||||
Message
|
Message
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -13,7 +13,8 @@
|
|||||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||||
<p class="py-1">PDF:</p>
|
<p class="py-1">PDF:</p>
|
||||||
<div class="flex gap-4 justify-start">
|
<div class="flex gap-4 justify-start">
|
||||||
<div *ngFor="let item of scopeOptions" class="flex items-center gap-2">
|
@for (item of scopeOptions; track item) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
<p-radiobutton
|
<p-radiobutton
|
||||||
[inputId]="item"
|
[inputId]="item"
|
||||||
name="spread"
|
name="spread"
|
||||||
@@ -23,11 +24,13 @@
|
|||||||
</p-radiobutton>
|
</p-radiobutton>
|
||||||
<label [for]="item">{{ item }}</label>
|
<label [for]="item">{{ item }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="py-1">Epub:</p>
|
<p class="py-1">Epub:</p>
|
||||||
<div class="flex gap-4 justify-start">
|
<div class="flex gap-4 justify-start">
|
||||||
<div *ngFor="let item of scopeOptions" class="flex items-center gap-2">
|
@for (item of scopeOptions; track item) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
<p-radiobutton
|
<p-radiobutton
|
||||||
[inputId]="item"
|
[inputId]="item"
|
||||||
name="spread"
|
name="spread"
|
||||||
@@ -37,11 +40,13 @@
|
|||||||
</p-radiobutton>
|
</p-radiobutton>
|
||||||
<label [for]="item">{{ item }}</label>
|
<label [for]="item">{{ item }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="py-1">CBX:</p>
|
<p class="py-1">CBX:</p>
|
||||||
<div class="flex gap-4 justify-start">
|
<div class="flex gap-4 justify-start">
|
||||||
<div *ngFor="let item of scopeOptions" class="flex items-center gap-2">
|
@for (item of scopeOptions; track item) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
<p-radiobutton
|
<p-radiobutton
|
||||||
[inputId]="item"
|
[inputId]="item"
|
||||||
name="spread"
|
name="spread"
|
||||||
@@ -51,6 +56,7 @@
|
|||||||
</p-radiobutton>
|
</p-radiobutton>
|
||||||
<label [for]="item">{{ item }}</label>
|
<label [for]="item">{{ item }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -69,7 +75,8 @@
|
|||||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||||
<p class="py-1">Page Spread:</p>
|
<p class="py-1">Page Spread:</p>
|
||||||
<div class="flex gap-4 justify-start">
|
<div class="flex gap-4 justify-start">
|
||||||
<div *ngFor="let spread of spreads" class="flex items-center gap-2">
|
@for (spread of spreads; track spread) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
<p-radiobutton
|
<p-radiobutton
|
||||||
[inputId]="spread.key"
|
[inputId]="spread.key"
|
||||||
name="spread"
|
name="spread"
|
||||||
@@ -79,11 +86,13 @@
|
|||||||
</p-radiobutton>
|
</p-radiobutton>
|
||||||
<label [for]="spread.key">{{ spread.name }}</label>
|
<label [for]="spread.key">{{ spread.name }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="py-1">Page Zoom:</p>
|
<p class="py-1">Page Zoom:</p>
|
||||||
<div class="flex gap-4 justify-start">
|
<div class="flex gap-4 justify-start">
|
||||||
<div *ngFor="let zoom of zooms" class="flex items-center gap-2">
|
@for (zoom of zooms; track zoom) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
<p-radiobutton
|
<p-radiobutton
|
||||||
[inputId]="zoom.key"
|
[inputId]="zoom.key"
|
||||||
name="zoom"
|
name="zoom"
|
||||||
@@ -93,6 +102,7 @@
|
|||||||
</p-radiobutton>
|
</p-radiobutton>
|
||||||
<label [for]="zoom.key">{{ zoom.name }}</label>
|
<label [for]="zoom.key">{{ zoom.name }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -173,7 +183,8 @@
|
|||||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||||
<p class="py-1">Page Spread:</p>
|
<p class="py-1">Page Spread:</p>
|
||||||
<div class="flex gap-4 justify-start">
|
<div class="flex gap-4 justify-start">
|
||||||
<div *ngFor="let spread of cbxSpreads" class="flex items-center gap-2">
|
@for (spread of cbxSpreads; track spread) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
<p-radiobutton
|
<p-radiobutton
|
||||||
[inputId]="spread.key"
|
[inputId]="spread.key"
|
||||||
name="spread"
|
name="spread"
|
||||||
@@ -183,11 +194,13 @@
|
|||||||
</p-radiobutton>
|
</p-radiobutton>
|
||||||
<label [for]="spread.key">{{ spread.name }}</label>
|
<label [for]="spread.key">{{ spread.name }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="py-1">Page Zoom:</p>
|
<p class="py-1">Page Zoom:</p>
|
||||||
<div class="flex gap-4 justify-start">
|
<div class="flex gap-4 justify-start">
|
||||||
<div *ngFor="let mode of cbxViewModes" class="flex items-center gap-2">
|
@for (mode of cbxViewModes; track mode) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
<p-radiobutton
|
<p-radiobutton
|
||||||
[inputId]="mode.key"
|
[inputId]="mode.key"
|
||||||
name="zoom"
|
name="zoom"
|
||||||
@@ -197,6 +210,7 @@
|
|||||||
</p-radiobutton>
|
</p-radiobutton>
|
||||||
<label [for]="mode.key">{{ mode.name }}</label>
|
<label [for]="mode.key">{{ mode.name }}</label>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {NgForOf} from '@angular/common';
|
|
||||||
import {Observable, Subscription} from 'rxjs';
|
import {Observable, Subscription} from 'rxjs';
|
||||||
import {Select} from 'primeng/select';
|
import {Select} from 'primeng/select';
|
||||||
import {RadioButton} from 'primeng/radiobutton';
|
import {RadioButton} from 'primeng/radiobutton';
|
||||||
@@ -16,7 +16,7 @@ import {CbxPageSpread, CbxPageViewMode} from '../../book/model/book.model';
|
|||||||
templateUrl: './reader-preferences.component.html',
|
templateUrl: './reader-preferences.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
styleUrls: ['./reader-preferences.component.scss'],
|
styleUrls: ['./reader-preferences.component.scss'],
|
||||||
imports: [Select, FormsModule, NgForOf, RadioButton, Divider, Button, Tooltip]
|
imports: [Select, FormsModule, RadioButton, Divider, Button, Tooltip]
|
||||||
})
|
})
|
||||||
export class ReaderPreferences implements OnInit, OnDestroy {
|
export class ReaderPreferences implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<div *ngIf="userService.userState$ | async as userData">
|
@if (userService.userState$ | async; as userData) {
|
||||||
|
<div>
|
||||||
<div class="rounded-xl overflow-hidden">
|
<div class="rounded-xl overflow-hidden">
|
||||||
<p-tabs [(value)]="activeTab" scrollable>
|
<p-tabs [(value)]="activeTab" scrollable>
|
||||||
<p-tablist>
|
<p-tablist>
|
||||||
<p-tab [value]="SettingsTab.ReaderSettings">Reader Preferences</p-tab>
|
<p-tab [value]="SettingsTab.ReaderSettings">Reader Preferences</p-tab>
|
||||||
<p-tab [value]="SettingsTab.ViewPreferences">View Preferences</p-tab>
|
<p-tab [value]="SettingsTab.ViewPreferences">View Preferences</p-tab>
|
||||||
<ng-container *ngIf="userData.permissions.admin">
|
@if (userData.permissions.admin) {
|
||||||
<p-tab [value]="SettingsTab.MetadataSettings">Metadata Settings</p-tab>
|
<p-tab [value]="SettingsTab.MetadataSettings">Metadata Settings</p-tab>
|
||||||
<p-tab [value]="SettingsTab.ApplicationSettings">Application Settings</p-tab>
|
<p-tab [value]="SettingsTab.ApplicationSettings">Application Settings</p-tab>
|
||||||
<p-tab [value]="SettingsTab.UserManagement">User Management</p-tab>
|
<p-tab [value]="SettingsTab.UserManagement">User Management</p-tab>
|
||||||
<p-tab [value]="SettingsTab.EmailSettings">Email Settings</p-tab>
|
<p-tab [value]="SettingsTab.EmailSettings">Email Settings</p-tab>
|
||||||
<p-tab [value]="SettingsTab.AuthenticationSettings">Authentication</p-tab>
|
<p-tab [value]="SettingsTab.AuthenticationSettings">Authentication</p-tab>
|
||||||
</ng-container>
|
}
|
||||||
</p-tablist>
|
</p-tablist>
|
||||||
|
|
||||||
<p-tabpanels>
|
<p-tabpanels>
|
||||||
<p-tabpanel [value]="SettingsTab.ReaderSettings">
|
<p-tabpanel [value]="SettingsTab.ReaderSettings">
|
||||||
<app-reader-preferences></app-reader-preferences>
|
<app-reader-preferences></app-reader-preferences>
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
<p-tabpanel [value]="SettingsTab.ViewPreferences">
|
<p-tabpanel [value]="SettingsTab.ViewPreferences">
|
||||||
<app-view-preferences-parent></app-view-preferences-parent>
|
<app-view-preferences-parent></app-view-preferences-parent>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
<ng-container *ngIf="userData.permissions.admin">
|
@if (userData.permissions.admin) {
|
||||||
<p-tabpanel [value]="SettingsTab.MetadataSettings">
|
<p-tabpanel [value]="SettingsTab.MetadataSettings">
|
||||||
<app-metadata-settings-component></app-metadata-settings-component>
|
<app-metadata-settings-component></app-metadata-settings-component>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
@@ -36,8 +36,9 @@
|
|||||||
<p-tabpanel [value]="SettingsTab.AuthenticationSettings">
|
<p-tabpanel [value]="SettingsTab.AuthenticationSettings">
|
||||||
<app-authentication-settings></app-authentication-settings>
|
<app-authentication-settings></app-authentication-settings>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
</ng-container>
|
}
|
||||||
</p-tabpanels>
|
</p-tabpanels>
|
||||||
</p-tabs>
|
</p-tabs>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
import {Component, inject, OnDestroy, OnInit} from '@angular/core';
|
||||||
import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
|
import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
|
||||||
import {UserService} from './user-management/user.service';
|
import {UserService} from './user-management/user.service';
|
||||||
import {AsyncPipe, NgIf} from '@angular/common';
|
import { AsyncPipe } from '@angular/common';
|
||||||
import {EmailComponent} from './email/email.component';
|
import {EmailComponent} from './email/email.component';
|
||||||
import {GlobalPreferencesComponent} from './global-preferences/global-preferences.component';
|
import {GlobalPreferencesComponent} from './global-preferences/global-preferences.component';
|
||||||
import {ActivatedRoute, Router} from '@angular/router';
|
import {ActivatedRoute, Router} from '@angular/router';
|
||||||
@@ -30,7 +30,6 @@ export enum SettingsTab {
|
|||||||
Tab,
|
Tab,
|
||||||
TabPanels,
|
TabPanels,
|
||||||
TabPanel,
|
TabPanel,
|
||||||
NgIf,
|
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
EmailComponent,
|
EmailComponent,
|
||||||
GlobalPreferencesComponent,
|
GlobalPreferencesComponent,
|
||||||
|
|||||||
+15
-5
@@ -4,33 +4,41 @@
|
|||||||
<label class="w-40 text-right font-medium">Full Name:</label>
|
<label class="w-40 text-right font-medium">Full Name:</label>
|
||||||
<input type="text" pInputText formControlName="name" placeholder="Enter full name..." class="w-full md:w-80"/>
|
<input type="text" pInputText formControlName="name" placeholder="Enter full name..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('name')?.invalid && (userForm.get('name')?.dirty || userForm.get('name')?.touched)">
|
@if (userForm.get('name')?.invalid && (userForm.get('name')?.dirty || userForm.get('name')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Name is required and must be at least 3 characters.
|
Name is required and must be at least 3 characters.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Email:</label>
|
<label class="w-40 text-right font-medium">Email:</label>
|
||||||
<input type="email" pInputText formControlName="email" placeholder="Enter email..." class="w-full md:w-80"/>
|
<input type="email" pInputText formControlName="email" placeholder="Enter email..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('email')?.invalid && (userForm.get('email')?.dirty || userForm.get('email')?.touched)">
|
@if (userForm.get('email')?.invalid && (userForm.get('email')?.dirty || userForm.get('email')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Enter a valid email address.
|
Enter a valid email address.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Username:</label>
|
<label class="w-40 text-right font-medium">Username:</label>
|
||||||
<input type="text" pInputText formControlName="username" placeholder="Enter username..." class="w-full md:w-80"/>
|
<input type="text" pInputText formControlName="username" placeholder="Enter username..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('username')?.invalid && (userForm.get('username')?.dirty || userForm.get('username')?.touched)">
|
@if (userForm.get('username')?.invalid && (userForm.get('username')?.dirty || userForm.get('username')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Username is required.
|
Username is required.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Password:</label>
|
<label class="w-40 text-right font-medium">Password:</label>
|
||||||
<input type="password" pInputText formControlName="password" placeholder="Enter password..." class="w-full md:w-80"/>
|
<input type="password" pInputText formControlName="password" placeholder="Enter password..." class="w-full md:w-80"/>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched)">
|
@if (userForm.get('password')?.invalid && (userForm.get('password')?.dirty || userForm.get('password')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
Password must be at least 6 characters long.
|
Password must be at least 6 characters long.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div class="flex items-center gap-4">
|
<div class="flex items-center gap-4">
|
||||||
<label class="w-40 text-right font-medium">Accessible Libraries:</label>
|
<label class="w-40 text-right font-medium">Accessible Libraries:</label>
|
||||||
@@ -44,9 +52,11 @@
|
|||||||
appendTo="body">
|
appendTo="body">
|
||||||
</p-multiselect>
|
</p-multiselect>
|
||||||
</div>
|
</div>
|
||||||
<small class="text-red-500 pl-44" *ngIf="userForm.get('selectedLibraries')?.invalid && (userForm.get('selectedLibraries')?.dirty || userForm.get('selectedLibraries')?.touched)">
|
@if (userForm.get('selectedLibraries')?.invalid && (userForm.get('selectedLibraries')?.dirty || userForm.get('selectedLibraries')?.touched)) {
|
||||||
|
<small class="text-red-500 pl-44">
|
||||||
At least one library must be selected.
|
At least one library must be selected.
|
||||||
</small>
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p class="text-right w-40 font-medium">Permissions:</p>
|
<p class="text-right w-40 font-medium">Permissions:</p>
|
||||||
|
|||||||
+2
-3
@@ -9,7 +9,7 @@ import {LibraryService} from '../../../book/service/library.service';
|
|||||||
import {UserService} from '../user.service';
|
import {UserService} from '../user.service';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-create-user-dialog',
|
selector: 'app-create-user-dialog',
|
||||||
@@ -20,8 +20,7 @@ import {NgIf} from '@angular/common';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
MultiSelectModule,
|
MultiSelectModule,
|
||||||
Button,
|
Button
|
||||||
NgIf
|
|
||||||
],
|
],
|
||||||
templateUrl: './create-user-dialog.component.html',
|
templateUrl: './create-user-dialog.component.html',
|
||||||
styleUrl: './create-user-dialog.component.scss'
|
styleUrl: './create-user-dialog.component.scss'
|
||||||
|
|||||||
@@ -34,16 +34,24 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>{{ user.username }}</td>
|
<td>{{ user.username }}</td>
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="user.isEditing" type="text" [(ngModel)]="user.name" class="p-inputtext w-full"/>
|
@if (user.isEditing) {
|
||||||
<span *ngIf="!user.isEditing">{{ user.name }}</span>
|
<input type="text" [(ngModel)]="user.name" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<span>{{ user.name }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input *ngIf="user.isEditing" type="email" [(ngModel)]="user.email" class="p-inputtext w-full"/>
|
@if (user.isEditing) {
|
||||||
<span *ngIf="!user.isEditing">{{ user.email }}</span>
|
<input type="email" [(ngModel)]="user.email" class="p-inputtext w-full"/>
|
||||||
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<span>{{ user.email }}</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@if (user.isEditing) {
|
||||||
<p-multiSelect
|
<p-multiSelect
|
||||||
*ngIf="user.isEditing"
|
|
||||||
[options]="allLibraries"
|
[options]="allLibraries"
|
||||||
optionLabel="name"
|
optionLabel="name"
|
||||||
optionValue="id"
|
optionValue="id"
|
||||||
@@ -51,39 +59,72 @@
|
|||||||
placeholder="Select Libraries"
|
placeholder="Select Libraries"
|
||||||
appendTo="body">
|
appendTo="body">
|
||||||
</p-multiSelect>
|
</p-multiSelect>
|
||||||
<span *ngIf="!user.isEditing">
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<span>
|
||||||
{{ user.libraryNames }}
|
{{ user.libraryNames }}
|
||||||
</span>
|
</span>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.admin" *ngIf="user.isEditing"></p-checkbox>
|
@if (user.isEditing) {
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.admin" disabled *ngIf="!user.isEditing"></p-checkbox>
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.admin"></p-checkbox>
|
||||||
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.admin" disabled></p-checkbox>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canUpload" *ngIf="user.isEditing"></p-checkbox>
|
@if (user.isEditing) {
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canUpload" disabled *ngIf="!user.isEditing"></p-checkbox>
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canUpload"></p-checkbox>
|
||||||
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canUpload" disabled></p-checkbox>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canDownload" *ngIf="user.isEditing"></p-checkbox>
|
@if (user.isEditing) {
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canDownload" disabled *ngIf="!user.isEditing"></p-checkbox>
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canDownload"></p-checkbox>
|
||||||
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canDownload" disabled></p-checkbox>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEditMetadata" *ngIf="user.isEditing"></p-checkbox>
|
@if (user.isEditing) {
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEditMetadata" disabled *ngIf="!user.isEditing"></p-checkbox>
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEditMetadata"></p-checkbox>
|
||||||
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEditMetadata" disabled></p-checkbox>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canManipulateLibrary" *ngIf="user.isEditing"></p-checkbox>
|
@if (user.isEditing) {
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canManipulateLibrary" disabled *ngIf="!user.isEditing"></p-checkbox>
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canManipulateLibrary"></p-checkbox>
|
||||||
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canManipulateLibrary" disabled></p-checkbox>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEmailBook" *ngIf="user.isEditing"></p-checkbox>
|
@if (user.isEditing) {
|
||||||
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEmailBook" disabled *ngIf="!user.isEditing"></p-checkbox>
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEmailBook"></p-checkbox>
|
||||||
|
}
|
||||||
|
@if (!user.isEditing) {
|
||||||
|
<p-checkbox [binary]="true" [(ngModel)]="user.permissions.canEmailBook" disabled></p-checkbox>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<ng-container>
|
<ng-container>
|
||||||
<p-button *ngIf="!user.isEditing" icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEdit(user)"></p-button>
|
@if (!user.isEditing) {
|
||||||
<p-button *ngIf="user.isEditing" icon="pi pi-check" outlined="true" severity="success" (onClick)="saveUser(user)"></p-button>
|
<p-button icon="pi pi-pencil" outlined="true" severity="info" (onClick)="toggleEdit(user)"></p-button>
|
||||||
<p-button *ngIf="user.isEditing" icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEdit(user)"></p-button>
|
}
|
||||||
|
@if (user.isEditing) {
|
||||||
|
<p-button icon="pi pi-check" outlined="true" severity="success" (onClick)="saveUser(user)"></p-button>
|
||||||
|
}
|
||||||
|
@if (user.isEditing) {
|
||||||
|
<p-button icon="pi pi-times" outlined="true" severity="danger" (onClick)="toggleEdit(user)"></p-button>
|
||||||
|
}
|
||||||
</ng-container>
|
</ng-container>
|
||||||
<p-button
|
<p-button
|
||||||
icon="pi pi-pencil"
|
icon="pi pi-pencil"
|
||||||
@@ -110,7 +151,9 @@
|
|||||||
<div class="flex flex-col gap-8 items-center">
|
<div class="flex flex-col gap-8 items-center">
|
||||||
<p-password [(ngModel)]="newPassword" placeholder="New Password" [feedback]="false" class="w-full" fluid></p-password>
|
<p-password [(ngModel)]="newPassword" placeholder="New Password" [feedback]="false" class="w-full" fluid></p-password>
|
||||||
<p-password [(ngModel)]="confirmNewPassword" placeholder="Confirm Password" [feedback]="false" class="w-full" fluid></p-password>
|
<p-password [(ngModel)]="confirmNewPassword" placeholder="Confirm Password" [feedback]="false" class="w-full" fluid></p-password>
|
||||||
<p *ngIf="passwordError" class="p-error text-red-500 w-full text-left">{{ passwordError }}</p>
|
@if (passwordError) {
|
||||||
|
<p class="p-error text-red-500 w-full text-left">{{ passwordError }}</p>
|
||||||
|
}
|
||||||
<div class="flex gap-4 w-full justify-end">
|
<div class="flex gap-4 w-full justify-end">
|
||||||
<p-button label="Cancel" icon="pi pi-times" severity="secondary" (onClick)="isPasswordDialogVisible = false"></p-button>
|
<p-button label="Cancel" icon="pi pi-times" severity="secondary" (onClick)="isPasswordDialogVisible = false"></p-button>
|
||||||
<p-button label="Change" icon="pi pi-check" severity="success" (onClick)="submitPasswordChange()"></p-button>
|
<p-button label="Change" icon="pi pi-check" severity="success" (onClick)="submitPasswordChange()"></p-button>
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import {Button} from 'primeng/button';
|
|||||||
import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
|
import {DialogService, DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||||
import {CreateUserDialogComponent} from './create-user-dialog/create-user-dialog.component';
|
import {CreateUserDialogComponent} from './create-user-dialog/create-user-dialog.component';
|
||||||
import {TableModule} from 'primeng/table';
|
import {TableModule} from 'primeng/table';
|
||||||
import {LowerCasePipe, NgIf, NgStyle, TitleCasePipe} from '@angular/common';
|
import { LowerCasePipe, NgStyle, TitleCasePipe } from '@angular/common';
|
||||||
import {User, UserService} from './user.service';
|
import {User, UserService} from './user.service';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
import {Checkbox} from 'primeng/checkbox';
|
import {Checkbox} from 'primeng/checkbox';
|
||||||
@@ -21,7 +21,6 @@ import {filter, take} from 'rxjs/operators';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
Button,
|
Button,
|
||||||
TableModule,
|
TableModule,
|
||||||
NgIf,
|
|
||||||
Checkbox,
|
Checkbox,
|
||||||
NgStyle,
|
NgStyle,
|
||||||
MultiSelect,
|
MultiSelect,
|
||||||
|
|||||||
+5
-9
@@ -27,7 +27,8 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pl-2 pt-2 min-w-[400px] max-w-[1000px]">
|
<div class="pl-2 pt-2 min-w-[400px] max-w-[1000px]">
|
||||||
<p-table *ngIf="overrides.length > 0" [value]="overrides" class="relative z-0" [responsiveLayout]="'scroll'">
|
@if (overrides.length > 0) {
|
||||||
|
<p-table [value]="overrides" class="relative z-0" [responsiveLayout]="'scroll'">
|
||||||
<ng-template pTemplate="header">
|
<ng-template pTemplate="header">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="min-w-[150px] max-w-[220px]">Type</th>
|
<th class="min-w-[150px] max-w-[220px]">Type</th>
|
||||||
@@ -38,31 +39,25 @@
|
|||||||
<th class="w-[75px] text-center"></th>
|
<th class="w-[75px] text-center"></th>
|
||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template pTemplate="body" let-override let-rowIndex="rowIndex">
|
<ng-template pTemplate="body" let-override let-rowIndex="rowIndex">
|
||||||
<tr>
|
<tr>
|
||||||
<td><p-select size="small" [options]="entityTypeOptions" [(ngModel)]="override.entityType"
|
<td><p-select size="small" [options]="entityTypeOptions" [(ngModel)]="override.entityType"
|
||||||
class="w-full" appendTo="body"></p-select></td>
|
class="w-full" appendTo="body"></p-select></td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<ng-container *ngIf="override.entityType">
|
@if (override.entityType) {
|
||||||
<p-select size="small"
|
<p-select size="small"
|
||||||
[options]="getAvailableEntities(rowIndex, override.entityType)"
|
[options]="getAvailableEntities(rowIndex, override.entityType)"
|
||||||
[(ngModel)]="override.library"
|
[(ngModel)]="override.library"
|
||||||
optionLabel="label" optionValue="value"
|
optionLabel="label" optionValue="value"
|
||||||
class="w-full" appendTo="body"></p-select>
|
class="w-full" appendTo="body"></p-select>
|
||||||
</ng-container>
|
}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td><p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
<td><p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||||
[(ngModel)]="override.sort" class="w-full" appendTo="body"></p-select></td>
|
[(ngModel)]="override.sort" class="w-full" appendTo="body"></p-select></td>
|
||||||
|
|
||||||
<td><p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
<td><p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||||
class="w-full" appendTo="body"></p-select></td>
|
class="w-full" appendTo="body"></p-select></td>
|
||||||
|
|
||||||
<td><p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
<td><p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
||||||
class="w-full" appendTo="body"></p-select></td>
|
class="w-full" appendTo="body"></p-select></td>
|
||||||
|
|
||||||
<td class="text-center">
|
<td class="text-center">
|
||||||
<p-button icon="pi pi-trash" severity="danger" class="p-button-sm" [outlined]="true"
|
<p-button icon="pi pi-trash" severity="danger" class="p-button-sm" [outlined]="true"
|
||||||
(onClick)="removeOverride(rowIndex)"></p-button>
|
(onClick)="removeOverride(rowIndex)"></p-button>
|
||||||
@@ -70,6 +65,7 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-table>
|
</p-table>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-start px-6 pt-4">
|
<div class="flex justify-start px-6 pt-4">
|
||||||
|
|||||||
+1
-2
@@ -1,6 +1,6 @@
|
|||||||
import {Component, inject, OnInit} from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
import {Select} from 'primeng/select';
|
import {Select} from 'primeng/select';
|
||||||
import {TableModule} from 'primeng/table';
|
import {TableModule} from 'primeng/table';
|
||||||
@@ -21,7 +21,6 @@ import {filter, take} from 'rxjs/operators';
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
Button,
|
Button,
|
||||||
NgIf,
|
|
||||||
TableModule,
|
TableModule,
|
||||||
ToastModule
|
ToastModule
|
||||||
],
|
],
|
||||||
|
|||||||
+3
-1
@@ -1,3 +1,5 @@
|
|||||||
<div *ngIf="loading" class="loading-overlay">
|
@if (loading) {
|
||||||
|
<div class="loading-overlay">
|
||||||
<p-progressSpinner></p-progressSpinner>
|
<p-progressSpinner></p-progressSpinner>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ import {Component, OnInit, OnDestroy, inject} from '@angular/core';
|
|||||||
import { Subscription } from 'rxjs';
|
import { Subscription } from 'rxjs';
|
||||||
import {LoadingService} from '../../../core/service/loading.service';
|
import {LoadingService} from '../../../core/service/loading.service';
|
||||||
import {ProgressSpinner} from 'primeng/progressspinner';
|
import {ProgressSpinner} from 'primeng/progressspinner';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-loading-overlay',
|
selector: 'app-loading-overlay',
|
||||||
templateUrl: './loading-overlay.component.html',
|
templateUrl: './loading-overlay.component.html',
|
||||||
imports: [
|
imports: [
|
||||||
ProgressSpinner,
|
ProgressSpinner
|
||||||
NgIf
|
|
||||||
],
|
],
|
||||||
standalone: true,
|
standalone: true,
|
||||||
styleUrls: ['./loading-overlay.component.scss']
|
styleUrls: ['./loading-overlay.component.scss']
|
||||||
|
|||||||
+22
-18
@@ -1,14 +1,12 @@
|
|||||||
|
@if ((libraryState$ | async)?.libraries; as libraries) {
|
||||||
<div
|
<div
|
||||||
*ngIf="(libraryState$ | async)?.libraries as libraries"
|
|
||||||
class="flex flex-col gap-10 p-4 items-center justify-center min-w-[500px] max-w-[700px] w-full">
|
class="flex flex-col gap-10 p-4 items-center justify-center min-w-[500px] max-w-[700px] w-full">
|
||||||
|
|
||||||
<p-select
|
<p-select
|
||||||
[options]="libraries"
|
[options]="libraries"
|
||||||
optionLabel="name"
|
optionLabel="name"
|
||||||
placeholder="Select Library"
|
placeholder="Select Library"
|
||||||
[(ngModel)]="selectedLibrary"
|
[(ngModel)]="selectedLibrary"
|
||||||
class="w-full"></p-select>
|
class="w-full"></p-select>
|
||||||
|
|
||||||
<p-select
|
<p-select
|
||||||
[options]="selectedLibrary?.paths"
|
[options]="selectedLibrary?.paths"
|
||||||
optionLabel="path"
|
optionLabel="path"
|
||||||
@@ -16,7 +14,6 @@
|
|||||||
[(ngModel)]="selectedPath"
|
[(ngModel)]="selectedPath"
|
||||||
[disabled]="!selectedLibrary"
|
[disabled]="!selectedLibrary"
|
||||||
class="w-full"></p-select>
|
class="w-full"></p-select>
|
||||||
|
|
||||||
<p-fileupload class="w-full" name="file"
|
<p-fileupload class="w-full" name="file"
|
||||||
[maxFileSize]="maxFileSizeBytes"
|
[maxFileSize]="maxFileSizeBytes"
|
||||||
[customUpload]="true"
|
[customUpload]="true"
|
||||||
@@ -32,14 +29,12 @@
|
|||||||
[rounded]="true"
|
[rounded]="true"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
[disabled]="isChooseDisabled()"/>
|
[disabled]="isChooseDisabled()"/>
|
||||||
|
|
||||||
<p-button (onClick)="uploadEvent(uploadCallback)"
|
<p-button (onClick)="uploadEvent(uploadCallback)"
|
||||||
icon="pi pi-cloud-upload"
|
icon="pi pi-cloud-upload"
|
||||||
[rounded]="true"
|
[rounded]="true"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
severity="success"
|
severity="success"
|
||||||
[disabled]="isUploadDisabled()"/>
|
[disabled]="isUploadDisabled()"/>
|
||||||
|
|
||||||
<p-button (onClick)="onClear(clearCallback)"
|
<p-button (onClick)="onClear(clearCallback)"
|
||||||
icon="pi pi-times"
|
icon="pi pi-times"
|
||||||
[rounded]="true"
|
[rounded]="true"
|
||||||
@@ -49,13 +44,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template #content let-files let-removeFileCallback="removeFileCallback">
|
<ng-template #content let-files let-removeFileCallback="removeFileCallback">
|
||||||
<div class="flex flex-col gap-8 px-4">
|
<div class="flex flex-col gap-8 px-4">
|
||||||
<div *ngIf="files?.length > 0">
|
@if (files?.length > 0) {
|
||||||
|
<div>
|
||||||
<div class="max-h-96 overflow-y-auto pr-2">
|
<div class="max-h-96 overflow-y-auto pr-2">
|
||||||
<div class="flex flex-wrap">
|
<div class="flex flex-wrap">
|
||||||
<div *ngFor="let uploadFile of this.files; let i = index" class="flex justify-between items-center w-full gap-4">
|
@for (uploadFile of this.files; track uploadFile; let i = $index) {
|
||||||
|
<div class="flex justify-between items-center w-full gap-4">
|
||||||
<div class="flex items-center gap-4 overflow-hidden flex-1">
|
<div class="flex items-center gap-4 overflow-hidden flex-1">
|
||||||
<p-badge [value]="uploadFile.status" [severity]="getBadgeSeverity(uploadFile.status)" class="shrink-0"/>
|
<p-badge [value]="uploadFile.status" [severity]="getBadgeSeverity(uploadFile.status)" class="shrink-0"/>
|
||||||
<span class="font-semibold text-ellipsis whitespace-nowrap overflow-hidden flex-1">
|
<span class="font-semibold text-ellipsis whitespace-nowrap overflow-hidden flex-1">
|
||||||
@@ -63,40 +59,48 @@
|
|||||||
</span>
|
</span>
|
||||||
<div class="shrink-0">{{ formatSize(uploadFile.file.size) }}</div>
|
<div class="shrink-0">{{ formatSize(uploadFile.file.size) }}</div>
|
||||||
</div>
|
</div>
|
||||||
<ng-container [ngSwitch]="uploadFile.status">
|
@switch (uploadFile.status) {
|
||||||
<p-button *ngSwitchCase="'Pending'"
|
@case ('Pending') {
|
||||||
|
<p-button
|
||||||
icon="pi pi-times"
|
icon="pi pi-times"
|
||||||
(click)="onRemoveTemplatingFile($event, uploadFile.file, removeFileCallback, i)"
|
(click)="onRemoveTemplatingFile($event, uploadFile.file, removeFileCallback, i)"
|
||||||
severity="danger"
|
severity="danger"
|
||||||
[text]="true"/>
|
[text]="true"/>
|
||||||
<i *ngSwitchCase="'Uploading'"
|
}
|
||||||
|
@case ('Uploading') {
|
||||||
|
<i
|
||||||
class="pi pi-spin pi-spinner p-3"
|
class="pi pi-spin pi-spinner p-3"
|
||||||
style="color: slateblue"
|
style="color: slateblue"
|
||||||
pTooltip="Uploading"
|
pTooltip="Uploading"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
</i>
|
</i>
|
||||||
<i *ngSwitchCase="'Uploaded'"
|
}
|
||||||
|
@case ('Uploaded') {
|
||||||
|
<i
|
||||||
class="pi pi-check p-3"
|
class="pi pi-check p-3"
|
||||||
style="color: green"
|
style="color: green"
|
||||||
pTooltip="Uploaded"
|
pTooltip="Uploaded"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
</i>
|
</i>
|
||||||
<i *ngSwitchCase="'Failed'"
|
}
|
||||||
|
@case ('Failed') {
|
||||||
|
<i
|
||||||
class="pi pi-exclamation-triangle p-3"
|
class="pi pi-exclamation-triangle p-3"
|
||||||
style="color: darkred"
|
style="color: darkred"
|
||||||
pTooltip="{{ uploadFile.errorMessage || 'Upload failed' }}"
|
pTooltip="{{ uploadFile.errorMessage || 'Upload failed' }}"
|
||||||
tooltipPosition="top">
|
tooltipPosition="top">
|
||||||
</i>
|
</i>
|
||||||
</ng-container>
|
}
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
|
||||||
<ng-template #file></ng-template>
|
<ng-template #file></ng-template>
|
||||||
|
|
||||||
<ng-template #empty>
|
<ng-template #empty>
|
||||||
<div class="flex items-center justify-center flex-col text-center">
|
<div class="flex items-center justify-center flex-col text-center">
|
||||||
<i class="pi pi-cloud-upload !border-2 !rounded-full !p-8 !text-4xl !text-muted-color"></i>
|
<i class="pi pi-cloud-upload !border-2 !rounded-full !p-8 !text-4xl !text-muted-color"></i>
|
||||||
@@ -107,5 +111,5 @@
|
|||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</p-fileupload>
|
</p-fileupload>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import {Component, inject, OnInit} from '@angular/core';
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
import {FileSelectEvent, FileUpload, FileUploadHandlerEvent} from 'primeng/fileupload';
|
import {FileSelectEvent, FileUpload, FileUploadHandlerEvent} from 'primeng/fileupload';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {AsyncPipe, NgForOf, NgIf, NgSwitch, NgSwitchCase} from '@angular/common';
|
import { AsyncPipe } from '@angular/common';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {MessageService} from 'primeng/api';
|
import {MessageService} from 'primeng/api';
|
||||||
import {Select} from 'primeng/select';
|
import {Select} from 'primeng/select';
|
||||||
@@ -32,12 +32,8 @@ interface UploadingFile {
|
|||||||
Button,
|
Button,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
NgIf,
|
|
||||||
Select,
|
Select,
|
||||||
Badge,
|
Badge,
|
||||||
NgForOf,
|
|
||||||
NgSwitchCase,
|
|
||||||
NgSwitch,
|
|
||||||
Tooltip
|
Tooltip
|
||||||
],
|
],
|
||||||
templateUrl: './book-uploader.component.html',
|
templateUrl: './book-uploader.component.html',
|
||||||
|
|||||||
+6
-2
@@ -21,8 +21,12 @@
|
|||||||
<ng-template pTemplate="body" let-product>
|
<ng-template pTemplate="body" let-product>
|
||||||
<tr class="cursor-pointer hover:bg-white/10" (click)="onRowClick(product)">
|
<tr class="cursor-pointer hover:bg-white/10" (click)="onRowClick(product)">
|
||||||
<td>
|
<td>
|
||||||
<i *ngIf="product === '...'" class="pi pi-arrow-up"></i>
|
@if (product === '...') {
|
||||||
<i *ngIf="product !== '...'" class="pi pi-folder-open"></i>
|
<i class="pi pi-arrow-up"></i>
|
||||||
|
}
|
||||||
|
@if (product !== '...') {
|
||||||
|
<i class="pi pi-folder-open"></i>
|
||||||
|
}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ product }}</td>
|
<td>{{ product }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
+2
-3
@@ -3,7 +3,7 @@ import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
|||||||
import {UtilityService} from './utility.service';
|
import {UtilityService} from './utility.service';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {TableModule} from 'primeng/table';
|
import {TableModule} from 'primeng/table';
|
||||||
import {NgIf} from '@angular/common';
|
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -13,8 +13,7 @@ import {InputText} from 'primeng/inputtext';
|
|||||||
imports: [
|
imports: [
|
||||||
Button,
|
Button,
|
||||||
TableModule,
|
TableModule,
|
||||||
InputText,
|
InputText
|
||||||
NgIf
|
|
||||||
],
|
],
|
||||||
styleUrls: ['./directory-picker.component.scss']
|
styleUrls: ['./directory-picker.component.scss']
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -6,12 +6,13 @@
|
|||||||
[style]="{ width: '500px', height: '500px' }">
|
[style]="{ width: '500px', height: '500px' }">
|
||||||
<input type="text" placeholder="Search icons..." [(ngModel)]="searchText" class="icon-search"/>
|
<input type="text" placeholder="Search icons..." [(ngModel)]="searchText" class="icon-search"/>
|
||||||
<div class="icon-grid">
|
<div class="icon-grid">
|
||||||
|
@for (icon of filteredIcons(); track icon) {
|
||||||
<div
|
<div
|
||||||
*ngFor="let icon of filteredIcons()"
|
|
||||||
class="icon-item"
|
class="icon-item"
|
||||||
(click)="selectIcon(icon)"
|
(click)="selectIcon(icon)"
|
||||||
[class.selected]="icon === selectedIcon">
|
[class.selected]="icon === selectedIcon">
|
||||||
<i [class]="icon"></i>
|
<i [class]="icon"></i>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</p-dialog>
|
</p-dialog>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||||
import {DialogModule} from 'primeng/dialog';
|
import {DialogModule} from 'primeng/dialog';
|
||||||
import {NgForOf} from '@angular/common';
|
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -9,7 +9,6 @@ import {FormsModule} from '@angular/forms';
|
|||||||
styleUrls: ['./icon-picker.component.scss'],
|
styleUrls: ['./icon-picker.component.scss'],
|
||||||
imports: [
|
imports: [
|
||||||
DialogModule,
|
DialogModule,
|
||||||
NgForOf,
|
|
||||||
FormsModule
|
FormsModule
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true
|
||||||
|
|||||||
Reference in New Issue
Block a user