Merge pull request #456 from adityachandelgit/develop
Merge Develop into Master for Release
This commit is contained in:
@@ -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
@@ -16,6 +16,7 @@ public class MetadataRefreshOptions {
|
|||||||
private MetadataProvider allP1;
|
private MetadataProvider allP1;
|
||||||
private MetadataProvider allP2;
|
private MetadataProvider allP2;
|
||||||
private MetadataProvider allP3;
|
private MetadataProvider allP3;
|
||||||
|
private MetadataProvider allP4;
|
||||||
private boolean refreshCovers;
|
private boolean refreshCovers;
|
||||||
private boolean mergeCategories;
|
private boolean mergeCategories;
|
||||||
private FieldOptions fieldOptions;
|
private FieldOptions fieldOptions;
|
||||||
@@ -46,6 +47,7 @@ public class MetadataRefreshOptions {
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public static class FieldProvider {
|
public static class FieldProvider {
|
||||||
|
private MetadataProvider p4;
|
||||||
private MetadataProvider p3;
|
private MetadataProvider p3;
|
||||||
private MetadataProvider p2;
|
private MetadataProvider p2;
|
||||||
private MetadataProvider p1;
|
private MetadataProvider p1;
|
||||||
|
|||||||
+15
-14
@@ -85,33 +85,33 @@ public class SettingPersistenceHelper {
|
|||||||
|
|
||||||
MetadataRefreshOptions getDefaultMetadataRefreshOptions() {
|
MetadataRefreshOptions getDefaultMetadataRefreshOptions() {
|
||||||
MetadataRefreshOptions.FieldProvider titleProviders =
|
MetadataRefreshOptions.FieldProvider titleProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(MetadataProvider.Google, MetadataProvider.GoodReads, MetadataProvider.Amazon);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider subtitleProviders =
|
MetadataRefreshOptions.FieldProvider subtitleProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider descriptionProviders =
|
MetadataRefreshOptions.FieldProvider descriptionProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(MetadataProvider.Google, MetadataProvider.GoodReads, MetadataProvider.Amazon);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider authorsProviders =
|
MetadataRefreshOptions.FieldProvider authorsProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(MetadataProvider.Google, MetadataProvider.GoodReads, MetadataProvider.Amazon);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider publisherProviders =
|
MetadataRefreshOptions.FieldProvider publisherProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider publishedDateProviders =
|
MetadataRefreshOptions.FieldProvider publishedDateProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider seriesNameProviders =
|
MetadataRefreshOptions.FieldProvider seriesNameProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider seriesNumberProviders =
|
MetadataRefreshOptions.FieldProvider seriesNumberProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider seriesTotalProviders =
|
MetadataRefreshOptions.FieldProvider seriesTotalProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider isbn13Providers =
|
MetadataRefreshOptions.FieldProvider isbn13Providers =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider isbn10Providers =
|
MetadataRefreshOptions.FieldProvider isbn10Providers =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider languageProviders =
|
MetadataRefreshOptions.FieldProvider languageProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(null, null, null);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider categoriesProviders =
|
MetadataRefreshOptions.FieldProvider categoriesProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
MetadataRefreshOptions.FieldProvider coverProviders =
|
MetadataRefreshOptions.FieldProvider coverProviders =
|
||||||
new MetadataRefreshOptions.FieldProvider(MetadataProvider.Google, MetadataProvider.GoodReads, MetadataProvider.Amazon);
|
new MetadataRefreshOptions.FieldProvider(null, MetadataProvider.Google, MetadataProvider.Amazon, MetadataProvider.GoodReads);
|
||||||
|
|
||||||
MetadataRefreshOptions.FieldOptions fieldOptions = new MetadataRefreshOptions.FieldOptions(
|
MetadataRefreshOptions.FieldOptions fieldOptions = new MetadataRefreshOptions.FieldOptions(
|
||||||
titleProviders,
|
titleProviders,
|
||||||
@@ -134,6 +134,7 @@ public class SettingPersistenceHelper {
|
|||||||
MetadataProvider.GoodReads,
|
MetadataProvider.GoodReads,
|
||||||
MetadataProvider.Amazon,
|
MetadataProvider.Amazon,
|
||||||
MetadataProvider.Google,
|
MetadataProvider.Google,
|
||||||
|
null,
|
||||||
false,
|
false,
|
||||||
true,
|
true,
|
||||||
fieldOptions
|
fieldOptions
|
||||||
|
|||||||
+36
-3
@@ -192,6 +192,9 @@ public class BookMetadataService {
|
|||||||
}
|
}
|
||||||
metadata.setThumbnailUrl(resolveFieldAsString(metadataMap, fieldOptions.getCover(), BookMetadata::getThumbnailUrl));
|
metadata.setThumbnailUrl(resolveFieldAsString(metadataMap, fieldOptions.getCover(), BookMetadata::getThumbnailUrl));
|
||||||
|
|
||||||
|
if (request.getRefreshOptions().getAllP4() != null) {
|
||||||
|
setOtherUnspecifiedMetadata(metadataMap, metadata, request.getRefreshOptions().getAllP4());
|
||||||
|
}
|
||||||
if (request.getRefreshOptions().getAllP3() != null) {
|
if (request.getRefreshOptions().getAllP3() != null) {
|
||||||
setOtherUnspecifiedMetadata(metadataMap, metadata, request.getRefreshOptions().getAllP3());
|
setOtherUnspecifiedMetadata(metadataMap, metadata, request.getRefreshOptions().getAllP3());
|
||||||
}
|
}
|
||||||
@@ -232,6 +235,12 @@ public class BookMetadataService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
protected String resolveFieldAsString(Map<MetadataProvider, BookMetadata> metadataMap, MetadataRefreshOptions.FieldProvider fieldProvider, FieldValueExtractor fieldValueExtractor) {
|
protected String resolveFieldAsString(Map<MetadataProvider, BookMetadata> metadataMap, MetadataRefreshOptions.FieldProvider fieldProvider, FieldValueExtractor fieldValueExtractor) {
|
||||||
String value = null;
|
String value = null;
|
||||||
|
if (fieldProvider.getP4() != null && metadataMap.containsKey(fieldProvider.getP4())) {
|
||||||
|
String newValue = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP4()));
|
||||||
|
if (newValue != null) {
|
||||||
|
value = newValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (fieldProvider.getP3() != null && metadataMap.containsKey(fieldProvider.getP3())) {
|
if (fieldProvider.getP3() != null && metadataMap.containsKey(fieldProvider.getP3())) {
|
||||||
String newValue = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP3()));
|
String newValue = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP3()));
|
||||||
if (newValue != null) {
|
if (newValue != null) {
|
||||||
@@ -255,6 +264,12 @@ public class BookMetadataService {
|
|||||||
|
|
||||||
List<String> getAllCategories(Map<MetadataProvider, BookMetadata> metadataMap, MetadataRefreshOptions.FieldProvider fieldProvider, FieldValueExtractorList fieldValueExtractor) {
|
List<String> getAllCategories(Map<MetadataProvider, BookMetadata> metadataMap, MetadataRefreshOptions.FieldProvider fieldProvider, FieldValueExtractorList fieldValueExtractor) {
|
||||||
Set<String> uniqueCategories = new HashSet<>();
|
Set<String> uniqueCategories = new HashSet<>();
|
||||||
|
if (fieldProvider.getP4() != null && metadataMap.containsKey(fieldProvider.getP4())) {
|
||||||
|
List<String> extracted = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP4()));
|
||||||
|
if (extracted != null) {
|
||||||
|
uniqueCategories.addAll(extracted);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (fieldProvider.getP3() != null && metadataMap.containsKey(fieldProvider.getP3())) {
|
if (fieldProvider.getP3() != null && metadataMap.containsKey(fieldProvider.getP3())) {
|
||||||
List<String> extracted = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP3()));
|
List<String> extracted = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP3()));
|
||||||
if (extracted != null) {
|
if (extracted != null) {
|
||||||
@@ -279,6 +294,12 @@ public class BookMetadataService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
protected List<String> resolveFieldAsList(Map<MetadataProvider, BookMetadata> metadataMap, MetadataRefreshOptions.FieldProvider fieldProvider, FieldValueExtractorList fieldValueExtractor) {
|
protected List<String> resolveFieldAsList(Map<MetadataProvider, BookMetadata> metadataMap, MetadataRefreshOptions.FieldProvider fieldProvider, FieldValueExtractorList fieldValueExtractor) {
|
||||||
List<String> values = new ArrayList<>();
|
List<String> values = new ArrayList<>();
|
||||||
|
if (fieldProvider.getP4() != null && metadataMap.containsKey(fieldProvider.getP4())) {
|
||||||
|
List<String> newValues = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP4()));
|
||||||
|
if (newValues != null && !newValues.isEmpty()) {
|
||||||
|
values = newValues;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (fieldProvider.getP3() != null && metadataMap.containsKey(fieldProvider.getP3())) {
|
if (fieldProvider.getP3() != null && metadataMap.containsKey(fieldProvider.getP3())) {
|
||||||
List<String> newValues = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP3()));
|
List<String> newValues = fieldValueExtractor.extract(metadataMap.get(fieldProvider.getP3()));
|
||||||
if (newValues != null && !newValues.isEmpty()) {
|
if (newValues != null && !newValues.isEmpty()) {
|
||||||
@@ -336,6 +357,9 @@ public class BookMetadataService {
|
|||||||
@Transactional
|
@Transactional
|
||||||
protected void addProviderToSet(MetadataRefreshOptions.FieldProvider fieldProvider, Set<MetadataProvider> providerSet) {
|
protected void addProviderToSet(MetadataRefreshOptions.FieldProvider fieldProvider, Set<MetadataProvider> providerSet) {
|
||||||
if (fieldProvider != null) {
|
if (fieldProvider != null) {
|
||||||
|
if (fieldProvider.getP4() != null) {
|
||||||
|
providerSet.add(fieldProvider.getP4());
|
||||||
|
}
|
||||||
if (fieldProvider.getP3() != null) {
|
if (fieldProvider.getP3() != null) {
|
||||||
providerSet.add(fieldProvider.getP3());
|
providerSet.add(fieldProvider.getP3());
|
||||||
}
|
}
|
||||||
@@ -393,9 +417,6 @@ public class BookMetadataService {
|
|||||||
case "isbn13":
|
case "isbn13":
|
||||||
existingMetadata.setIsbn13Locked(isLocked);
|
existingMetadata.setIsbn13Locked(isLocked);
|
||||||
break;
|
break;
|
||||||
case "asin":
|
|
||||||
existingMetadata.setAsinLocked(isLocked);
|
|
||||||
break;
|
|
||||||
case "description":
|
case "description":
|
||||||
existingMetadata.setDescriptionLocked(isLocked);
|
existingMetadata.setDescriptionLocked(isLocked);
|
||||||
break;
|
break;
|
||||||
@@ -405,24 +426,36 @@ public class BookMetadataService {
|
|||||||
case "language":
|
case "language":
|
||||||
existingMetadata.setLanguageLocked(isLocked);
|
existingMetadata.setLanguageLocked(isLocked);
|
||||||
break;
|
break;
|
||||||
|
case "asin":
|
||||||
|
existingMetadata.setAsinLocked(isLocked);
|
||||||
|
break;
|
||||||
case "amazonRating":
|
case "amazonRating":
|
||||||
existingMetadata.setAmazonRatingLocked(isLocked);
|
existingMetadata.setAmazonRatingLocked(isLocked);
|
||||||
break;
|
break;
|
||||||
case "amazonReviewCount":
|
case "amazonReviewCount":
|
||||||
existingMetadata.setAmazonReviewCountLocked(isLocked);
|
existingMetadata.setAmazonReviewCountLocked(isLocked);
|
||||||
break;
|
break;
|
||||||
|
case "goodreadsId":
|
||||||
|
existingMetadata.setGoodreadsIdLocked(isLocked);
|
||||||
|
break;
|
||||||
case "goodreadsRating":
|
case "goodreadsRating":
|
||||||
existingMetadata.setGoodreadsRatingLocked(isLocked);
|
existingMetadata.setGoodreadsRatingLocked(isLocked);
|
||||||
break;
|
break;
|
||||||
case "goodreadsReviewCount":
|
case "goodreadsReviewCount":
|
||||||
existingMetadata.setGoodreadsReviewCountLocked(isLocked);
|
existingMetadata.setGoodreadsReviewCountLocked(isLocked);
|
||||||
break;
|
break;
|
||||||
|
case "hardcoverId":
|
||||||
|
existingMetadata.setHardcoverIdLocked(isLocked);
|
||||||
|
break;
|
||||||
case "hardcoverRating":
|
case "hardcoverRating":
|
||||||
existingMetadata.setHardcoverRatingLocked(isLocked);
|
existingMetadata.setHardcoverRatingLocked(isLocked);
|
||||||
break;
|
break;
|
||||||
case "hardcoverReviewCount":
|
case "hardcoverReviewCount":
|
||||||
existingMetadata.setHardcoverReviewCountLocked(isLocked);
|
existingMetadata.setHardcoverReviewCountLocked(isLocked);
|
||||||
break;
|
break;
|
||||||
|
case "googleId":
|
||||||
|
existingMetadata.setGoogleIdLocked(isLocked);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
throw new IllegalArgumentException("Invalid field name: " + field);
|
throw new IllegalArgumentException("Invalid field name: " + field);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
DELETE FROM app_settings
|
||||||
|
WHERE name = 'quick_book_match';
|
||||||
Generated
+4
-4
@@ -28,7 +28,7 @@
|
|||||||
"ngx-extended-pdf-viewer": "^23.3.1",
|
"ngx-extended-pdf-viewer": "^23.3.1",
|
||||||
"ngx-infinite-scroll": "^19.0.0",
|
"ngx-infinite-scroll": "^19.0.0",
|
||||||
"primeicons": "^7.0.0",
|
"primeicons": "^7.0.0",
|
||||||
"primeng": "^19.1.3",
|
"primeng": "19.1.2",
|
||||||
"quill": "^2.0.3",
|
"quill": "^2.0.3",
|
||||||
"rxjs": "^7.8.2",
|
"rxjs": "^7.8.2",
|
||||||
"showdown": "^2.1.0",
|
"showdown": "^2.1.0",
|
||||||
@@ -14135,9 +14135,9 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/primeng": {
|
"node_modules/primeng": {
|
||||||
"version": "19.1.3",
|
"version": "19.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/primeng/-/primeng-19.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/primeng/-/primeng-19.1.2.tgz",
|
||||||
"integrity": "sha512-KsrvJFblKg28kA6d4npnnABjKClmJv0CgDT/kOxFq5onQNBy4547DJzRGMba4+CMLKjHWWkYWuC+XSkPMNFrZg==",
|
"integrity": "sha512-iu4lDrStBPCyYn+iSfofp/Hsv/dHVlnlsOhqFZlYTQB1o+MlVXa4PanLgHdoBr1thy3ozRkNDZHsICkUecWu0A==",
|
||||||
"license": "SEE LICENSE IN LICENSE.md",
|
"license": "SEE LICENSE IN LICENSE.md",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@primeuix/styled": "^0.3.2",
|
"@primeuix/styled": "^0.3.2",
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
"ngx-extended-pdf-viewer": "^23.3.1",
|
"ngx-extended-pdf-viewer": "^23.3.1",
|
||||||
"ngx-infinite-scroll": "^19.0.0",
|
"ngx-infinite-scroll": "^19.0.0",
|
||||||
"primeicons": "^7.0.0",
|
"primeicons": "^7.0.0",
|
||||||
"primeng": "^19.1.3",
|
"primeng": "19.1.2",
|
||||||
"quill": "^2.0.3",
|
"quill": "^2.0.3",
|
||||||
"rxjs": "^7.8.2",
|
"rxjs": "^7.8.2",
|
||||||
"showdown": "^2.1.0",
|
"showdown": "^2.1.0",
|
||||||
|
|||||||
@@ -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) {
|
||||||
{{ entityType }}: {{ (entity$ | async)?.name }}
|
<p class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
</p>
|
{{ entityType }}: {{ (entity$ | async)?.name }}
|
||||||
<p *ngIf="entityType === EntityType.ALL_BOOKS" class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
</p>
|
||||||
All Books
|
}
|
||||||
</p>
|
@if (entityType === EntityType.ALL_BOOKS) {
|
||||||
<p *ngIf="entityType === EntityType.UNSHELVED" class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
<p class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
Unshelved Books
|
All 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 (entityType === EntityType.UNSHELVED) {
|
||||||
<p-button icon="pi pi-ellipsis-v" [rounded]="true" [text]="true" severity="info" (click)="entitymenu.toggle($event)"></p-button>
|
<p class="text-2xl whitespace-nowrap overflow-hidden text-ellipsis">
|
||||||
<p-menu #entitymenu [model]="entityOptions" [popup]="true" appendTo="body"></p-menu>
|
Unshelved Books
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
@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-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) {
|
||||||
<i
|
<a class="topbar-items topbar-item" (click)="clearFilter()">
|
||||||
class="pi pi-filter-slash"
|
<i
|
||||||
pTooltip="Clear applied filters"
|
class="pi pi-filter-slash"
|
||||||
tooltipPosition="top">
|
pTooltip="Clear applied filters"
|
||||||
</i>
|
tooltipPosition="top">
|
||||||
</a>
|
</i>
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a
|
<a
|
||||||
@@ -38,7 +50,7 @@
|
|||||||
(click)="sizeOverlay.toggle($event)"
|
(click)="sizeOverlay.toggle($event)"
|
||||||
pTooltip="Adjust grid item scale"
|
pTooltip="Adjust grid item scale"
|
||||||
tooltipPosition="top"
|
tooltipPosition="top"
|
||||||
>
|
>
|
||||||
<i class="pi pi-th-large"></i>
|
<i class="pi pi-th-large"></i>
|
||||||
</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>
|
||||||
@@ -96,16 +110,17 @@
|
|||||||
[(ngModel)]="bookTitle"
|
[(ngModel)]="bookTitle"
|
||||||
(ngModelChange)="onSearchTermChange($event)"
|
(ngModelChange)="onSearchTermChange($event)"
|
||||||
class="search-input"
|
class="search-input"
|
||||||
/>
|
/>
|
||||||
<p-button
|
@if (bookTitle) {
|
||||||
*ngIf="bookTitle"
|
<p-button
|
||||||
icon="pi pi-times"
|
icon="pi pi-times"
|
||||||
[text]="true"
|
[text]="true"
|
||||||
size="small"
|
size="small"
|
||||||
[rounded]="true"
|
[rounded]="true"
|
||||||
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,100 +136,118 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="bookState$ | async as bookState">
|
@if (bookState$ | async; as bookState) {
|
||||||
<div *ngIf="!bookState?.loaded && !bookState?.error">
|
<div>
|
||||||
<p-progressSpinner></p-progressSpinner>
|
@if (!bookState?.loaded && !bookState?.error) {
|
||||||
</div>
|
<div>
|
||||||
|
<p-progressSpinner></p-progressSpinner>
|
||||||
<div class="relative">
|
</div>
|
||||||
<div class="no-books-container" *ngIf="bookState?.error">
|
}
|
||||||
<p class="no-books-text">
|
<div class="relative">
|
||||||
{{ entityType === EntityType.LIBRARY ? "Failed to load library's books!" : "Failed to load shelf's books!" }}
|
@if (bookState?.error) {
|
||||||
</p>
|
<div class="no-books-container">
|
||||||
</div>
|
<p class="no-books-text">
|
||||||
<div class="no-books-container" *ngIf="!bookState?.error && bookState?.loaded && bookState?.books?.length === 0">
|
{{ entityType === EntityType.LIBRARY ? "Failed to load library's books!" : "Failed to load shelf's books!" }}
|
||||||
<p class="no-books-text">
|
</p>
|
||||||
This collection has no books!
|
</div>
|
||||||
</p>
|
}
|
||||||
</div>
|
@if (!bookState?.error && bookState?.loaded && bookState?.books?.length === 0) {
|
||||||
|
<div class="no-books-container">
|
||||||
<div class="book-card-container" *ngIf="bookState?.books as books">
|
<p class="no-books-text">
|
||||||
<app-book-table *ngIf="currentViewMode === 'table' && books.length > 0" [books]="books" (selectedBooksChange)="onSelectedBooksChange($event)"
|
This collection has no books!
|
||||||
[sortOption]="selectedSort!"></app-book-table>
|
</p>
|
||||||
|
</div>
|
||||||
<virtual-scroller *ngIf="currentViewMode === 'grid'" class="virtual-scroller" #scroll [items]="books">
|
}
|
||||||
<div
|
@if (bookState?.books; as books) {
|
||||||
class="grid"
|
<div class="book-card-container">
|
||||||
#container
|
@if (currentViewMode === 'table' && books.length > 0) {
|
||||||
[ngStyle]="{'grid-template-columns': 'repeat(auto-fit, minmax(' + gridColumnMinWidth + ', 1fr))'}">
|
<app-book-table [books]="books" (selectedBooksChange)="onSelectedBooksChange($event)"
|
||||||
<div
|
[sortOption]="selectedSort!"></app-book-table>
|
||||||
class="virtual-scroller-item"
|
}
|
||||||
*ngFor="let book of scroll.viewPortItems"
|
@if (currentViewMode === 'grid') {
|
||||||
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
<virtual-scroller class="virtual-scroller" #scroll [items]="books">
|
||||||
<app-book-card
|
<div
|
||||||
[book]="book"
|
class="grid"
|
||||||
[isCheckboxEnabled]="true"
|
#container
|
||||||
[onBookSelect]="handleBookSelect.bind(this)"
|
[ngStyle]="{'grid-template-columns': 'repeat(auto-fit, minmax(' + gridColumnMinWidth + ', 1fr))'}">
|
||||||
[isSelected]="selectedBooks.has(book.id)">
|
@for (book of scroll.viewPortItems; track book) {
|
||||||
</app-book-card>
|
<div
|
||||||
|
class="virtual-scroller-item"
|
||||||
|
[ngStyle]="{width: currentCardSize.width + 'px', height: currentCardSize.height + 'px'}">
|
||||||
|
<app-book-card
|
||||||
|
[book]="book"
|
||||||
|
[isCheckboxEnabled]="true"
|
||||||
|
[onBookSelect]="handleBookSelect.bind(this)"
|
||||||
|
[isSelected]="selectedBooks.has(book.id)">
|
||||||
|
</app-book-card>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</virtual-scroller>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (selectedBooks.size > 0) {
|
||||||
|
<div class="book-browser-footer bg-[var(--card-background)] bg-opacity-10" [@slideInOut]>
|
||||||
|
<div class="flex justify-between gap-8">
|
||||||
|
@if (entityType$ | async; as entityType) {
|
||||||
|
@if (entityType === EntityType.LIBRARY || entityType === EntityType.ALL_BOOKS || entityType === EntityType.UNSHELVED) {
|
||||||
|
<p-button
|
||||||
|
icon="pi pi-bookmark-fill"
|
||||||
|
outlined="true"
|
||||||
|
severity="info"
|
||||||
|
(onClick)="openShelfAssigner()"
|
||||||
|
pTooltip="Assign to shelf"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
}
|
||||||
|
@if (entityType === EntityType.SHELF) {
|
||||||
|
<p-button
|
||||||
|
icon="pi pi-bookmark"
|
||||||
|
outlined="true"
|
||||||
|
severity="info"
|
||||||
|
(click)="unshelfBooks()"
|
||||||
|
pTooltip="Remove from shelf"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
}
|
||||||
|
@if (userService.userState$ | async; as userData) {
|
||||||
|
<div>
|
||||||
|
@if (userData.permissions.canEditMetadata) {
|
||||||
|
<p-button
|
||||||
|
icon="pi pi-database"
|
||||||
|
outlined="true"
|
||||||
|
severity="info"
|
||||||
|
(click)="updateMetadata()"
|
||||||
|
pTooltip="Update metadata"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<p-button
|
||||||
|
outlined="true"
|
||||||
|
icon="pi pi-lock"
|
||||||
|
severity="info"
|
||||||
|
(click)="lockUnlockMetadata()"
|
||||||
|
pTooltip="Lock/Unlock metadata"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
<p-button
|
||||||
|
outlined="true"
|
||||||
|
icon="pi pi-times"
|
||||||
|
severity="warn"
|
||||||
|
(click)="deselectAllBooks()"
|
||||||
|
pTooltip="Deselect all books"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</p-button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</virtual-scroller>
|
}
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="book-browser-footer bg-[var(--card-background)] bg-opacity-10" *ngIf="selectedBooks.size > 0" [@slideInOut]>
|
|
||||||
<div class="flex justify-between gap-8">
|
|
||||||
<ng-container *ngIf="entityType$ | async as entityType">
|
|
||||||
<p-button
|
|
||||||
*ngIf="entityType === EntityType.LIBRARY || entityType === EntityType.ALL_BOOKS || entityType === EntityType.UNSHELVED"
|
|
||||||
icon="pi pi-bookmark-fill"
|
|
||||||
outlined="true"
|
|
||||||
severity="info"
|
|
||||||
(onClick)="openShelfAssigner()"
|
|
||||||
pTooltip="Assign to shelf"
|
|
||||||
tooltipPosition="top">
|
|
||||||
</p-button>
|
|
||||||
<p-button
|
|
||||||
*ngIf="entityType === EntityType.SHELF"
|
|
||||||
icon="pi pi-bookmark"
|
|
||||||
outlined="true"
|
|
||||||
severity="info"
|
|
||||||
(click)="unshelfBooks()"
|
|
||||||
pTooltip="Remove from shelf"
|
|
||||||
tooltipPosition="top">
|
|
||||||
</p-button>
|
|
||||||
<div *ngIf="userService.userState$ | async as userData">
|
|
||||||
<p-button
|
|
||||||
*ngIf="userData.permissions.canEditMetadata"
|
|
||||||
icon="pi pi-database"
|
|
||||||
outlined="true"
|
|
||||||
severity="info"
|
|
||||||
(click)="updateMetadata()"
|
|
||||||
pTooltip="Update metadata"
|
|
||||||
tooltipPosition="top">
|
|
||||||
</p-button>
|
|
||||||
</div>
|
|
||||||
<p-button
|
|
||||||
outlined="true"
|
|
||||||
icon="pi pi-lock"
|
|
||||||
severity="info"
|
|
||||||
(click)="lockUnlockMetadata()"
|
|
||||||
pTooltip="Lock/Unlock metadata"
|
|
||||||
tooltipPosition="top">
|
|
||||||
</p-button>
|
|
||||||
<p-button
|
|
||||||
outlined="true"
|
|
||||||
icon="pi pi-times"
|
|
||||||
severity="warn"
|
|
||||||
(click)="deselectAllBooks()"
|
|
||||||
pTooltip="Deselect all books"
|
|
||||||
tooltipPosition="top">
|
|
||||||
</p-button>
|
|
||||||
</ng-container>
|
|
||||||
</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({
|
||||||
|
|||||||
+20
-18
@@ -1,7 +1,7 @@
|
|||||||
<div class="book-card"
|
<div class="book-card"
|
||||||
[class.selected]="isSelected"
|
[class.selected]="isSelected"
|
||||||
(mouseover)="isHovered = true"
|
(mouseover)="isHovered = true"
|
||||||
(mouseout)="isHovered = false">
|
(mouseout)="isHovered = false">
|
||||||
|
|
||||||
<div class="cover-container" [ngClass]="{ 'shimmer': !isImageLoaded, 'center-info-btn': readButtonHidden }">
|
<div class="cover-container" [ngClass]="{ 'shimmer': !isImageLoaded, 'center-info-btn': readButtonHidden }">
|
||||||
<img
|
<img
|
||||||
@@ -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>
|
||||||
|
|
||||||
<p-checkbox
|
@if (isCheckboxEnabled) {
|
||||||
*ngIf="isCheckboxEnabled"
|
<p-checkbox
|
||||||
[(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>
|
||||||
|
}
|
||||||
|
|
||||||
<p-progressBar
|
@if (progressPercentage !== null) {
|
||||||
*ngIf="progressPercentage !== null"
|
<p-progressBar
|
||||||
[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 {
|
||||||
|
|||||||
+54
-44
@@ -1,49 +1,59 @@
|
|||||||
<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="flex items-center justify-between px-4 py-4">
|
<div class="w-[225px] ml-4 h-[calc(100vh-6.5rem)] rounded-xl bg-[var(--card-background)] overflow-hidden">
|
||||||
<span class="text font-semibold">Filter Mode</span>
|
<div class="flex items-center justify-between px-4 py-4">
|
||||||
<p-selectButton
|
<span class="text font-semibold">Filter Mode</span>
|
||||||
[options]="filterModeOptions"
|
<p-selectButton
|
||||||
[(ngModel)]="selectedFilterMode"
|
[options]="filterModeOptions"
|
||||||
optionLabel="label"
|
[(ngModel)]="selectedFilterMode"
|
||||||
optionValue="value"
|
optionLabel="label"
|
||||||
class="text-sm"
|
optionValue="value"
|
||||||
allowEmpty="false"
|
class="text-sm"
|
||||||
|
allowEmpty="false"
|
||||||
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-header>
|
<p-accordion-panel [value]="i">
|
||||||
<span class="inline-flex items-center gap-1">
|
<p-accordion-header>
|
||||||
{{ filterLabels[filterType] || (filterType | titlecase) }}
|
<span class="inline-flex items-center gap-1">
|
||||||
<span *ngIf="activeFilters[filterType]?.length" class="text-sm text-[var(--primary-color)]">
|
{{ filterLabels[filterType] || (filterType | titlecase) }}
|
||||||
({{ activeFilters[filterType].length }})
|
@if (activeFilters[filterType]?.length) {
|
||||||
</span>
|
<span class="text-sm text-[var(--primary-color)]">
|
||||||
</span>
|
({{ activeFilters[filterType].length }})
|
||||||
</p-accordion-header>
|
</span>
|
||||||
<p-accordion-content class="h-[31rem] !overflow-y-auto">
|
}
|
||||||
<div *ngIf="filterStreams[filterType] | async as filters">
|
</span>
|
||||||
<div *ngFor="let filter of filters">
|
</p-accordion-header>
|
||||||
<div
|
<p-accordion-content class="h-[31rem] !overflow-y-auto">
|
||||||
class="cursor-pointer transition-colors duration-200 ease-in-out pb-1 flex items-center gap-2"
|
@if (filterStreams[filterType] | async; as filters) {
|
||||||
|
<div>
|
||||||
|
@for (filter of filters; track filter) {
|
||||||
|
<div>
|
||||||
|
<div
|
||||||
|
class="cursor-pointer transition-colors duration-200 ease-in-out pb-1 flex items-center gap-2"
|
||||||
[ngClass]="{
|
[ngClass]="{
|
||||||
'text-[var(--primary-color)]':
|
'text-[var(--primary-color)]':
|
||||||
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>
|
@if (filterType === 'amazonRating') {
|
||||||
<ng-container *ngIf="filterType === 'amazonRating'; else defaultLabel">
|
@if (filterType === 'amazonRating') {
|
||||||
<ng-container *ngIf="filterType === 'amazonRating'; else defaultLabel">
|
<span>{{ filter.value.name }}</span>
|
||||||
<span>{{ filter.value.name }}</span>
|
} @else {
|
||||||
</ng-container>
|
{{ filter.value.name || filter.value }}
|
||||||
</ng-container>
|
}
|
||||||
<ng-template #defaultLabel>
|
} @else {
|
||||||
{{ filter.value.name || filter.value }}
|
{{ filter.value.name || filter.value }}
|
||||||
</ng-template>
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
</p-accordion-content>
|
</div>
|
||||||
</p-accordion-panel>
|
}
|
||||||
</p-accordion>
|
</p-accordion-content>
|
||||||
</div>
|
</p-accordion-panel>
|
||||||
|
}
|
||||||
|
</p-accordion>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
+2
-4
@@ -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,15 +110,13 @@ function getPageCountRangeFilters(pageCount?: number) {
|
|||||||
AccordionPanel,
|
AccordionPanel,
|
||||||
AccordionHeader,
|
AccordionHeader,
|
||||||
AccordionContent,
|
AccordionContent,
|
||||||
NgIf,
|
|
||||||
NgForOf,
|
|
||||||
NgClass,
|
NgClass,
|
||||||
Badge,
|
Badge,
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
TitleCasePipe,
|
TitleCasePipe,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
SelectButton
|
SelectButton
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class BookFilterComponent implements OnInit {
|
export class BookFilterComponent implements OnInit {
|
||||||
@Output() filterSelected = new EventEmitter<Record<string, any> | null>();
|
@Output() filterSelected = new EventEmitter<Record<string, any> | null>();
|
||||||
|
|||||||
+87
-79
@@ -39,85 +39,93 @@
|
|||||||
</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) {
|
||||||
<td class="max-w-16">
|
<tr style="height:46px">
|
||||||
<p-tableCheckbox [value]="book"></p-tableCheckbox>
|
<td class="max-w-16">
|
||||||
</td>
|
<p-tableCheckbox [value]="book"></p-tableCheckbox>
|
||||||
<td class="text-center">
|
</td>
|
||||||
<p-button
|
<td class="text-center">
|
||||||
[icon]="isMetadataFullyLocked(metadata) ? 'pi pi-lock' : 'pi pi-lock-open'"
|
<p-button
|
||||||
[severity]="isMetadataFullyLocked(metadata) ? 'danger' : 'success'"
|
[icon]="isMetadataFullyLocked(metadata) ? 'pi pi-lock' : 'pi pi-lock-open'"
|
||||||
[text]="true"
|
[severity]="isMetadataFullyLocked(metadata) ? 'danger' : 'success'"
|
||||||
[title]="isMetadataFullyLocked(metadata) ? 'Locked' : 'Unlocked'"
|
[text]="true"
|
||||||
size="small"
|
[title]="isMetadataFullyLocked(metadata) ? 'Locked' : 'Unlocked'"
|
||||||
[style]="{ width: '1.5rem', height: '1.5rem', padding: '0', fontSize: '0.75rem' }"
|
size="small"
|
||||||
(click)="toggleMetadataLock(metadata)">
|
[style]="{ width: '1.5rem', height: '1.5rem', padding: '0', fontSize: '0.75rem' }"
|
||||||
</p-button>
|
(click)="toggleMetadataLock(metadata)">
|
||||||
</td>
|
</p-button>
|
||||||
<td (click)="openMetadataCenter(book.id)">
|
</td>
|
||||||
<img [attr.src]="urlHelper.getCoverUrl(metadata.bookId, metadata?.coverUpdatedOn)" alt="Book Cover" class="size-7"/>
|
<td (click)="openMetadataCenter(book.id)">
|
||||||
</td>
|
<img [attr.src]="urlHelper.getCoverUrl(metadata.bookId, metadata?.coverUpdatedOn)" alt="Book Cover" class="size-7"/>
|
||||||
<td class="min-w-[18rem] max-w-[25rem] overflow-hidden truncate" [title]="metadata.title">{{ metadata.title }}</td>
|
</td>
|
||||||
<td class="min-w-[10rem] max-w-[15rem] overflow-hidden truncate" [title]="getAuthorNames(metadata.authors)">{{ getAuthorNames(metadata.authors) }}</td>
|
<td class="min-w-[18rem] max-w-[25rem] overflow-hidden truncate" [title]="metadata.title">{{ metadata.title }}</td>
|
||||||
<td class="min-w-[9rem] max-w-[13rem] overflow-hidden truncate" [title]="metadata.publisher">{{ metadata.publisher }}</td>
|
<td class="min-w-[10rem] max-w-[15rem] overflow-hidden truncate" [title]="getAuthorNames(metadata.authors)">{{ getAuthorNames(metadata.authors) }}</td>
|
||||||
<td class="min-w-[9rem] max-w-[13rem] overflow-hidden truncate" [title]="metadata.seriesName">{{ metadata.seriesName }}</td>
|
<td class="min-w-[9rem] max-w-[13rem] overflow-hidden truncate" [title]="metadata.publisher">{{ metadata.publisher }}</td>
|
||||||
<td class="min-w-[1rem] max-w-[1rem] overflow-hidden truncate" [title]="metadata.seriesNumber">{{ metadata.seriesNumber }}</td>
|
<td class="min-w-[9rem] max-w-[13rem] overflow-hidden truncate" [title]="metadata.seriesName">{{ metadata.seriesName }}</td>
|
||||||
<td class="min-w-[12rem] max-w-[18rem] overflow-hidden truncate" [title]="getGenres(metadata.categories)">{{ getGenres(metadata.categories) }}</td>
|
<td class="min-w-[1rem] max-w-[1rem] overflow-hidden truncate" [title]="metadata.seriesNumber">{{ metadata.seriesNumber }}</td>
|
||||||
<td class="min-w-[9rem] max-w-[9rem] overflow-hidden truncate">
|
<td class="min-w-[12rem] max-w-[18rem] overflow-hidden truncate" [title]="getGenres(metadata.categories)">{{ getGenres(metadata.categories) }}</td>
|
||||||
{{ metadata.publishedDate ? (metadata.publishedDate | date: 'dd-MMM-yyyy') : '' }}
|
<td class="min-w-[9rem] max-w-[9rem] overflow-hidden truncate">
|
||||||
</td>
|
{{ metadata.publishedDate ? (metadata.publishedDate | date: 'dd-MMM-yyyy') : '' }}
|
||||||
<td class="min-w-[9rem] max-w-[9rem] overflow-hidden truncate text-right">
|
</td>
|
||||||
{{ book.lastReadTime ? (book.lastReadTime | date: 'dd-MMM-yyyy') : '' }}
|
<td class="min-w-[9rem] max-w-[9rem] overflow-hidden truncate text-right">
|
||||||
</td>
|
{{ book.lastReadTime ? (book.lastReadTime | date: 'dd-MMM-yyyy') : '' }}
|
||||||
<td class="min-w-[9rem] max-w-[9rem] overflow-hidden truncate text-right">
|
</td>
|
||||||
{{ book.addedOn ? (book.addedOn | date: 'dd-MMM-yyyy') : '' }}
|
<td class="min-w-[9rem] max-w-[9rem] overflow-hidden truncate text-right">
|
||||||
</td>
|
{{ book.addedOn ? (book.addedOn | date: 'dd-MMM-yyyy') : '' }}
|
||||||
<td class="min-w-[7rem] max-w-[9rem] overflow-hidden truncate"
|
</td>
|
||||||
|
<td class="min-w-[7rem] max-w-[9rem] overflow-hidden truncate"
|
||||||
[title]="book.fileSizeKb + ' KB'">
|
[title]="book.fileSizeKb + ' KB'">
|
||||||
{{ formatFileSize(book.fileSizeKb) }}
|
{{ formatFileSize(book.fileSizeKb) }}
|
||||||
</td>
|
</td>
|
||||||
<td class="min-w-[6rem] max-w-[6rem] overflow-hidden truncate">{{ metadata.language }}</td>
|
<td class="min-w-[6rem] max-w-[6rem] overflow-hidden truncate">{{ metadata.language }}</td>
|
||||||
<td class="min-w-[4rem] max-w-[5rem] overflow-hidden truncate">{{ metadata.pageCount }}</td>
|
<td class="min-w-[4rem] max-w-[5rem] overflow-hidden truncate">{{ metadata.pageCount }}</td>
|
||||||
<td class="min-w-[10rem] max-w-[10rem] overflow-hidden truncate">
|
<td class="min-w-[10rem] max-w-[10rem] overflow-hidden truncate">
|
||||||
<span class="flex items-center gap-1">
|
<span class="flex items-center gap-1">
|
||||||
<p-rating
|
<p-rating
|
||||||
[(ngModel)]="metadata.amazonRating"
|
[(ngModel)]="metadata.amazonRating"
|
||||||
readonly
|
readonly
|
||||||
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>
|
<span>({{ metadata.amazonRating?.toFixed(1) }})</span>
|
||||||
</td>
|
}
|
||||||
<td class="min-w-[7rem] max-w-[7rem] overflow-hidden truncate text-right">
|
</span>
|
||||||
{{ metadata.amazonReviewCount ?? '' }}
|
</td>
|
||||||
</td>
|
<td class="min-w-[7rem] max-w-[7rem] overflow-hidden truncate text-right">
|
||||||
<td class="min-w-[10rem] max-w-[10rem] overflow-hidden truncate">
|
{{ metadata.amazonReviewCount ?? '' }}
|
||||||
<span class="flex items-center gap-1">
|
</td>
|
||||||
<p-rating
|
<td class="min-w-[10rem] max-w-[10rem] overflow-hidden truncate">
|
||||||
[(ngModel)]="metadata.goodreadsRating"
|
<span class="flex items-center gap-1">
|
||||||
readonly
|
<p-rating
|
||||||
stars="5"
|
[(ngModel)]="metadata.goodreadsRating"
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
readonly
|
||||||
</p-rating>
|
stars="5"
|
||||||
<span *ngIf="metadata.goodreadsRating != null">({{ metadata.goodreadsRating?.toFixed(1) }})</span>
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
||||||
</span>
|
</p-rating>
|
||||||
</td>
|
@if (metadata.goodreadsRating != null) {
|
||||||
<td class="min-w-[7rem] max-w-[7rem] overflow-hidden truncate text-right">
|
<span>({{ metadata.goodreadsRating?.toFixed(1) }})</span>
|
||||||
{{ metadata.goodreadsReviewCount ?? '' }}
|
}
|
||||||
</td>
|
</span>
|
||||||
<td class="min-w-[10rem] max-w-[10rem] overflow-hidden truncate">
|
</td>
|
||||||
<span class="flex items-center gap-1">
|
<td class="min-w-[7rem] max-w-[7rem] overflow-hidden truncate text-right">
|
||||||
<p-rating
|
{{ metadata.goodreadsReviewCount ?? '' }}
|
||||||
[(ngModel)]="metadata.hardcoverRating"
|
</td>
|
||||||
readonly
|
<td class="min-w-[10rem] max-w-[10rem] overflow-hidden truncate">
|
||||||
stars="5"
|
<span class="flex items-center gap-1">
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
<p-rating
|
||||||
</p-rating>
|
[(ngModel)]="metadata.hardcoverRating"
|
||||||
<span *ngIf="metadata.hardcoverRating != null">({{ metadata.hardcoverRating?.toFixed(1) }})</span>
|
readonly
|
||||||
</span>
|
stars="5"
|
||||||
</td>
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
||||||
<td class="min-w-[6rem] max-w-[6rem] overflow-hidden truncate">{{ metadata.hardcoverReviewCount }}</td>
|
</p-rating>
|
||||||
</tr>
|
@if (metadata.hardcoverRating != null) {
|
||||||
|
<span>({{ metadata.hardcoverRating?.toFixed(1) }})</span>
|
||||||
|
}
|
||||||
|
</span>
|
||||||
|
</td>
|
||||||
|
<td class="min-w-[6rem] max-w-[6rem] overflow-hidden truncate">{{ metadata.hardcoverReviewCount }}</td>
|
||||||
|
</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,12 +17,11 @@ 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,
|
||||||
DatePipe
|
DatePipe
|
||||||
],
|
],
|
||||||
styleUrl: './book-table.component.scss'
|
styleUrl: './book-table.component.scss'
|
||||||
})
|
})
|
||||||
export class BookTableComponent implements OnChanges {
|
export class BookTableComponent implements OnChanges {
|
||||||
|
|||||||
+12
-10
@@ -1,15 +1,17 @@
|
|||||||
<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) {
|
||||||
<label class="capitalize">{{ fieldLabels[field] || field }}</label>
|
<div class="flex items-center justify-between">
|
||||||
<p-button
|
<label class="capitalize">{{ fieldLabels[field] || field }}</label>
|
||||||
[outlined]="true"
|
<p-button
|
||||||
[label]="getLockLabel(field)"
|
[outlined]="true"
|
||||||
[icon]="getLockIcon(field)"
|
[label]="getLockLabel(field)"
|
||||||
[severity]="fieldLocks[field] === true ? 'danger' : fieldLocks[field] === false ? 'success' : 'secondary'"
|
[icon]="getLockIcon(field)"
|
||||||
(click)="cycleLockState(field)"
|
[severity]="fieldLocks[field] === true ? 'danger' : fieldLocks[field] === false ? 'success' : 'secondary'"
|
||||||
></p-button>
|
(click)="cycleLockState(field)"
|
||||||
</div>
|
></p-button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+16
-14
@@ -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,9 +13,8 @@ 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',
|
||||||
styleUrl: './lock-unlock-metadata-dialog.component.scss'
|
styleUrl: './lock-unlock-metadata-dialog.component.scss'
|
||||||
})
|
})
|
||||||
@@ -33,14 +32,14 @@ export class LockUnlockMetadataDialogComponent implements OnInit {
|
|||||||
'isbn13Locked', 'isbn10Locked', 'asinLocked', 'pageCountLocked', 'thumbnailLocked', 'languageLocked', 'coverLocked',
|
'isbn13Locked', 'isbn10Locked', 'asinLocked', 'pageCountLocked', 'thumbnailLocked', 'languageLocked', 'coverLocked',
|
||||||
'seriesNameLocked', 'seriesNumberLocked', 'seriesTotalLocked', 'authorsLocked', 'categoriesLocked',
|
'seriesNameLocked', 'seriesNumberLocked', 'seriesTotalLocked', 'authorsLocked', 'categoriesLocked',
|
||||||
'amazonRatingLocked', 'amazonReviewCountLocked', 'goodreadsRatingLocked', 'goodreadsReviewCountLocked',
|
'amazonRatingLocked', 'amazonReviewCountLocked', 'goodreadsRatingLocked', 'goodreadsReviewCountLocked',
|
||||||
'hardcoverRatingLocked', 'hardcoverReviewCountLocked'
|
'hardcoverRatingLocked', 'hardcoverReviewCountLocked', 'goodreadsIdLocked', 'hardcoverIdLocked', 'googleIdLocked'
|
||||||
];
|
];
|
||||||
|
|
||||||
fieldLabels: Record<string, string> = {
|
fieldLabels: Record<string, string> = {
|
||||||
titleLocked: 'Title',
|
titleLocked: 'Title',
|
||||||
subtitleLocked: 'Subtitle',
|
subtitleLocked: 'Subtitle',
|
||||||
publisherLocked: 'Publisher',
|
publisherLocked: 'Publisher',
|
||||||
publishedDateLocked: 'Published Date',
|
publishedDateLocked: 'Date',
|
||||||
descriptionLocked: 'Description',
|
descriptionLocked: 'Description',
|
||||||
isbn13Locked: 'ISBN-13',
|
isbn13Locked: 'ISBN-13',
|
||||||
isbn10Locked: 'ISBN-10',
|
isbn10Locked: 'ISBN-10',
|
||||||
@@ -49,17 +48,20 @@ export class LockUnlockMetadataDialogComponent implements OnInit {
|
|||||||
thumbnailLocked: 'Thumbnail',
|
thumbnailLocked: 'Thumbnail',
|
||||||
languageLocked: 'Language',
|
languageLocked: 'Language',
|
||||||
coverLocked: 'Cover',
|
coverLocked: 'Cover',
|
||||||
seriesNameLocked: 'Series Name',
|
seriesNameLocked: 'Series',
|
||||||
seriesNumberLocked: 'Series Number',
|
seriesNumberLocked: 'Series #',
|
||||||
seriesTotalLocked: 'Series Total',
|
seriesTotalLocked: 'Series Total #',
|
||||||
authorsLocked: 'Authors',
|
authorsLocked: 'Authors',
|
||||||
categoriesLocked: 'Categories',
|
categoriesLocked: 'Categories',
|
||||||
amazonRatingLocked: 'Amazon Rating',
|
amazonRatingLocked: 'Amazon ★',
|
||||||
amazonReviewCountLocked: 'Amazon Rating Count',
|
amazonReviewCountLocked: 'Amazon Reviews',
|
||||||
goodreadsRatingLocked: 'Goodreads Rating',
|
goodreadsRatingLocked: 'Goodreads ★',
|
||||||
goodreadsReviewCountLocked: 'Goodreads Rating Count',
|
goodreadsReviewCountLocked: 'Goodreads Reviews',
|
||||||
hardcoverRatingLocked: 'Hardcover Rating',
|
hardcoverRatingLocked: 'Hardcover ★',
|
||||||
hardcoverReviewCountLocked: 'Hardcover Rating Count'
|
hardcoverReviewCountLocked: 'Hardcover Reviews',
|
||||||
|
goodreadsIdLocked: 'Goodreads ID',
|
||||||
|
hardcoverIdLocked: 'Hardcover ID',
|
||||||
|
googleIdLocked: 'Google ID',
|
||||||
};
|
};
|
||||||
|
|
||||||
isSaving = false;
|
isSaving = false;
|
||||||
|
|||||||
@@ -9,32 +9,37 @@
|
|||||||
(input)="onSearchInputChange()"
|
(input)="onSearchInputChange()"
|
||||||
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="flex flex-row w-full px-2">
|
<div class="search-dropdown-item flex flex-col" (click)="onBookClick(book)">
|
||||||
<img [attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)" alt="Book Cover" class="search-book-cover"/>
|
<div class="flex flex-row w-full px-2">
|
||||||
<div class="search-book-details">
|
<img [attr.src]="urlHelper.getCoverUrl(book.id, book.metadata?.coverUpdatedOn)" alt="Book Cover" class="search-book-cover"/>
|
||||||
<div class="flex items-center">
|
<div class="search-book-details">
|
||||||
<p class="search-book-name text-lg font-medium truncate">{{ book.metadata?.title | slice:0:70 }}</p>
|
<div class="flex items-center">
|
||||||
</div>
|
<p class="search-book-name text-lg font-medium truncate">{{ book.metadata?.title | slice:0:70 }}</p>
|
||||||
<div *ngIf="book.metadata?.authors?.length ?? 0 > 0" class="search-book-authors">
|
</div>
|
||||||
<p class="italic">by: {{ getAuthorNames(book.metadata?.authors) }}</p>
|
@if (book.metadata?.authors?.length ?? 0 > 0) {
|
||||||
|
<div class="search-book-authors">
|
||||||
|
<p class="italic">by: {{ getAuthorNames(book.metadata?.authors) }}</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p-divider></p-divider>
|
||||||
</div>
|
</div>
|
||||||
<p-divider></p-divider>
|
}
|
||||||
</div>
|
} @else {
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<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,11 +18,9 @@ import {Router} from '@angular/router';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
InputTextModule,
|
InputTextModule,
|
||||||
Button,
|
Button,
|
||||||
NgIf,
|
|
||||||
NgForOf,
|
|
||||||
SlicePipe,
|
SlicePipe,
|
||||||
Divider
|
Divider
|
||||||
],
|
],
|
||||||
styleUrls: ['./book-searcher.component.scss'],
|
styleUrls: ['./book-searcher.component.scss'],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
[min]="1"
|
[min]="1"
|
||||||
[max]="pages.length"
|
[max]="pages.length"
|
||||||
placeholder="Page"
|
placeholder="Page"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
(click)="goToPageInput !== null && goToPage(goToPageInput)"
|
(click)="goToPageInput !== null && goToPage(goToPageInput)"
|
||||||
[disabled]="goToPageInput === null || goToPageInput < 1 || goToPageInput > pages.length">
|
[disabled]="goToPageInput === null || goToPageInput < 1 || goToPageInput > pages.length">
|
||||||
@@ -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) {
|
||||||
{{ pageSpread === 'ODD' ? '⬅️' : '➡️' }}
|
<button (click)="toggleSpreadDirection()" title="Toggle Spread Direction">
|
||||||
</button>
|
{{ pageSpread === 'ODD' ? '⬅️' : '➡️' }}
|
||||||
|
</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'
|
||||||
})
|
})
|
||||||
|
|||||||
+58
-52
@@ -1,59 +1,65 @@
|
|||||||
<div #epubContainer class="epub-viewer-container">
|
<div #epubContainer class="epub-viewer-container">
|
||||||
<div *ngIf="isLoading" class="spinner-wrapper">
|
@if (isLoading) {
|
||||||
<p-progressSpinner></p-progressSpinner>
|
<div class="spinner-wrapper">
|
||||||
</div>
|
<p-progressSpinner></p-progressSpinner>
|
||||||
<div *ngIf="!isLoading">
|
</div>
|
||||||
|
}
|
||||||
<div class="epub-header">
|
@if (!isLoading) {
|
||||||
|
<div>
|
||||||
<div>
|
<div class="epub-header">
|
||||||
<p-button size="small" class="menu-toggle-button" (click)="toggleDrawer()" icon="pi pi-bars" severity="secondary"></p-button>
|
<div>
|
||||||
<p-drawer [(visible)]="isDrawerVisible" [modal]="false" [position]="'left'" header="Chapters">
|
<p-button size="small" class="menu-toggle-button" (click)="toggleDrawer()" icon="pi pi-bars" severity="secondary"></p-button>
|
||||||
<ul class="chapter-list">
|
<p-drawer [(visible)]="isDrawerVisible" [modal]="false" [position]="'left'" header="Chapters">
|
||||||
<li *ngFor="let chapter of chapters" (click)="navigateToChapter(chapter); $event.stopPropagation()" class="chapter-item">
|
<ul class="chapter-list">
|
||||||
{{ chapter.label }}
|
@for (chapter of chapters; track chapter) {
|
||||||
</li>
|
<li (click)="navigateToChapter(chapter); $event.stopPropagation()" class="chapter-item">
|
||||||
</ul>
|
{{ chapter.label }}
|
||||||
</p-drawer>
|
</li>
|
||||||
</div>
|
}
|
||||||
|
</ul>
|
||||||
<p>{{ currentChapter }}</p>
|
</p-drawer>
|
||||||
|
</div>
|
||||||
<div>
|
<p>{{ currentChapter }}</p>
|
||||||
<div class="flex gap-4">
|
<div>
|
||||||
<div *ngIf="!locationsReady" class="location-indicator" pTooltip="Saving progress not ready yet">
|
<div class="flex gap-4">
|
||||||
<span class="dot"></span>
|
@if (!locationsReady) {
|
||||||
</div>
|
<div class="location-indicator" pTooltip="Saving progress not ready yet">
|
||||||
<div>
|
<span class="dot"></span>
|
||||||
<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">
|
|
||||||
<div class="flex flex-col">
|
|
||||||
<div class="settings-content">
|
|
||||||
<p>Font Size: {{ fontSize }}%</p>
|
|
||||||
<div class="flex flex-row gap-4">
|
|
||||||
<p-button icon="pi pi-minus" (click)="decreaseFontSize()" severity="info"></p-button>
|
|
||||||
<p-button icon="pi pi-plus" (click)="increaseFontSize()" severity="info"></p-button>
|
|
||||||
</div>
|
|
||||||
<p-divider></p-divider>
|
|
||||||
<label for="font-type">Font Type:</label>
|
|
||||||
<p-select id="font-type" [options]="fontTypes" [(ngModel)]="selectedFontType" (onChange)="changeFontType()"></p-select>
|
|
||||||
<p-divider></p-divider>
|
|
||||||
<label for="theme">Theme:</label>
|
|
||||||
<p-select id="theme" [options]="themes" [(ngModel)]="selectedTheme" (onChange)="changeThemes()"></p-select>
|
|
||||||
<p-divider></p-divider>
|
|
||||||
<label for="flow">Flow:</label>
|
|
||||||
<p-select id="flow" [options]="flows" [(ngModel)]="selectedFlow" (onChange)="changeScrollMode()"></p-select>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</p-drawer>
|
}
|
||||||
|
<div>
|
||||||
|
<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">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<div class="settings-content">
|
||||||
|
<p>Font Size: {{ fontSize }}%</p>
|
||||||
|
<div class="flex flex-row gap-4">
|
||||||
|
<p-button icon="pi pi-minus" (click)="decreaseFontSize()" severity="info"></p-button>
|
||||||
|
<p-button icon="pi pi-plus" (click)="increaseFontSize()" severity="info"></p-button>
|
||||||
|
</div>
|
||||||
|
<p-divider></p-divider>
|
||||||
|
<label for="font-type">Font Type:</label>
|
||||||
|
<p-select id="font-type" [options]="fontTypes" [(ngModel)]="selectedFontType" (onChange)="changeFontType()"></p-select>
|
||||||
|
<p-divider></p-divider>
|
||||||
|
<label for="theme">Theme:</label>
|
||||||
|
<p-select id="theme" [options]="themes" [(ngModel)]="selectedTheme" (onChange)="changeThemes()"></p-select>
|
||||||
|
<p-divider></p-divider>
|
||||||
|
<label for="flow">Flow:</label>
|
||||||
|
<p-select id="flow" [options]="flows" [(ngModel)]="selectedFlow" (onChange)="changeScrollMode()"></p-select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</p-drawer>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="epubContainer" #epubContainer></div>
|
||||||
|
@if (selectedFlow !== 'scrolled') {
|
||||||
|
<button class="epub-controls-left" (click)="prevPage()">←</button>
|
||||||
|
}
|
||||||
|
@if (selectedFlow !== 'scrolled') {
|
||||||
|
<button class="epub-controls-right" (click)="nextPage()">→</button>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div id="epubContainer" #epubContainer></div>
|
|
||||||
|
|
||||||
<button *ngIf="selectedFlow !== 'scrolled'" class="epub-controls-left" (click)="prevPage()">←</button>
|
|
||||||
<button *ngIf="selectedFlow !== 'scrolled'" class="epub-controls-right" (click)="nextPage()">→</button>
|
|
||||||
</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,20 +1,23 @@
|
|||||||
<div *ngIf="isLoading" class="flex justify-center items-center h-screen relative">
|
@if (isLoading) {
|
||||||
<p-progressSpinner></p-progressSpinner>
|
<div class="flex justify-center items-center h-screen relative">
|
||||||
</div>
|
<p-progressSpinner></p-progressSpinner>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<ngx-extended-pdf-viewer
|
@if (!isLoading) {
|
||||||
*ngIf="!isLoading"
|
<ngx-extended-pdf-viewer
|
||||||
[src]="bookData"
|
[src]="bookData"
|
||||||
[handTool]="handTool"
|
[handTool]="handTool"
|
||||||
[height]="'auto'"
|
[height]="'auto'"
|
||||||
[page]="page"
|
[page]="page"
|
||||||
[rotation]="rotation"
|
[rotation]="rotation"
|
||||||
[sidebarVisible]="false"
|
[sidebarVisible]="false"
|
||||||
[zoom]="zoom"
|
[zoom]="zoom"
|
||||||
[spread]="spread"
|
[spread]="spread"
|
||||||
[showBookModeButton]="false"
|
[showBookModeButton]="false"
|
||||||
(pagesLoaded)="onPdfPagesLoaded($event)"
|
(pagesLoaded)="onPdfPagesLoaded($event)"
|
||||||
(pageChange)="onPageChange($event)"
|
(pageChange)="onPageChange($event)"
|
||||||
(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 class="flex flex-row items-center gap-4 py-2">
|
<div>
|
||||||
<p-checkbox [inputId]="shelf.name" name="group" [value]="shelf" [(ngModel)]="selectedShelves"></p-checkbox>
|
<div class="flex flex-row items-center gap-4 py-2">
|
||||||
<label [for]="shelf.id">{{ shelf.name }}</label>
|
<p-checkbox [inputId]="shelf.name" name="group" [value]="shelf" [(ngModel)]="selectedShelves"></p-checkbox>
|
||||||
|
<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) {
|
||||||
<p-button label="Select Icon" icon="pi pi-search" (onClick)="openIconPicker()"></p-button>
|
<div>
|
||||||
</div>
|
<p-button label="Select Icon" icon="pi pi-search" (onClick)="openIconPicker()"></p-button>
|
||||||
<div *ngIf="selectedIcon" class="flex items-center gap-4">
|
</div>
|
||||||
<i [class]="selectedIcon"></i>
|
}
|
||||||
<p-button icon="pi pi-times" text="true" outlined="true" severity="warn" (onClick)="clearSelectedIcon()"></p-button>
|
@if (selectedIcon) {
|
||||||
</div>
|
<div class="flex items-center gap-4">
|
||||||
|
<i [class]="selectedIcon"></i>
|
||||||
|
<p-button icon="pi pi-times" text="true" outlined="true" severity="warn" (onClick)="clearSelectedIcon()"></p-button>
|
||||||
|
</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,16 +22,14 @@ 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']
|
||||||
})
|
})
|
||||||
export class ShelfAssignerComponent implements OnInit {
|
export class ShelfAssignerComponent implements OnInit {
|
||||||
|
|||||||
+11
-7
@@ -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) {
|
||||||
<p-button label="Select Icon" icon="pi pi-search" (onClick)="openIconPicker()"></p-button>
|
<div>
|
||||||
</div>
|
<p-button label="Select Icon" icon="pi pi-search" (onClick)="openIconPicker()"></p-button>
|
||||||
<div *ngIf="selectedIcon">
|
</div>
|
||||||
<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>
|
@if (selectedIcon) {
|
||||||
</div>
|
<div>
|
||||||
|
<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>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-end">
|
<div class="flex justify-end">
|
||||||
|
|||||||
+2
-3
@@ -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,10 +15,9 @@ import {MessageService} from 'primeng/api';
|
|||||||
Button,
|
Button,
|
||||||
IconPickerComponent,
|
IconPickerComponent,
|
||||||
InputText,
|
InputText,
|
||||||
NgIf,
|
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
FormsModule
|
FormsModule
|
||||||
],
|
],
|
||||||
templateUrl: './shelf-edit-dialog.component.html',
|
templateUrl: './shelf-edit-dialog.component.html',
|
||||||
standalone: true,
|
standalone: true,
|
||||||
styleUrl: './shelf-edit-dialog.component.scss'
|
styleUrl: './shelf-edit-dialog.component.scss'
|
||||||
|
|||||||
+16
-8
@@ -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) {
|
||||||
<app-metadata-editor></app-metadata-editor>
|
<p-tabpanel value="edit">
|
||||||
</p-tabpanel>
|
<app-metadata-editor></app-metadata-editor>
|
||||||
<p-tabpanel *ngIf="admin || canEditMetadata" value="match">
|
</p-tabpanel>
|
||||||
<app-metadata-searcher></app-metadata-searcher>
|
}
|
||||||
</p-tabpanel>
|
@if (admin || canEditMetadata) {
|
||||||
|
<p-tabpanel value="match">
|
||||||
|
<app-metadata-searcher></app-metadata-searcher>
|
||||||
|
</p-tabpanel>
|
||||||
|
}
|
||||||
</p-tabpanels>
|
</p-tabpanels>
|
||||||
</p-tabs>
|
</p-tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-3
@@ -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,13 +22,12 @@ import {MetadataSearcherComponent} from './metadata-searcher/metadata-searcher.c
|
|||||||
TabList,
|
TabList,
|
||||||
Tabs,
|
Tabs,
|
||||||
Tab,
|
Tab,
|
||||||
NgIf,
|
|
||||||
TabPanels,
|
TabPanels,
|
||||||
MetadataViewerComponent,
|
MetadataViewerComponent,
|
||||||
TabPanel,
|
TabPanel,
|
||||||
MetadataEditorComponent,
|
MetadataEditorComponent,
|
||||||
MetadataSearcherComponent
|
MetadataSearcherComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class BookMetadataCenterComponent implements OnInit, OnDestroy {
|
export class BookMetadataCenterComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
|
|||||||
+404
-328
@@ -1,339 +1,415 @@
|
|||||||
<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>
|
||||||
|
}
|
||||||
<div class="overflow-y-scroll flex-1">
|
@if (isLoading) {
|
||||||
|
<p-progressSpinner [style]="{position: 'absolute', top: '50%', left: '50%', transform: 'translate(-50%, -50%)'}"></p-progressSpinner>
|
||||||
<div class="flex flex-row w-full gap-4">
|
}
|
||||||
|
<div class="overflow-y-scroll flex-1">
|
||||||
<div class="flex flex-col items-center gap-2 relative">
|
<div class="flex flex-row w-full gap-4">
|
||||||
|
<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"
|
(onClick)="regenerateCover(metadata.bookId)"
|
||||||
(onClick)="regenerateCover(metadata.bookId)"
|
pTooltip="Regenerate cover"
|
||||||
pTooltip="Regenerate cover"
|
tooltipPosition="top"
|
||||||
tooltipPosition="top"
|
[outlined]="true"
|
||||||
[outlined]="true"
|
[disabled]="metadata['coverLocked']">
|
||||||
[disabled]="metadata['coverLocked']">
|
</p-button>
|
||||||
</p-button>
|
<p-fileupload
|
||||||
|
pTooltip="Upload cover"
|
||||||
<p-fileupload
|
tooltipPosition="top"
|
||||||
pTooltip="Upload cover"
|
[disabled]="metadata['coverLocked']"
|
||||||
tooltipPosition="top"
|
name="file"
|
||||||
[disabled]="metadata['coverLocked']"
|
[url]="getUploadCoverUrl()"
|
||||||
name="file"
|
mode="basic"
|
||||||
[url]="getUploadCoverUrl()"
|
chooseIcon="pi pi-upload"
|
||||||
mode="basic"
|
accept="image/jpeg,image/png"
|
||||||
chooseIcon="pi pi-upload"
|
maxFileSize="5000000"
|
||||||
accept="image/jpeg,image/png"
|
chooseLabel="Cover"
|
||||||
maxFileSize="5000000"
|
(onUpload)="onUpload($event)"
|
||||||
chooseLabel="Cover"
|
(onError)="onUploadError($event)"
|
||||||
(onUpload)="onUpload($event)"
|
[auto]="true"
|
||||||
(onError)="onUploadError($event)"
|
(onBeforeUpload)="onBeforeSend()">
|
||||||
[auto]="true"
|
</p-fileupload>
|
||||||
(onBeforeUpload)="onBeforeSend()">
|
@if (!metadata['coverLocked']) {
|
||||||
</p-fileupload>
|
<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-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" [outlined]="true" (onClick)="toggleLock('thumbnailUrl')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="flex flex-col flex-grow pl-2">
|
||||||
|
<!-- Title and Subtitle -->
|
||||||
<div class="flex flex-col flex-grow pl-2">
|
<div class="flex flex-row w-full gap-4 pb-1">
|
||||||
|
<div class="flex flex-col gap-1 w-2/3">
|
||||||
<!-- Title and Subtitle -->
|
<label for="title">Title</label>
|
||||||
<div class="flex flex-row w-full gap-4 pb-1">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<div class="flex flex-col gap-1 w-2/3">
|
<input pInputText id="title" formControlName="title" class="w-full"/>
|
||||||
<label for="title">Title</label>
|
@if (!metadata['titleLocked']) {
|
||||||
<div class="flex justify-between items-center gap-2">
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('title')" severity="success"></p-button>
|
||||||
<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" [outlined]="true" (onClick)="toggleLock('title')" severity="warn"></p-button>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col gap-1 w-1/3">
|
||||||
|
<label for="subtitle">Subtitle</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="subtitle" formControlName="subtitle" class="w-full"/>
|
||||||
|
@if (!metadata['subtitleLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/3">
|
<!-- Authors and Publisher -->
|
||||||
<label for="subtitle">Subtitle</label>
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
<div class="flex justify-between items-center gap-2">
|
<div class="flex flex-col gap-1 w-2/3">
|
||||||
<input pInputText id="subtitle" formControlName="subtitle" class="w-full"/>
|
<label for="authors">Authors</label>
|
||||||
<p-button *ngIf="!metadata['subtitleLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('subtitle')" severity="success"></p-button>
|
<div class="flex justify-between items-center gap-2">
|
||||||
<p-button *ngIf="metadata['subtitleLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('subtitle')" severity="warn"></p-button>
|
<input pInputText id="authors" formControlName="authors" class="w-full"/>
|
||||||
|
@if (!metadata['authorsLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/3">
|
||||||
|
<label for="publisher">Publisher</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="publisher" formControlName="publisher" class="w-full"/>
|
||||||
|
@if (!metadata['publisherLocked']) {
|
||||||
|
<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>
|
||||||
|
<!-- Categories and Published Date -->
|
||||||
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
|
<div class="flex flex-col gap-1 w-3/4">
|
||||||
|
<label for="categories">Categories</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="categories" formControlName="categories" class="w-full"/>
|
||||||
|
@if (!metadata['categoriesLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/8">
|
||||||
|
<label for="publishedDate">Publish Date</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="publishedDate" formControlName="publishedDate" class="w-full"/>
|
||||||
|
@if (!metadata['publishedDateLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/8">
|
||||||
|
<label for="language">Language</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="language" formControlName="language" class="w-full"/>
|
||||||
|
@if (!metadata['languageLocked']) {
|
||||||
|
<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 class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
|
<div class="flex flex-col gap-1 basis-3/4">
|
||||||
|
<label for="seriesName">Series Name</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="seriesName" formControlName="seriesName" class="w-full"/>
|
||||||
|
@if (!metadata['seriesNameLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 basis-1/8">
|
||||||
|
<label for="seriesNumber">Book Number</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="seriesNumber" formControlName="seriesNumber" class="w-full"/>
|
||||||
|
@if (!metadata['seriesNumberLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 basis-1/8">
|
||||||
|
<label for="seriesTotal">Books in Series</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="seriesTotal" formControlName="seriesTotal" class="w-full"/>
|
||||||
|
@if (!metadata['seriesTotalLocked']) {
|
||||||
|
<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>
|
||||||
|
<!-- ISBN, ASIN, Language -->
|
||||||
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="isbn10">ISBN 10</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="isbn10" formControlName="isbn10" class="w-full"/>
|
||||||
|
@if (!metadata['isbn10Locked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="isbn13">ISBN 13</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="isbn13" formControlName="isbn13" class="w-full"/>
|
||||||
|
@if (!metadata['isbn13Locked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="asin">ASIN (Amazon ID)</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="asin" formControlName="asin" class="w-full"/>
|
||||||
|
@if (!metadata['asinLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="amazonRating">Amazon ★</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="amazonRating" formControlName="amazonRating" class="w-full"/>
|
||||||
|
@if (!metadata['amazonRatingLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="amazonRatingCount">Amazon Reviews</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="amazonRatingCount" formControlName="amazonReviewCount" class="w-full"/>
|
||||||
|
@if (!metadata['amazonReviewCountLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="googleId">Google Books ID</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="googleId" formControlName="googleId" class="w-full"/>
|
||||||
|
@if (!metadata['googleIdLocked']) {
|
||||||
|
<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>
|
||||||
|
<!-- Ratings and Reviews -->
|
||||||
|
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
||||||
|
<div class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="goodreadsId">Goodreads ID</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="goodreadsId" formControlName="goodreadsId" class="w-full"/>
|
||||||
|
@if (!metadata['goodreadsIdLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="goodreadsRating">Goodreads ★</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="goodreadsRating" formControlName="goodreadsRating" class="w-full"/>
|
||||||
|
@if (!metadata['goodreadsRatingLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="goodreadsReviewCount">Goodreads Reviews</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="goodreadsReviewCount" formControlName="goodreadsReviewCount" class="w-full"/>
|
||||||
|
@if (!metadata['goodreadsReviewCountLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="hardcoverId">Hardcover ID</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="hardcoverId" formControlName="hardcoverId" class="w-full"/>
|
||||||
|
@if (!metadata['hardcoverIdLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="hardcoverRating">Hardcover ★</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="hardcoverRating" formControlName="hardcoverRating" class="w-full"/>
|
||||||
|
@if (!metadata['hardcoverRatingLocked']) {
|
||||||
|
<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 class="flex flex-col gap-1 w-1/6">
|
||||||
|
<label for="hardcoverReviewCount">Hardcover Reviews</label>
|
||||||
|
<div class="flex justify-between items-center gap-2">
|
||||||
|
<input pInputText id="hardcoverReviewCount" formControlName="hardcoverReviewCount" class="w-full"/>
|
||||||
|
@if (!metadata['hardcoverReviewCountLocked']) {
|
||||||
|
<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>
|
||||||
|
|
||||||
<!-- Authors and Publisher -->
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
|
||||||
<div class="flex flex-col gap-1 w-2/3">
|
|
||||||
<label for="authors">Authors</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['authorsLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('authors')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/3">
|
|
||||||
<label for="publisher">Publisher</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['publisherLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('publisher')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Categories and Published Date -->
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
|
||||||
<div class="flex flex-col gap-1 w-3/4">
|
|
||||||
<label for="categories">Categories</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['categoriesLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('categories')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/8">
|
|
||||||
<label for="publishedDate">Publish Date</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['publishedDateLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('publishedDate')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/8">
|
|
||||||
<label for="language">Language</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['languageLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('language')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-3/4">
|
|
||||||
<label for="seriesName">Series Name</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['seriesNameLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesName')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-1/8">
|
|
||||||
<label for="seriesNumber">Book Number</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['seriesNumberLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesNumber')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="flex flex-col gap-1 basis-1/8">
|
|
||||||
<label for="seriesTotal">Books in Series</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['seriesTotalLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('seriesTotal')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- ISBN, ASIN, Language -->
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="isbn10">ISBN 10</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['isbn10Locked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn10')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="isbn13">ISBN 13</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['isbn13Locked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('isbn13')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="asin">ASIN (Amazon ID)</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['asinLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('asin')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="amazonRating">Amazon ★</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['amazonRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonRating')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="amazonRatingCount">Amazon Reviews</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['amazonReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('amazonReviewCount')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="googleId">Google Books ID</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['googleIdLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('googleId')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Ratings and Reviews -->
|
|
||||||
<div class="flex flex-row w-full gap-4 mt-2 pb-1">
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="goodreadsId">Goodreads ID</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['goodreadsIdLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsId')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="goodreadsRating">Goodreads ★</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['goodreadsRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsRating')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="goodreadsReviewCount">Goodreads Reviews</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['goodreadsReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('goodreadsReviewCount')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="hardcoverId">Hardcover ID</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['hardcoverIdLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverId')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="hardcoverRating">Hardcover ★</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['hardcoverRatingLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverRating')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex flex-col gap-1 w-1/6">
|
|
||||||
<label for="hardcoverReviewCount">Hardcover Reviews</label>
|
|
||||||
<div class="flex justify-between items-center gap-2">
|
|
||||||
<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>
|
|
||||||
<p-button *ngIf="metadata['hardcoverReviewCountLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('hardcoverReviewCount')" severity="warn"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="flex flex-row w-full pb-1">
|
||||||
|
<div class="flex flex-col gap-1 w-full">
|
||||||
<div class="flex flex-row w-full pb-1">
|
<div class="flex justify-between items-center gap-2">
|
||||||
<div class="flex flex-col gap-1 w-full">
|
<p-tabs value="editor" class="w-full">
|
||||||
<div class="flex justify-between items-center gap-2">
|
<p-tablist>
|
||||||
<p-tabs value="editor" class="w-full">
|
<p-tab value="editor">WYSIWYG Editor</p-tab>
|
||||||
<p-tablist>
|
<p-tab value="html">HTML Editor</p-tab>
|
||||||
<p-tab value="editor">WYSIWYG Editor</p-tab>
|
</p-tablist>
|
||||||
<p-tab value="html">HTML Editor</p-tab>
|
<p-tabpanels>
|
||||||
</p-tablist>
|
<p-tabpanel value="editor">
|
||||||
<p-tabpanels>
|
<form [formGroup]="metadataForm">
|
||||||
<p-tabpanel value="editor">
|
<p-editor #quillEditor formControlName="description" [readonly]="quillDisabled()" [style]="{ height: '215px' }">
|
||||||
<form [formGroup]="metadataForm">
|
<ng-template #header>
|
||||||
<p-editor #quillEditor formControlName="description" [readonly]="quillDisabled()" [style]="{ height: '215px' }">
|
<span class="ql-formats">
|
||||||
<ng-template #header>
|
<button class="ql-bold" aria-label="Bold"></button>
|
||||||
<span class="ql-formats">
|
<button class="ql-italic" aria-label="Italic"></button>
|
||||||
<button class="ql-bold" aria-label="Bold"></button>
|
<button class="ql-underline" aria-label="Underline"></button>
|
||||||
<button class="ql-italic" aria-label="Italic"></button>
|
<button class="ql-strike" aria-label="Strikethrough"></button>
|
||||||
<button class="ql-underline" aria-label="Underline"></button>
|
</span>
|
||||||
<button class="ql-strike" aria-label="Strikethrough"></button>
|
<span class="ql-formats">
|
||||||
</span>
|
<select class="ql-size" aria-label="Font Size">
|
||||||
<span class="ql-formats">
|
<option value="small">Small</option>
|
||||||
<select class="ql-size" aria-label="Font Size">
|
<option selected>Normal</option>
|
||||||
<option value="small">Small</option>
|
<option value="large">Large</option>
|
||||||
<option selected>Normal</option>
|
<option value="huge">Huge</option>
|
||||||
<option value="large">Large</option>
|
</select>
|
||||||
<option value="huge">Huge</option>
|
</span>
|
||||||
</select>
|
<span class="ql-formats">
|
||||||
</span>
|
<button class="ql-list" value="ordered" aria-label="Numbered List"></button>
|
||||||
<span class="ql-formats">
|
<button class="ql-list" value="bullet" aria-label="Bullet List"></button>
|
||||||
<button class="ql-list" value="ordered" aria-label="Numbered List"></button>
|
</span>
|
||||||
<button class="ql-list" value="bullet" aria-label="Bullet List"></button>
|
<span class="ql-formats">
|
||||||
</span>
|
<select class="ql-color" aria-label="Text Color"></select>
|
||||||
<span class="ql-formats">
|
<select class="ql-background" aria-label="Background Color"></select>
|
||||||
<select class="ql-color" aria-label="Text Color"></select>
|
</span>
|
||||||
<select class="ql-background" aria-label="Background Color"></select>
|
<span class="ql-formats">
|
||||||
</span>
|
<button class="ql-clean" aria-label="Remove Formatting"></button>
|
||||||
<span class="ql-formats">
|
</span>
|
||||||
<button class="ql-clean" aria-label="Remove Formatting"></button>
|
</ng-template>
|
||||||
</span>
|
</p-editor>
|
||||||
</ng-template>
|
</form>
|
||||||
</p-editor>
|
</p-tabpanel>
|
||||||
</form>
|
<p-tabpanel value="html" class="w-full">
|
||||||
</p-tabpanel>
|
<textarea
|
||||||
<p-tabpanel value="html" class="w-full">
|
class="w-full p-4"
|
||||||
<textarea
|
rows="10"
|
||||||
class="w-full p-4"
|
[disabled]="quillDisabled()"
|
||||||
rows="10"
|
[ngModel]="htmlTextarea"
|
||||||
[disabled]="quillDisabled()"
|
(ngModelChange)="onHtmlTextareaChange($event)"
|
||||||
[ngModel]="htmlTextarea"
|
[ngModelOptions]="{ standalone: true }"
|
||||||
(ngModelChange)="onHtmlTextareaChange($event)"
|
placeholder="Edit raw HTML here">
|
||||||
[ngModelOptions]="{ standalone: true }"
|
</textarea>
|
||||||
placeholder="Edit raw HTML here">
|
</p-tabpanel>
|
||||||
</textarea>
|
</p-tabpanels>
|
||||||
</p-tabpanel>
|
</p-tabs>
|
||||||
</p-tabpanels>
|
@if (!metadata['descriptionLocked']) {
|
||||||
</p-tabs>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('description')" severity="success"></p-button>
|
||||||
<p-button *ngIf="!metadata['descriptionLocked']" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock('description')" severity="success"></p-button>
|
}
|
||||||
<p-button *ngIf="metadata['descriptionLocked']" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock('description')" severity="warn"></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 class="flex flex-col gap-x-4 mt-auto">
|
||||||
</div>
|
<p-divider></p-divider>
|
||||||
|
<div class="flex gap-x-4 justify-end">
|
||||||
<div class="flex flex-col gap-x-4 mt-auto">
|
<p-button label="Unlock All" icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()"></p-button>
|
||||||
<p-divider></p-divider>
|
<p-button label="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()"></p-button>
|
||||||
|
<p-divider layout="vertical"/>
|
||||||
<div class="flex gap-x-4 justify-end">
|
<p-button label="Save" icon="pi pi-check" type="submit"></p-button>
|
||||||
<p-button label="Unlock All" icon="pi pi-lock-open" [outlined]="true" severity="success" (onClick)="unlockAll()"></p-button>
|
</div>
|
||||||
<p-button label="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()"></p-button>
|
|
||||||
<p-divider layout="vertical"/>
|
|
||||||
<p-button label="Save" icon="pi pi-check" type="submit"></p-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
|
}
|
||||||
</form>
|
|
||||||
|
|||||||
+2
-3
@@ -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,
|
||||||
@@ -41,7 +40,7 @@ import {Tab, TabList, TabPanel, TabPanels, Tabs} from 'primeng/tabs';
|
|||||||
Tab,
|
Tab,
|
||||||
TabPanels,
|
TabPanels,
|
||||||
TabPanel
|
TabPanel
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class MetadataEditorComponent implements OnInit {
|
export class MetadataEditorComponent implements OnInit {
|
||||||
|
|
||||||
|
|||||||
+135
-117
@@ -1,148 +1,166 @@
|
|||||||
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" *ngIf="bookMetadata$ | async as metadata" class="h-full flex pt-1 flex-col">
|
@if (bookMetadata$ | async; as metadata) {
|
||||||
<div class="overflow-y-scroll flex-1">
|
<form [formGroup]="metadataForm" (ngSubmit)="onSave()" class="h-full flex pt-1 flex-col">
|
||||||
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
<div class="overflow-y-scroll flex-1">
|
||||||
<p class="ml-3 text-lg">Current Metadata</p>
|
<div class="flex justify-center items-center" [ngStyle]="{'padding-bottom': '0.75rem', 'padding-left': '7.6rem'}">
|
||||||
<p-button
|
<p class="ml-3 text-lg">Current Metadata</p>
|
||||||
severity="info"
|
|
||||||
icon='pi pi-angle-left'
|
|
||||||
[ngStyle]="{'padding-left': '2rem', 'padding-right': '0.5rem'}"
|
|
||||||
[outlined]="true"
|
|
||||||
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
|
||||||
(onClick)="copyMissing()"></p-button>
|
|
||||||
<p-button
|
|
||||||
severity="info"
|
|
||||||
icon='pi pi-angle-double-left'
|
|
||||||
[ngStyle]="{'padding-left': '0.5rem', 'padding-right': '2rem'}"
|
|
||||||
[outlined]="true"
|
|
||||||
pTooltip="Move all fields" tooltipPosition="bottom"
|
|
||||||
(onClick)="copyAll()"></p-button>
|
|
||||||
<p class="text-lg">Fetched Metadata</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-row">
|
|
||||||
<label class="label"></label>
|
|
||||||
<div class="input-container">
|
|
||||||
<p-button *ngIf="!metadata['coverLocked']" 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>
|
|
||||||
<img [src]="metadataForm.get('thumbnailUrl')?.value" alt="Book Thumbnail" class="thumbnail"/>
|
|
||||||
<input type="hidden" id="thumbnailUrl" formControlName="thumbnailUrl" class="input"/>
|
|
||||||
<p-button
|
<p-button
|
||||||
[icon]="isValueSaved('thumbnailUrl') ? 'pi pi-check' : (hoveredFields['thumbnailUrl'] && isValueCopied('thumbnailUrl') ? 'pi pi-times' : 'pi pi-arrow-left')"
|
severity="info"
|
||||||
|
icon='pi pi-angle-left'
|
||||||
|
[ngStyle]="{'padding-left': '2rem', 'padding-right': '0.5rem'}"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
|
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
||||||
|
(onClick)="copyMissing()"></p-button>
|
||||||
|
<p-button
|
||||||
|
severity="info"
|
||||||
|
icon='pi pi-angle-double-left'
|
||||||
|
[ngStyle]="{'padding-left': '0.5rem', 'padding-right': '2rem'}"
|
||||||
|
[outlined]="true"
|
||||||
|
pTooltip="Move all fields" tooltipPosition="bottom"
|
||||||
|
(onClick)="copyAll()"></p-button>
|
||||||
|
<p class="text-lg">Fetched Metadata</p>
|
||||||
|
</div>
|
||||||
|
<div class="form-row">
|
||||||
|
<label class="label"></label>
|
||||||
|
<div class="input-container">
|
||||||
|
@if (!metadata['coverLocked']) {
|
||||||
|
<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"/>
|
||||||
|
<input type="hidden" id="thumbnailUrl" formControlName="thumbnailUrl" class="input"/>
|
||||||
|
<p-button
|
||||||
|
[icon]="isValueSaved('thumbnailUrl') ? 'pi pi-check' : (hoveredFields['thumbnailUrl'] && isValueCopied('thumbnailUrl') ? 'pi pi-times' : 'pi pi-arrow-left')"
|
||||||
|
[outlined]="true"
|
||||||
[ngClass]="
|
[ngClass]="
|
||||||
{
|
{
|
||||||
'green-outlined-button': isValueSaved('thumbnailUrl'),
|
'green-outlined-button': isValueSaved('thumbnailUrl'),
|
||||||
'yellow-outlined-button': isValueCopied('thumbnailUrl') && !hoveredFields['thumbnailUrl'],
|
'yellow-outlined-button': isValueCopied('thumbnailUrl') && !hoveredFields['thumbnailUrl'],
|
||||||
'red-outlined-button': isValueCopied('thumbnailUrl') && hoveredFields['thumbnailUrl']
|
'red-outlined-button': isValueCopied('thumbnailUrl') && hoveredFields['thumbnailUrl']
|
||||||
}"
|
}"
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields['thumbnailUrl'] && isValueCopied('thumbnailUrl') ? resetField('thumbnailUrl') : copyFetchedToCurrent('thumbnailUrl')"
|
(click)="hoveredFields['thumbnailUrl'] && isValueCopied('thumbnailUrl') ? resetField('thumbnailUrl') : copyFetchedToCurrent('thumbnailUrl')"
|
||||||
(mouseenter)="onMouseEnter('thumbnailUrl')"
|
(mouseenter)="onMouseEnter('thumbnailUrl')"
|
||||||
(mouseleave)="onMouseLeave('thumbnailUrl')"/>
|
(mouseleave)="onMouseLeave('thumbnailUrl')"/>
|
||||||
<input type="hidden" [value]="fetchedMetadata.thumbnailUrl" class="input" readonly/>
|
<input type="hidden" [value]="fetchedMetadata.thumbnailUrl" class="input" readonly/>
|
||||||
<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 class="form-row">
|
||||||
<div *ngFor="let field of metadataFieldsTop" 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">
|
@if (!metadata[field.lockedKey]) {
|
||||||
<p-button *ngIf="!metadata[field.lockedKey]" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||||
<p-button *ngIf="metadata[field.lockedKey]" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
}
|
||||||
<input pInputText id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"/>
|
@if (metadata[field.lockedKey]) {
|
||||||
<p-button
|
<p-button icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
}
|
||||||
[outlined]="true"
|
<input pInputText id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"/>
|
||||||
|
<p-button
|
||||||
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
||||||
|
[outlined]="true"
|
||||||
[ngClass]="
|
[ngClass]="
|
||||||
{
|
{
|
||||||
'green-outlined-button': isValueSaved(field.controlName),
|
'green-outlined-button': isValueSaved(field.controlName),
|
||||||
'yellow-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
'yellow-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
||||||
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName]
|
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName]
|
||||||
}"
|
}"
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||||
(mouseenter)="onMouseEnter(field.controlName)"
|
(mouseenter)="onMouseEnter(field.controlName)"
|
||||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
(mouseleave)="onMouseLeave(field.controlName)"/>
|
||||||
<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) {
|
||||||
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
<div class="form-row">
|
||||||
<div class="input-container">
|
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
||||||
<p-button *ngIf="!metadata[field.lockedKey]" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
<div class="input-container">
|
||||||
<p-button *ngIf="metadata[field.lockedKey]" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
@if (!metadata[field.lockedKey]) {
|
||||||
<textarea rows="6" pTextarea id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"></textarea>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||||
<p-button
|
}
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
@if (metadata[field.lockedKey]) {
|
||||||
[outlined]="true"
|
<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>
|
||||||
|
<p-button
|
||||||
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
||||||
|
[outlined]="true"
|
||||||
[ngClass]="
|
[ngClass]="
|
||||||
{
|
{
|
||||||
'green-outlined-button': isValueSaved(field.controlName),
|
'green-outlined-button': isValueSaved(field.controlName),
|
||||||
'yellow-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
'yellow-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
||||||
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName]
|
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName]
|
||||||
}"
|
}"
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||||
(mouseenter)="onMouseEnter(field.controlName)"
|
(mouseenter)="onMouseEnter(field.controlName)"
|
||||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
(mouseleave)="onMouseLeave(field.controlName)"/>
|
||||||
<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) {
|
||||||
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
<div class="form-row">
|
||||||
<div class="input-container">
|
<label for="{{field.controlName}}" class="label">{{ field.label }}</label>
|
||||||
<p-button *ngIf="!metadata[field.lockedKey]" icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
<div class="input-container">
|
||||||
<p-button *ngIf="metadata[field.lockedKey]" icon="pi pi-lock" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="warn"></p-button>
|
@if (!metadata[field.lockedKey]) {
|
||||||
<input pInputText id="{{field.controlName}}" formControlName="{{field.controlName}}" class="input"/>
|
<p-button icon="pi pi-lock-open" [outlined]="true" (onClick)="toggleLock(field.controlName)" severity="success"></p-button>
|
||||||
<p-button
|
}
|
||||||
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
@if (metadata[field.lockedKey]) {
|
||||||
[outlined]="true"
|
<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"/>
|
||||||
|
<p-button
|
||||||
|
[icon]="isValueSaved(field.controlName) ? 'pi pi-check' : (hoveredFields[field.controlName] && isValueCopied(field.controlName) ? 'pi pi-times' : 'pi pi-arrow-left')"
|
||||||
|
[outlined]="true"
|
||||||
[ngClass]="
|
[ngClass]="
|
||||||
{
|
{
|
||||||
'green-outlined-button': isValueSaved(field.controlName),
|
'green-outlined-button': isValueSaved(field.controlName),
|
||||||
'yellow-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
'yellow-outlined-button': isValueCopied(field.controlName) && !hoveredFields[field.controlName],
|
||||||
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName]
|
'red-outlined-button': isValueCopied(field.controlName) && hoveredFields[field.controlName]
|
||||||
}"
|
}"
|
||||||
class="arrow-button"
|
class="arrow-button"
|
||||||
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
(click)="hoveredFields[field.controlName] && isValueCopied(field.controlName) ? resetField(field.controlName) : copyFetchedToCurrent(field.controlName)"
|
||||||
(mouseenter)="onMouseEnter(field.controlName)"
|
(mouseenter)="onMouseEnter(field.controlName)"
|
||||||
(mouseleave)="onMouseLeave(field.controlName)"/>
|
(mouseleave)="onMouseLeave(field.controlName)"/>
|
||||||
<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
|
||||||
severity="info"
|
severity="info"
|
||||||
icon='pi pi-angle-left'
|
icon='pi pi-angle-left'
|
||||||
[ngStyle]="{'padding-left': '2rem', 'padding-right': '0.5rem'}"
|
[ngStyle]="{'padding-left': '2rem', 'padding-right': '0.5rem'}"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
pTooltip="Move all missing fields" tooltipPosition="bottom"
|
||||||
(onClick)="copyMissing()"></p-button>
|
(onClick)="copyMissing()"></p-button>
|
||||||
<p-button
|
<p-button
|
||||||
severity="info"
|
severity="info"
|
||||||
icon='pi pi-angle-double-left'
|
icon='pi pi-angle-double-left'
|
||||||
[ngStyle]="{'padding-left': '0.5rem', 'padding-right': '2rem'}"
|
[ngStyle]="{'padding-left': '0.5rem', 'padding-right': '2rem'}"
|
||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
pTooltip="Move all fields" tooltipPosition="bottom"
|
pTooltip="Move all fields" tooltipPosition="bottom"
|
||||||
(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="flex flex-col gap-x-4 mt-auto">
|
|
||||||
<p-divider></p-divider>
|
|
||||||
<div class="flex justify-between">
|
|
||||||
<p-button label="To Metadata List" icon="pi pi-arrow-left" severity="info" (onClick)="goBackClick()"></p-button>
|
|
||||||
<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="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()"></p-button>
|
|
||||||
<p-divider layout="vertical"/>
|
|
||||||
<p-button label="Save" icon="pi pi-check" type="submit"></p-button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="flex flex-col gap-x-4 mt-auto">
|
||||||
</form>
|
<p-divider></p-divider>
|
||||||
|
<div class="flex justify-between">
|
||||||
|
<p-button label="To Metadata List" icon="pi pi-arrow-left" severity="info" (onClick)="goBackClick()"></p-button>
|
||||||
|
<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="Lock All" icon="pi pi-lock" [outlined]="true" severity="warn" (onClick)="lockAll()"></p-button>
|
||||||
|
<p-divider layout="vertical"/>
|
||||||
|
<p-button label="Save" icon="pi pi-check" type="submit"></p-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
}
|
||||||
|
|||||||
+2
-4
@@ -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,16 +22,14 @@ 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
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class MetadataPickerComponent implements OnInit {
|
export class MetadataPickerComponent implements OnInit {
|
||||||
|
|
||||||
|
|||||||
+59
-54
@@ -1,57 +1,62 @@
|
|||||||
<form *ngIf="!selectedFetchedMetadata" class="flex flex-col w-full h-full pt-2" [formGroup]="form" (ngSubmit)="onSubmit()">
|
@if (!selectedFetchedMetadata) {
|
||||||
<div class="flex w-full gap-x-4 items-end">
|
<form class="flex flex-col w-full h-full pt-2" [formGroup]="form" (ngSubmit)="onSubmit()">
|
||||||
<div class="flex flex-col gap-1 w-3/12">
|
<div class="flex w-full gap-x-4 items-end">
|
||||||
<label>Providers</label>
|
<div class="flex flex-col gap-1 w-3/12">
|
||||||
<p-multiselect id="provider" class="w-full" [filter]="false" showToggleAll="false" [options]="providers" formControlName="provider" placeholder="Select Providers"></p-multiselect>
|
<label>Providers</label>
|
||||||
</div>
|
<p-multiselect id="provider" class="w-full" [filter]="false" showToggleAll="false" [options]="providers" formControlName="provider" placeholder="Select Providers"></p-multiselect>
|
||||||
|
</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>
|
||||||
|
<p-button label="Search" type="submit" outlined="true" [disabled]="!isSearchEnabled || loading"></p-button>
|
||||||
<div>
|
|
||||||
<p-button label="Search" type="submit" outlined="true" [disabled]="!isSearchEnabled || loading"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="loading" class="flex justify-center items-center">
|
|
||||||
<p-progress-spinner ariaLabel="loading"/>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="!loading" class="mt-8 flex-1 overflow-y-auto">
|
|
||||||
<div *ngFor="let metadata of allFetchedMetadata" class="book-item flex flex-col w-full">
|
|
||||||
<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"/>
|
|
||||||
<div class=" flex flex-col w-full m-2">
|
|
||||||
<div class="flex flex-row gap-4 justify-between">
|
|
||||||
<p class="font-bold">{{ truncateText(metadata['title'], 90) }}</p>
|
|
||||||
<div class="flex gap-2">
|
|
||||||
<p>ISBN: {{ metadata['isbn10'] || metadata['asin'] }}</p>
|
|
||||||
<p> | </p>
|
|
||||||
<p>Published: {{ metadata['publishedDate'] }}</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="flex gap-2">
|
|
||||||
<p>by {{ truncateText(metadata['authors'].join(', '), 70) }}</p>
|
|
||||||
<p> | </p>
|
|
||||||
<p>Source: <span [innerHTML]="buildProviderLink(metadata)"></span></p>
|
|
||||||
</div>
|
|
||||||
<p class="mt-4 truncate-text p-secondary">
|
|
||||||
{{ sanitizeHtml(metadata['description']) }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@if (loading) {
|
||||||
</form>
|
<div class="flex justify-center items-center">
|
||||||
|
<p-progress-spinner ariaLabel="loading"/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (!loading) {
|
||||||
|
<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)">
|
||||||
|
<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-row gap-4 justify-between">
|
||||||
|
<p class="font-bold">{{ truncateText(metadata['title'], 90) }}</p>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<p>ISBN: {{ metadata['isbn10'] || metadata['asin'] }}</p>
|
||||||
|
<p> | </p>
|
||||||
|
<p>Published: {{ metadata['publishedDate'] }}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<p>by {{ truncateText(metadata['authors'].join(', '), 70) }}</p>
|
||||||
|
<p> | </p>
|
||||||
|
<p>Source: <span [innerHTML]="buildProviderLink(metadata)"></span></p>
|
||||||
|
</div>
|
||||||
|
<p class="mt-4 truncate-text p-secondary">
|
||||||
|
{{ sanitizeHtml(metadata['description']) }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p-divider></p-divider>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</form>
|
||||||
|
}
|
||||||
|
|
||||||
<div *ngIf="selectedFetchedMetadata" class="h-full flex-auto">
|
@if (selectedFetchedMetadata) {
|
||||||
<app-metadata-picker [fetchedMetadata]="selectedFetchedMetadata" (goBack)="onGoBack()"></app-metadata-picker>
|
<div class="h-full flex-auto">
|
||||||
</div>
|
<app-metadata-picker [fetchedMetadata]="selectedFetchedMetadata" (goBack)="onGoBack()"></app-metadata-picker>
|
||||||
|
</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 {
|
||||||
|
|||||||
+272
-264
@@ -1,114 +1,117 @@
|
|||||||
<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 class="flex flex-row">
|
<div>
|
||||||
<div class="cover-wrapper relative">
|
<div class="flex flex-row">
|
||||||
<img
|
<div class="cover-wrapper relative">
|
||||||
[attr.src]="urlHelper.getCoverUrl(metadata.bookId, metadata?.coverUpdatedOn)"
|
<img
|
||||||
class="book-cover placeholder"
|
[attr.src]="urlHelper.getCoverUrl(metadata.bookId, metadata?.coverUpdatedOn)"
|
||||||
alt="Cover of {{ metadata.title }}"
|
class="book-cover placeholder"
|
||||||
loading="lazy"
|
alt="Cover of {{ metadata.title }}"
|
||||||
width="225"
|
loading="lazy"
|
||||||
style="min-width: 225px;"
|
width="225"
|
||||||
/>
|
style="min-width: 225px;"
|
||||||
|
/>
|
||||||
<p-progressBar
|
@if (getProgressPercent() !== null) {
|
||||||
*ngIf="getProgressPercent() !== null"
|
<p-progressBar
|
||||||
[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) {
|
||||||
<div class="flex items-center gap-2">
|
<p class="italic">{{ metadata.seriesName }} #{{ metadata.seriesNumber }}</p>
|
||||||
<p class="text-2xl font-bold m-0">{{ metadata.title }}</p>
|
}
|
||||||
<i
|
<div class="flex items-center gap-2">
|
||||||
class="pi"
|
<p class="text-2xl font-bold m-0">{{ metadata.title }}</p>
|
||||||
[ngClass]="isMetadataFullyLocked(metadata) ? 'pi-lock text-red-500' : 'pi-lock-open text-green-500'"
|
<i
|
||||||
[title]="isMetadataFullyLocked(metadata) ? 'Metadata is locked' : 'Metadata is unlocked'"
|
class="pi"
|
||||||
style="font-size: 1.25rem;"
|
[ngClass]="isMetadataFullyLocked(metadata) ? 'pi-lock text-red-500' : 'pi-lock-open text-green-500'"
|
||||||
pTooltip="{{ isMetadataFullyLocked(metadata) ? 'This book metadata is locked.' : 'This book metadata is unlocked.' }}"
|
[title]="isMetadataFullyLocked(metadata) ? 'Metadata is locked' : 'Metadata is unlocked'"
|
||||||
tooltipPosition="top">
|
style="font-size: 1.25rem;"
|
||||||
</i>
|
pTooltip="{{ isMetadataFullyLocked(metadata) ? 'This book metadata is locked.' : 'This book metadata is unlocked.' }}"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</i>
|
||||||
|
</div>
|
||||||
|
<p class="text-xl">{{ getAuthorNames(metadata?.authors || []) }}</p>
|
||||||
</div>
|
</div>
|
||||||
<p class="text-xl">{{ getAuthorNames(metadata?.authors || []) }}</p>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div class="flex items-center gap-2 pt-2">
|
||||||
|
@if (metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating) {
|
||||||
<div class="flex items-center gap-2 pt-2">
|
@if (metadata.amazonRating) {
|
||||||
<ng-container *ngIf="metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating; else legacyRating">
|
@if (metadata.asin) {
|
||||||
<ng-container *ngIf="metadata.amazonRating">
|
<a class="flex items-center gap-1" [href]="'https://www.amazon.com/dp/' + metadata.asin" target="_blank" rel="noopener noreferrer">
|
||||||
<ng-container *ngIf="metadata.asin; else amazonStatic">
|
<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" />
|
||||||
<a class="flex items-center gap-1" [href]="'https://www.amazon.com/dp/' + metadata.asin" target="_blank" rel="noopener noreferrer">
|
<p class="font-semibold">{{ metadata.amazonRating }}</p>
|
||||||
<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" />
|
</a>
|
||||||
<p class="font-semibold">{{ metadata.amazonRating }}</p>
|
} @else {
|
||||||
</a>
|
<span class="flex items-center gap-1">
|
||||||
</ng-container>
|
<img src="https://www.amazon.com/favicon.ico" alt="Amazon" class="w-5 h-5 object-contain" />
|
||||||
<ng-template #amazonStatic>
|
<p class="font-semibold">{{ metadata.amazonRating }}</p>
|
||||||
<span class="flex items-center gap-1">
|
</span>
|
||||||
<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-rating [ngModel]="metadata.amazonRating" readonly stars="5"
|
||||||
</span>
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)">
|
||||||
</ng-template>
|
</p-rating>
|
||||||
<p-rating [ngModel]="metadata.amazonRating" readonly stars="5"
|
<p class="font-semibold">({{ metadata.amazonReviewCount | number:'1.0-0' }})</p>
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.amazonRating)">
|
@if (metadata.goodreadsRating || metadata.hardcoverRating) {
|
||||||
</p-rating>
|
<span>|</span>
|
||||||
<p class="font-semibold">({{ metadata.amazonReviewCount | number:'1.0-0' }})</p>
|
}
|
||||||
<span *ngIf="metadata.goodreadsRating || metadata.hardcoverRating">|</span>
|
}
|
||||||
</ng-container>
|
@if (metadata.goodreadsRating) {
|
||||||
|
@if (metadata.goodreadsId) {
|
||||||
<ng-container *ngIf="metadata.goodreadsRating">
|
<a class="flex items-center gap-1" [href]="'https://www.goodreads.com/book/show/' + metadata.goodreadsId" target="_blank" rel="noopener noreferrer">
|
||||||
<ng-container *ngIf="metadata.goodreadsId; else goodreadsStatic">
|
<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" />
|
||||||
<a class="flex items-center gap-1" [href]="'https://www.goodreads.com/book/show/' + metadata.goodreadsId" target="_blank" rel="noopener noreferrer">
|
<p class="font-semibold">{{ metadata.goodreadsRating }}</p>
|
||||||
<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" />
|
</a>
|
||||||
<p class="font-semibold">{{ metadata.goodreadsRating }}</p>
|
} @else {
|
||||||
</a>
|
<span class="flex items-center gap-1">
|
||||||
</ng-container>
|
<img src="https://www.goodreads.com/favicon.ico" alt="Goodreads" class="w-5 h-5 object-contain" />
|
||||||
<ng-template #goodreadsStatic>
|
<p class="font-semibold">{{ metadata.goodreadsRating }}</p>
|
||||||
<span class="flex items-center gap-1">
|
</span>
|
||||||
<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-rating [ngModel]="metadata.goodreadsRating" readonly stars="5"
|
||||||
</span>
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
||||||
</ng-template>
|
</p-rating>
|
||||||
<p-rating [ngModel]="metadata.goodreadsRating" readonly stars="5"
|
<p class="font-semibold">({{ metadata.goodreadsReviewCount | number:'1.0-0' }})</p>
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.goodreadsRating)">
|
@if (metadata.hardcoverRating) {
|
||||||
</p-rating>
|
<span>|</span>
|
||||||
<p class="font-semibold">({{ metadata.goodreadsReviewCount | number:'1.0-0' }})</p>
|
}
|
||||||
<span *ngIf="metadata.hardcoverRating">|</span>
|
}
|
||||||
</ng-container>
|
@if (metadata.hardcoverRating) {
|
||||||
|
@if (metadata.hardcoverId) {
|
||||||
<ng-container *ngIf="metadata.hardcoverRating">
|
<a class="flex items-center gap-1" [href]="'https://hardcover.app/books/' + metadata.hardcoverId" target="_blank" rel="noopener noreferrer">
|
||||||
<ng-container *ngIf="metadata.hardcoverId; else hardcoverStatic">
|
<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" />
|
||||||
<a class="flex items-center gap-1" [href]="'https://hardcover.app/books/' + metadata.hardcoverId" target="_blank" rel="noopener noreferrer">
|
<p class="font-semibold">{{ metadata.hardcoverRating }}</p>
|
||||||
<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" />
|
</a>
|
||||||
<p class="font-semibold">{{ metadata.hardcoverRating }}</p>
|
} @else {
|
||||||
</a>
|
<span class="flex items-center gap-1">
|
||||||
</ng-container>
|
<img src="https://assets.hardcover.app/static/favicon.ico" alt="Hardcover" class="w-5 h-5 object-contain" />
|
||||||
<ng-template #hardcoverStatic>
|
<p class="font-semibold">{{ metadata.hardcoverRating }}</p>
|
||||||
<span class="flex items-center gap-1">
|
</span>
|
||||||
<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-rating [ngModel]="metadata.hardcoverRating" readonly stars="5"
|
||||||
</span>
|
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
||||||
</ng-template>
|
</p-rating>
|
||||||
<p-rating [ngModel]="metadata.hardcoverRating" readonly stars="5"
|
<p class="font-semibold">({{ metadata.hardcoverReviewCount | number:'1.0-0' }})</p>
|
||||||
[style.--p-rating-icon-active-color]="getStarColor(metadata.hardcoverRating)">
|
@if ((metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating) && metadata.googleId) {
|
||||||
</p-rating>
|
<span>|</span>
|
||||||
<p class="font-semibold">({{ metadata.hardcoverReviewCount | number:'1.0-0' }})</p>
|
}
|
||||||
<span *ngIf="(metadata.amazonRating || metadata.goodreadsRating || metadata.hardcoverRating) && metadata.googleId">|</span>
|
}
|
||||||
</ng-container>
|
@if (metadata.googleId) {
|
||||||
<ng-container *ngIf="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
|
||||||
@@ -117,179 +120,184 @@
|
|||||||
</p-rating>
|
</p-rating>
|
||||||
<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>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="flex gap-2 pt-4 overflow-x-auto scrollbar-hide">
|
||||||
|
@for (category of metadata.categories; track category) {
|
||||||
|
<p-tag [value]="category" class="shrink-0"></p-tag>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<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">
|
||||||
|
<span class="font-bold">File Type:</span>
|
||||||
|
<span
|
||||||
|
class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white"
|
||||||
|
[ngClass]="getFileTypeColorClass(getFileExtension(book?.filePath))">
|
||||||
|
{{ getFileExtension(book?.filePath) || '-' }}
|
||||||
|
</span>
|
||||||
</p>
|
</p>
|
||||||
</ng-template>
|
<p class="whitespace-nowrap"><span class="font-bold">Publisher:</span> {{ metadata.publisher || '-' }}</p>
|
||||||
</div>
|
<p class="whitespace-nowrap"><span class="font-bold">Published:</span> {{ metadata.publishedDate || '-' }}</p>
|
||||||
|
<p class="whitespace-nowrap"><span class="font-bold">Language:</span> {{ metadata.language || '-' }}</p>
|
||||||
<div class="flex gap-2 pt-4 overflow-x-auto scrollbar-hide">
|
<p class="whitespace-nowrap"><span class="font-bold">ISBN 10:</span> {{ metadata.isbn10 || '-' }}</p>
|
||||||
<p-tag *ngFor="let category of metadata.categories" [value]="category" class="shrink-0"></p-tag>
|
<p class="whitespace-nowrap"><span class="font-bold">ISBN 13:</span> {{ metadata.isbn13 || '-' }}</p>
|
||||||
</div>
|
<p class="whitespace-nowrap"><span class="font-bold">Page Count:</span> {{ metadata.pageCount || '-' }}</p>
|
||||||
|
<p class="whitespace-nowrap"><span class="font-bold">File Size:</span> {{ getFileSizeInMB() }}</p>
|
||||||
<div class="grid gap-x-20 gap-y-2 pt-6" style="grid-template-columns: repeat(5, max-content);">
|
<p class="whitespace-nowrap"><span class="font-bold">Progress:</span> {{ getProgressPercent() !== null ? getProgressPercent() + '%' : '-' }}</p>
|
||||||
<p class="whitespace-nowrap flex items-center gap-2">
|
</div>
|
||||||
<span class="font-bold">File Type:</span>
|
<div class="pt-2 flex items-center gap-2 w-full">
|
||||||
<span
|
<span class="font-semibold flex-shrink-0">File Path:</span>
|
||||||
class="inline-block px-2 py-0.5 rounded-full text-xs font-bold text-white"
|
<p-toggleButton
|
||||||
[ngClass]="getFileTypeColorClass(getFileExtension(book?.filePath))">
|
[(ngModel)]="showFilePath"
|
||||||
{{ getFileExtension(book?.filePath) || '-' }}
|
onIcon="pi pi-eye-slash"
|
||||||
</span>
|
offIcon="pi pi-eye"
|
||||||
</p>
|
onLabel=""
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">Publisher:</span> {{ metadata.publisher || '-' }}</p>
|
offLabel=""
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">Published:</span> {{ metadata.publishedDate || '-' }}</p>
|
size="small"
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">Language:</span> {{ metadata.language || '-' }}</p>
|
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">ISBN 10:</span> {{ metadata.isbn10 || '-' }}</p>
|
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">ISBN 13:</span> {{ metadata.isbn13 || '-' }}</p>
|
|
||||||
<p class="whitespace-nowrap"><span class="font-bold">Page Count:</span> {{ metadata.pageCount || '-' }}</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>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pt-2 flex items-center gap-2 w-full">
|
|
||||||
<span class="font-semibold flex-shrink-0">File Path:</span>
|
|
||||||
<p-toggleButton
|
|
||||||
[(ngModel)]="showFilePath"
|
|
||||||
onIcon="pi pi-eye-slash"
|
|
||||||
offIcon="pi pi-eye"
|
|
||||||
onLabel=""
|
|
||||||
offLabel=""
|
|
||||||
size="small"
|
|
||||||
class="flex-shrink-0"></p-toggleButton>
|
class="flex-shrink-0"></p-toggleButton>
|
||||||
<div
|
@if (showFilePath) {
|
||||||
class="flex items-center gap-4 flex-grow"
|
<div
|
||||||
*ngIf="showFilePath"
|
class="flex items-center gap-4 flex-grow"
|
||||||
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"
|
||||||
style="min-width: 0;">
|
style="min-width: 0;">
|
||||||
{{ book?.filePath }}
|
{{ book?.filePath }}
|
||||||
</p>
|
</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
@if (userService.userState$ | async; as userData) {
|
||||||
|
<div class="pl-6 pt-4 flex flex-row w-full gap-4">
|
||||||
<div *ngIf="userService.userState$ | async as userData" 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"
|
severity="info"
|
||||||
severity="info"
|
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
|
label="Download"
|
||||||
*ngIf="userData.permissions.canDownload || userData.permissions.admin"
|
icon="pi pi-download"
|
||||||
label="Download"
|
severity="info"
|
||||||
icon="pi pi-download"
|
outlined
|
||||||
severity="info"
|
(onClick)="download(metadata.bookId)">
|
||||||
outlined
|
</p-button>
|
||||||
(onClick)="download(metadata.bookId)">
|
}
|
||||||
</p-button>
|
@if (userData.permissions.canEmailBook || userData.permissions.admin) {
|
||||||
|
<p-splitbutton
|
||||||
<p-splitbutton
|
label="Quick Send"
|
||||||
*ngIf="userData.permissions.canEmailBook || userData.permissions.admin"
|
icon="pi pi-send"
|
||||||
label="Quick Send"
|
[model]="emailMenuItems"
|
||||||
icon="pi pi-send"
|
(onClick)="quickSend(metadata.bookId)"
|
||||||
[model]="emailMenuItems"
|
outlined
|
||||||
(onClick)="quickSend(metadata.bookId)"
|
severity="info">
|
||||||
outlined
|
</p-splitbutton>
|
||||||
severity="info">
|
}
|
||||||
</p-splitbutton>
|
@if (userData.permissions.canEditMetadata || userData.permissions.admin) {
|
||||||
|
<p-splitbutton
|
||||||
<p-splitbutton
|
label="Quick Refresh"
|
||||||
*ngIf="userData.permissions.canEditMetadata || userData.permissions.admin"
|
icon="pi pi-bolt"
|
||||||
label="Quick Refresh"
|
[model]="refreshMenuItems"
|
||||||
icon="pi pi-bolt"
|
(onClick)="quickRefresh(metadata.bookId)"
|
||||||
[model]="refreshMenuItems"
|
outlined
|
||||||
(onClick)="quickRefresh(metadata.bookId)"
|
severity="info">
|
||||||
outlined
|
</p-splitbutton>
|
||||||
severity="info">
|
}
|
||||||
</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 [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }" class="transition-all duration-300 overflow-hidden description-container">
|
<div class="flex-1 overflow-auto space-y-2 px-2">
|
||||||
<div class="readonly-editor px-2">
|
<div [ngClass]="{ 'line-clamp-5': !isExpanded, 'line-clamp-none': isExpanded }" class="transition-all duration-300 overflow-hidden description-container">
|
||||||
<p-editor #quillEditor [readonly]="true" [style]="{height: '250px'}" [(ngModel)]="metadata.description">
|
<div class="readonly-editor px-2">
|
||||||
<ng-template #header>
|
<p-editor #quillEditor [readonly]="true" [style]="{height: '250px'}" [(ngModel)]="metadata.description">
|
||||||
</ng-template>
|
<ng-template #header>
|
||||||
</p-editor>
|
</ng-template>
|
||||||
</div>
|
</p-editor>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="metadata.description && metadata.description.length > 100" class="text-left">
|
|
||||||
<button pButton
|
|
||||||
type="button"
|
|
||||||
[label]="isExpanded ? 'Show less' : 'Show more'"
|
|
||||||
[icon]="isExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'"
|
|
||||||
iconPos="right"
|
|
||||||
class="p-button-text p-button-sm"
|
|
||||||
(click)="toggleExpand()">
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p-divider></p-divider>
|
|
||||||
|
|
||||||
<ng-container *ngIf="bookInSeries.length > 0">
|
|
||||||
<div>
|
|
||||||
<h3 class="text-xl font-semibold pt-2">More in the Series</h3>
|
|
||||||
<div class="dashboard-scroller-infinite"
|
|
||||||
infiniteScroll
|
|
||||||
[infiniteScrollDistance]="2"
|
|
||||||
[infiniteScrollThrottle]="50"
|
|
||||||
[horizontal]="true">
|
|
||||||
<div class="dashboard-scroller-card" *ngFor="let book of bookInSeries">
|
|
||||||
<app-book-card
|
|
||||||
[book]="book"
|
|
||||||
[isCheckboxEnabled]="false"
|
|
||||||
[readButtonHidden]="true"
|
|
||||||
[bottomBarHidden]="true">
|
|
||||||
</app-book-card>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@if (metadata.description && metadata.description.length > 100) {
|
||||||
|
<div class="text-left">
|
||||||
|
<button pButton
|
||||||
|
type="button"
|
||||||
|
[label]="isExpanded ? 'Show less' : 'Show more'"
|
||||||
|
[icon]="isExpanded ? 'pi pi-chevron-up' : 'pi pi-chevron-down'"
|
||||||
|
iconPos="right"
|
||||||
|
class="p-button-text p-button-sm"
|
||||||
|
(click)="toggleExpand()">
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
</ng-container>
|
@if (bookInSeries.length > 0) {
|
||||||
|
<div>
|
||||||
<ng-container *ngIf="recommendedBooks.length > 0">
|
<h3 class="text-xl font-semibold pt-2">More in the Series</h3>
|
||||||
<div>
|
<div class="dashboard-scroller-infinite"
|
||||||
<h3 class="text-xl font-semibold">Similar Books</h3>
|
infiniteScroll
|
||||||
<div class="dashboard-scroller-infinite"
|
[infiniteScrollDistance]="2"
|
||||||
infiniteScroll
|
[infiniteScrollThrottle]="50"
|
||||||
[infiniteScrollDistance]="2"
|
[horizontal]="true">
|
||||||
[infiniteScrollThrottle]="50"
|
@for (book of bookInSeries; track book) {
|
||||||
[horizontal]="true">
|
<div class="dashboard-scroller-card">
|
||||||
<div class="dashboard-scroller-card" *ngFor="let book of recommendedBooks">
|
<app-book-card
|
||||||
<app-book-card
|
[book]="book"
|
||||||
[book]="book.book"
|
[isCheckboxEnabled]="false"
|
||||||
[isCheckboxEnabled]="false"
|
[readButtonHidden]="true"
|
||||||
[readButtonHidden]="true"
|
[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) {
|
||||||
|
<div>
|
||||||
</div>
|
<h3 class="text-xl font-semibold">Similar Books</h3>
|
||||||
|
<div class="dashboard-scroller-infinite"
|
||||||
|
infiniteScroll
|
||||||
|
[infiniteScrollDistance]="2"
|
||||||
|
[infiniteScrollThrottle]="50"
|
||||||
|
[horizontal]="true">
|
||||||
|
@for (book of recommendedBooks; track book) {
|
||||||
|
<div class="dashboard-scroller-card">
|
||||||
|
<app-book-card
|
||||||
|
[book]="book.book"
|
||||||
|
[isCheckboxEnabled]="false"
|
||||||
|
[readButtonHidden]="true"
|
||||||
|
[bottomBarHidden]="true">
|
||||||
|
</app-book-card>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p-divider></p-divider>
|
||||||
|
}
|
||||||
|
</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 {
|
||||||
|
|
||||||
|
|||||||
+67
-52
@@ -1,61 +1,77 @@
|
|||||||
<div class="flex flex-col space-y-6 p-4">
|
<div class="flex flex-col space-y-6 p-4">
|
||||||
<table class="min-w-full table-auto border-collapse custom-table">
|
<table class="min-w-full table-auto border-collapse custom-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="px-4 py-2 text-left font-semibold text-gray-300">Book Field</th>
|
<th class="px-4 py-2 text-left font-semibold text-gray-300">Book Field</th>
|
||||||
<th class="px-4 py-2 text-left font-semibold text-gray-300">3rd Priority</th>
|
<th class="px-4 py-2 text-left font-semibold text-gray-300">4th Priority</th>
|
||||||
<th class="px-4 py-2 text-left font-semibold text-gray-300">2nd Priority</th>
|
<th class="px-4 py-2 text-left font-semibold text-gray-300">3rd Priority</th>
|
||||||
<th class="px-4 py-2 text-left font-semibold text-gray-300">1st Priority</th>
|
<th class="px-4 py-2 text-left font-semibold text-gray-300">2nd Priority</th>
|
||||||
</tr>
|
<th class="px-4 py-2 text-left font-semibold text-gray-300">1st Priority</th>
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="px-4 py-2 text-gray-300">All Other Fields</td>
|
<td class="px-4 py-2 text-gray-300">All Other Fields</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<p-select [options]="providers" [(ngModel)]="allP3.value"
|
<p-select [options]="providers" [(ngModel)]="allP4.value"
|
||||||
(onChange)="syncProvider($event, 'p3')"
|
(onChange)="syncProvider($event, 'p4')"
|
||||||
placeholder="Select All" appendTo="body"
|
placeholder="Select All" appendTo="body"
|
||||||
class="w-full">
|
class="w-full">
|
||||||
</p-select>
|
</p-select>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<p-select [options]="providers" [(ngModel)]="allP2.value"
|
<p-select [options]="providers" [(ngModel)]="allP3.value"
|
||||||
(onChange)="syncProvider($event, 'p2')"
|
(onChange)="syncProvider($event, 'p3')"
|
||||||
placeholder="Select All" appendTo="body"
|
placeholder="Select All" appendTo="body"
|
||||||
class="w-full">
|
class="w-full">
|
||||||
</p-select>
|
</p-select>
|
||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2">
|
||||||
<p-select [options]="providers" [(ngModel)]="allP1.value"
|
<p-select [options]="providers" [(ngModel)]="allP2.value"
|
||||||
(onChange)="syncProvider($event, 'p1')"
|
(onChange)="syncProvider($event, 'p2')"
|
||||||
placeholder="Select All" appendTo="body"
|
placeholder="Select All" appendTo="body"
|
||||||
class="w-full">
|
class="w-full">
|
||||||
</p-select>
|
</p-select>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td class="px-4 py-2">
|
||||||
|
<p-select [options]="providers" [(ngModel)]="allP1.value"
|
||||||
|
(onChange)="syncProvider($event, 'p1')"
|
||||||
|
placeholder="Select All" appendTo="body"
|
||||||
|
class="w-full">
|
||||||
|
</p-select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr *ngFor="let field of fields" [hidden]="field === 'cover' && !refreshCovers">
|
@for (field of fields; track field) {
|
||||||
<td class="px-4 py-2 text-gray-300">{{formatLabel(field) }}</td>
|
<tr [hidden]="field === 'cover' && !refreshCovers">
|
||||||
<td class="px-4 py-2">
|
<td class="px-4 py-2 text-gray-300">{{ formatLabel(field) }}</td>
|
||||||
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p3"
|
<td class="px-4 py-2">
|
||||||
placeholder="Unset" appendTo="body"
|
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p4"
|
||||||
class="w-full">
|
placeholder="Unset" appendTo="body"
|
||||||
</p-select>
|
class="w-full">
|
||||||
</td>
|
</p-select>
|
||||||
<td class="px-4 py-2">
|
</td>
|
||||||
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p2"
|
<td class="px-4 py-2">
|
||||||
placeholder="Unset" appendTo="body"
|
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p3"
|
||||||
class="w-full">
|
placeholder="Unset" appendTo="body"
|
||||||
</p-select>
|
class="w-full">
|
||||||
</td>
|
</p-select>
|
||||||
<td class="px-4 py-2">
|
</td>
|
||||||
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p1"
|
<td class="px-4 py-2">
|
||||||
placeholder="Unset" appendTo="body"
|
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p2"
|
||||||
class="w-full">
|
placeholder="Unset" appendTo="body"
|
||||||
</p-select>
|
class="w-full">
|
||||||
</td>
|
</p-select>
|
||||||
</tr>
|
</td>
|
||||||
|
<td class="px-4 py-2">
|
||||||
|
<p-select [options]="providers" [(ngModel)]="fieldOptions[field].p1"
|
||||||
|
placeholder="Unset" appendTo="body"
|
||||||
|
class="w-full">
|
||||||
|
</p-select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@@ -75,5 +91,4 @@
|
|||||||
<p-button [label]="submitButtonLabel" outlined="true" (onClick)="submit()"></p-button>
|
<p-button [label]="submitButtonLabel" outlined="true" (onClick)="submit()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+56
-68
@@ -1,67 +1,56 @@
|
|||||||
import {Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges} from '@angular/core';
|
import {
|
||||||
|
Component, EventEmitter, inject, Input, OnChanges, Output, SimpleChanges
|
||||||
|
} 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';
|
||||||
import {FieldOptions, FieldProvider, MetadataRefreshOptions} from '../../model/request/metadata-refresh-options.model';
|
import {
|
||||||
|
FieldOptions,
|
||||||
|
FieldProvider,
|
||||||
|
MetadataRefreshOptions
|
||||||
|
} from '../../model/request/metadata-refresh-options.model';
|
||||||
|
|
||||||
@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
|
||||||
})
|
})
|
||||||
export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
||||||
|
|
||||||
@Output() metadataOptionsSubmitted: EventEmitter<MetadataRefreshOptions> = new EventEmitter<MetadataRefreshOptions>();
|
@Output() metadataOptionsSubmitted = new EventEmitter<MetadataRefreshOptions>();
|
||||||
fields: (keyof FieldOptions)[] = [
|
|
||||||
'title',
|
|
||||||
'subtitle',
|
|
||||||
'description',
|
|
||||||
'authors',
|
|
||||||
'publisher',
|
|
||||||
'publishedDate',
|
|
||||||
'seriesName',
|
|
||||||
'seriesNumber',
|
|
||||||
'seriesTotal',
|
|
||||||
'isbn13',
|
|
||||||
'isbn10',
|
|
||||||
'language',
|
|
||||||
'categories',
|
|
||||||
'cover'
|
|
||||||
];
|
|
||||||
providers: string[] = ['Amazon', 'Google', 'GoodReads', 'Hardcover'];
|
|
||||||
refreshCovers: boolean = false;
|
|
||||||
mergeCategories: boolean = false;
|
|
||||||
|
|
||||||
allP3 = {placeholder: 'Set All', value: null as string | null};
|
|
||||||
allP2 = {placeholder: 'Set All', value: null as string | null};
|
|
||||||
allP1 = {placeholder: 'Set All', value: null as string | null};
|
|
||||||
|
|
||||||
fieldOptions: FieldOptions = {
|
|
||||||
title: {p3: null, p2: null, p1: null},
|
|
||||||
subtitle: {p3: null, p2: null, p1: null},
|
|
||||||
description: {p3: null, p2: null, p1: null},
|
|
||||||
authors: {p3: null, p2: null, p1: null},
|
|
||||||
publisher: {p3: null, p2: null, p1: null},
|
|
||||||
publishedDate: {p3: null, p2: null, p1: null},
|
|
||||||
seriesName: {p3: null, p2: null, p1: null},
|
|
||||||
seriesNumber: {p3: null, p2: null, p1: null},
|
|
||||||
seriesTotal: {p3: null, p2: null, p1: null},
|
|
||||||
isbn13: {p3: null, p2: null, p1: null},
|
|
||||||
isbn10: {p3: null, p2: null, p1: null},
|
|
||||||
language: {p3: null, p2: null, p1: null},
|
|
||||||
categories: {p3: null, p2: null, p1: null},
|
|
||||||
cover: {p3: null, p2: null, p1: null}
|
|
||||||
};
|
|
||||||
|
|
||||||
private messageService = inject(MessageService);
|
|
||||||
@Input() currentMetadataOptions!: MetadataRefreshOptions;
|
@Input() currentMetadataOptions!: MetadataRefreshOptions;
|
||||||
@Input() submitButtonLabel!: string;
|
@Input() submitButtonLabel!: string;
|
||||||
|
|
||||||
|
fields: (keyof FieldOptions)[] = [
|
||||||
|
'title', 'subtitle', 'description', 'authors', 'publisher', 'publishedDate',
|
||||||
|
'seriesName', 'seriesNumber', 'seriesTotal', 'isbn13', 'isbn10',
|
||||||
|
'language', 'categories', 'cover'
|
||||||
|
];
|
||||||
|
providers: string[] = ['Amazon', 'Google', 'GoodReads', 'Hardcover'];
|
||||||
|
|
||||||
|
refreshCovers: boolean = false;
|
||||||
|
mergeCategories: boolean = false;
|
||||||
|
|
||||||
|
allP1 = { placeholder: 'Set All', value: null as string | null };
|
||||||
|
allP2 = { placeholder: 'Set All', value: null as string | null };
|
||||||
|
allP3 = { placeholder: 'Set All', value: null as string | null };
|
||||||
|
allP4 = { placeholder: 'Set All', value: null as string | null };
|
||||||
|
|
||||||
|
fieldOptions: FieldOptions = this.initializeFieldOptions();
|
||||||
|
|
||||||
|
private messageService = inject(MessageService);
|
||||||
|
|
||||||
|
private initializeFieldOptions(): FieldOptions {
|
||||||
|
return this.fields.reduce((acc, field) => {
|
||||||
|
acc[field] = { p1: null, p2: null, p3: null, p4: null };
|
||||||
|
return acc;
|
||||||
|
}, {} as FieldOptions);
|
||||||
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
if (changes['currentMetadataOptions'] && this.currentMetadataOptions) {
|
if (changes['currentMetadataOptions'] && this.currentMetadataOptions) {
|
||||||
@@ -69,18 +58,19 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
|||||||
this.mergeCategories = this.currentMetadataOptions.mergeCategories || false;
|
this.mergeCategories = this.currentMetadataOptions.mergeCategories || false;
|
||||||
|
|
||||||
const backendFieldOptions = this.currentMetadataOptions.fieldOptions as FieldOptions || {};
|
const backendFieldOptions = this.currentMetadataOptions.fieldOptions as FieldOptions || {};
|
||||||
|
|
||||||
for (const field of this.fields) {
|
for (const field of this.fields) {
|
||||||
if (!backendFieldOptions[field]) {
|
if (!backendFieldOptions[field]) {
|
||||||
backendFieldOptions[field] = {p3: null, p2: null, p1: null};
|
backendFieldOptions[field] = { p1: null, p2: null, p3: null, p4: null };
|
||||||
|
} else {
|
||||||
|
backendFieldOptions[field].p4 ??= null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fieldOptions = backendFieldOptions;
|
this.fieldOptions = backendFieldOptions;
|
||||||
|
|
||||||
this.allP3.value = this.currentMetadataOptions.allP3 || null;
|
|
||||||
this.allP2.value = this.currentMetadataOptions.allP2 || null;
|
|
||||||
this.allP1.value = this.currentMetadataOptions.allP1 || null;
|
this.allP1.value = this.currentMetadataOptions.allP1 || null;
|
||||||
|
this.allP2.value = this.currentMetadataOptions.allP2 || null;
|
||||||
|
this.allP3.value = this.currentMetadataOptions.allP3 || null;
|
||||||
|
this.allP4.value = this.currentMetadataOptions.allP4 || null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,49 +81,47 @@ export class MetadataAdvancedFetchOptionsComponent implements OnChanges {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
const allP3Selected = Object.keys(this.fieldOptions).every(field => {
|
const allFieldsHaveProvider = Object.values(this.fieldOptions).every(opt =>
|
||||||
return this.fieldOptions[field as keyof FieldOptions].p3 !== null;
|
opt.p1 !== null || opt.p2 !== null || opt.p3 !== null || opt.p4 !== null
|
||||||
});
|
);
|
||||||
|
|
||||||
if (allP3Selected) {
|
if (allFieldsHaveProvider) {
|
||||||
const metadataRefreshOptions: MetadataRefreshOptions = {
|
const metadataRefreshOptions: MetadataRefreshOptions = {
|
||||||
allP1: this.allP1.value,
|
allP1: this.allP1.value,
|
||||||
allP2: this.allP2.value,
|
allP2: this.allP2.value,
|
||||||
allP3: this.allP3.value,
|
allP3: this.allP3.value,
|
||||||
|
allP4: this.allP4.value,
|
||||||
refreshCovers: this.refreshCovers,
|
refreshCovers: this.refreshCovers,
|
||||||
mergeCategories: this.mergeCategories,
|
mergeCategories: this.mergeCategories,
|
||||||
fieldOptions: this.fieldOptions
|
fieldOptions: this.fieldOptions
|
||||||
};
|
};
|
||||||
|
|
||||||
this.metadataOptionsSubmitted.emit(metadataRefreshOptions);
|
this.metadataOptionsSubmitted.emit(metadataRefreshOptions);
|
||||||
} else {
|
} else {
|
||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
summary: 'Error',
|
summary: 'Error',
|
||||||
life: 5000,
|
detail: 'At least one provider (P1–P4) must be selected for each book field.',
|
||||||
detail: 'At least one provider must be selected for all the book fields.'
|
life: 5000
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
reset() {
|
reset() {
|
||||||
this.allP3.value = null;
|
|
||||||
this.allP2.value = null;
|
|
||||||
this.allP1.value = null;
|
this.allP1.value = null;
|
||||||
|
this.allP2.value = null;
|
||||||
|
this.allP3.value = null;
|
||||||
|
this.allP4.value = null;
|
||||||
for (const field of Object.keys(this.fieldOptions)) {
|
for (const field of Object.keys(this.fieldOptions)) {
|
||||||
this.fieldOptions[field as keyof FieldOptions] = {
|
this.fieldOptions[field as keyof FieldOptions] = {
|
||||||
p3: null,
|
p1: null,
|
||||||
p2: null,
|
p2: null,
|
||||||
p1: null
|
p3: null,
|
||||||
|
p4: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
formatLabel(field: string): string {
|
formatLabel(field: string): string {
|
||||||
return field
|
return field.replace(/([A-Z])/g, ' $1').replace(/^./, str => str.toUpperCase()).trim();
|
||||||
.replace(/([A-Z])/g, ' $1')
|
|
||||||
.replace(/^./, str => str.toUpperCase())
|
|
||||||
.trim();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
export interface MetadataRefreshOptions {
|
export interface MetadataRefreshOptions {
|
||||||
|
allP4: string | null;
|
||||||
allP3: string | null;
|
allP3: string | null;
|
||||||
allP2: string | null;
|
allP2: string | null;
|
||||||
allP1: string | null;
|
allP1: string | null;
|
||||||
@@ -8,6 +9,7 @@ export interface MetadataRefreshOptions {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface FieldProvider {
|
export interface FieldProvider {
|
||||||
|
p4: string | null;
|
||||||
p3: string | null;
|
p3: string | null;
|
||||||
p2: string | null;
|
p2: string | null;
|
||||||
p1: string | null;
|
p1: string | null;
|
||||||
|
|||||||
@@ -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,11 +17,10 @@ import {AuthService} from '../../service/auth.service';
|
|||||||
Card,
|
Card,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
Message,
|
Message,
|
||||||
NgIf,
|
|
||||||
Password,
|
Password,
|
||||||
PrimeTemplate,
|
PrimeTemplate,
|
||||||
ReactiveFormsModule
|
ReactiveFormsModule
|
||||||
],
|
],
|
||||||
templateUrl: './change-password.component.html',
|
templateUrl: './change-password.component.html',
|
||||||
styleUrl: './change-password.component.scss'
|
styleUrl: './change-password.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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>
|
||||||
<p-divider></p-divider>
|
}
|
||||||
<p-button fluid severity="info" type="button" label="Login with OIDC" icon="pi pi-id-card" (click)="loginWithOidc()"></p-button>
|
@if (oidcEnabled) {
|
||||||
</div>
|
<div>
|
||||||
|
<p-divider></p-divider>
|
||||||
|
<p-button fluid severity="info" type="button" label="Login with OIDC" icon="pi pi-id-card" (click)="loginWithOidc()"></p-button>
|
||||||
|
</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,
|
||||||
@@ -28,7 +27,7 @@ import {filter, take} from 'rxjs/operators';
|
|||||||
PrimeTemplate,
|
PrimeTemplate,
|
||||||
InputText,
|
InputText,
|
||||||
Divider
|
Divider
|
||||||
],
|
],
|
||||||
templateUrl: './login.component.html',
|
templateUrl: './login.component.html',
|
||||||
styleUrls: ['./login.component.scss']
|
styleUrls: ['./login.component.scss']
|
||||||
})
|
})
|
||||||
|
|||||||
+63
-58
@@ -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()) {
|
||||||
(Fill all required fields to enable)
|
<div class="text-sm text-gray-400">
|
||||||
</div>
|
(Fill all required fields to enable)
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class=" pt-8">OIDC Provider Settings:</p>
|
<p class=" pt-8">OIDC Provider Settings:</p>
|
||||||
@@ -137,64 +139,67 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="oidcEnabled">
|
@if (oidcEnabled) {
|
||||||
<p class=" pt-6">OIDC User Provisioning:</p>
|
<div>
|
||||||
<div class="pl-6 space-y-6 p-4 m-4 custom-border">
|
<p class=" pt-6">OIDC User Provisioning:</p>
|
||||||
<div>
|
<div class="pl-6 space-y-6 p-4 m-4 custom-border">
|
||||||
<p class="text-lg pb-3">Automatic user provisioning:</p>
|
<div>
|
||||||
<div class="flex items-center gap-4 pl-6">
|
<p class="text-lg pb-3">Automatic user provisioning:</p>
|
||||||
<label class="">Enabled</label>
|
<div class="flex items-center gap-4 pl-6">
|
||||||
<p-toggleswitch
|
<label class="">Enabled</label>
|
||||||
[(ngModel)]="autoUserProvisioningEnabled"
|
<p-toggleswitch
|
||||||
inputId="autoProvision"
|
[(ngModel)]="autoUserProvisioningEnabled"
|
||||||
(onChange)="saveAutoProvision()">
|
inputId="autoProvision"
|
||||||
</p-toggleswitch>
|
(onChange)="saveAutoProvision()">
|
||||||
<div class="flex items-center gap-2 text-sm text-gray-400">
|
</p-toggleswitch>
|
||||||
<i class="pi pi-info-circle text-blue-500"></i>
|
<div class="flex items-center gap-2 text-sm text-gray-400">
|
||||||
<span>
|
<i class="pi pi-info-circle text-blue-500"></i>
|
||||||
Enabling auto-provisioning ensures that new users are automatically created with the selected default permissions. If turned off, users must be manually created in Booklore before they can log in.
|
<span>
|
||||||
</span>
|
Enabling auto-provisioning ensures that new users are automatically created with the selected default permissions. If turned off, users must be manually created in Booklore before they can log in.
|
||||||
</div>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="autoUserProvisioningEnabled">
|
|
||||||
<p class=" pt-8">Default permissions for auto-provisioned users:</p>
|
|
||||||
<div class="flex items-center gap-2 pl-6 pt-2">
|
|
||||||
<p-checkbox
|
|
||||||
[binary]="true"
|
|
||||||
[disabled]="true"
|
|
||||||
[ngModel]="true"
|
|
||||||
inputId="permissionRead">
|
|
||||||
</p-checkbox>
|
|
||||||
<label class="text-sm">Read Books</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngFor="let perm of availablePermissions" class="flex items-center gap-2 pl-6">
|
|
||||||
<p-checkbox
|
|
||||||
[(ngModel)]="perm.selected"
|
|
||||||
[binary]="true"
|
|
||||||
[inputId]="perm.value">
|
|
||||||
</p-checkbox>
|
|
||||||
<label [for]="perm.value" class="text-sm">{{ perm.label }}</label>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class=" pb-3 pt-6">Default libraries for auto-provisioned users:</p>
|
|
||||||
<div class="pl-6">
|
|
||||||
<p-multiSelect
|
|
||||||
[options]="allLibraries"
|
|
||||||
optionLabel="name"
|
|
||||||
optionValue="id"
|
|
||||||
[(ngModel)]="editingLibraryIds"
|
|
||||||
placeholder="Select Libraries"
|
|
||||||
appendTo="body">
|
|
||||||
</p-multiSelect>
|
|
||||||
</div>
|
|
||||||
<div class="mt-8">
|
|
||||||
<p-button label="Save Settings" [outlined]="true" (click)="saveAutoProvisioningSettings()"></p-button>
|
|
||||||
</div>
|
</div>
|
||||||
|
@if (autoUserProvisioningEnabled) {
|
||||||
|
<div>
|
||||||
|
<p class=" pt-8">Default permissions for auto-provisioned users:</p>
|
||||||
|
<div class="flex items-center gap-2 pl-6 pt-2">
|
||||||
|
<p-checkbox
|
||||||
|
[binary]="true"
|
||||||
|
[disabled]="true"
|
||||||
|
[ngModel]="true"
|
||||||
|
inputId="permissionRead">
|
||||||
|
</p-checkbox>
|
||||||
|
<label class="text-sm">Read Books</label>
|
||||||
|
</div>
|
||||||
|
@for (perm of availablePermissions; track perm) {
|
||||||
|
<div class="flex items-center gap-2 pl-6">
|
||||||
|
<p-checkbox
|
||||||
|
[(ngModel)]="perm.selected"
|
||||||
|
[binary]="true"
|
||||||
|
[inputId]="perm.value">
|
||||||
|
</p-checkbox>
|
||||||
|
<label [for]="perm.value" class="text-sm">{{ perm.label }}</label>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<p class=" pb-3 pt-6">Default libraries for auto-provisioned users:</p>
|
||||||
|
<div class="pl-6">
|
||||||
|
<p-multiSelect
|
||||||
|
[options]="allLibraries"
|
||||||
|
optionLabel="name"
|
||||||
|
optionValue="id"
|
||||||
|
[(ngModel)]="editingLibraryIds"
|
||||||
|
placeholder="Select Libraries"
|
||||||
|
appendTo="body">
|
||||||
|
</p-multiSelect>
|
||||||
|
</div>
|
||||||
|
<div class="mt-8">
|
||||||
|
<p-button label="Save Settings" [outlined]="true" (click)="saveAutoProvisioningSettings()"></p-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-4
@@ -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,15 +24,13 @@ import {LibraryService} from '../../../book/service/library.service';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
InputText,
|
InputText,
|
||||||
DropdownModule,
|
DropdownModule,
|
||||||
NgIf,
|
|
||||||
NgForOf,
|
|
||||||
Checkbox,
|
Checkbox,
|
||||||
ToggleSwitch,
|
ToggleSwitch,
|
||||||
Divider,
|
Divider,
|
||||||
Button,
|
Button,
|
||||||
MultiSelect,
|
MultiSelect,
|
||||||
ReactiveFormsModule
|
ReactiveFormsModule
|
||||||
],
|
],
|
||||||
styleUrls: ['./authentication-settings.component.scss']
|
styleUrls: ['./authentication-settings.component.scss']
|
||||||
})
|
})
|
||||||
export class AuthenticationSettingsComponent implements OnInit {
|
export class AuthenticationSettingsComponent implements OnInit {
|
||||||
|
|||||||
@@ -11,43 +11,55 @@
|
|||||||
<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) {
|
||||||
Username is required.
|
<small class="text-red-500">
|
||||||
</small>
|
Username is required.
|
||||||
|
</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) {
|
||||||
Name is required.
|
<small class="text-red-500">
|
||||||
</small>
|
Name is required.
|
||||||
|
</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) {
|
||||||
Valid email is required.
|
<small class="text-red-500">
|
||||||
</small>
|
Valid email is required.
|
||||||
|
</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) {
|
||||||
Minimum 6 characters required.
|
<small class="text-red-500">
|
||||||
</small>
|
Minimum 6 characters required.
|
||||||
|
</small>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-3 mt-4">
|
<div class="flex flex-col gap-3 mt-4">
|
||||||
<p-button fluid severity="success" type="submit"
|
<p-button fluid severity="success" type="submit"
|
||||||
[label]="loading ? 'Creating…' : 'Create Admin Account'"
|
[label]="loading ? 'Creating…' : 'Create Admin Account'"
|
||||||
[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,14 +18,13 @@ import { Message } from 'primeng/message';
|
|||||||
standalone: true,
|
standalone: true,
|
||||||
imports: [
|
imports: [
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
NgIf,
|
|
||||||
Card,
|
Card,
|
||||||
PrimeTemplate,
|
PrimeTemplate,
|
||||||
InputText,
|
InputText,
|
||||||
Password,
|
Password,
|
||||||
Button,
|
Button,
|
||||||
Message
|
Message
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class SetupComponent {
|
export class SetupComponent {
|
||||||
setupForm: FormGroup;
|
setupForm: FormGroup;
|
||||||
|
|||||||
+25
-20
@@ -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) {
|
||||||
<p class="text-sm">
|
<div class="dashboard-scroller-no-books">
|
||||||
{{ bookListType === 'lastRead' ? "You haven't read any books yet!" : "No books have been added to BookLore!" }}
|
<p class="text-sm">
|
||||||
</p>
|
{{ bookListType === 'lastRead' ? "You haven't read any books yet!" : "No books have been added to BookLore!" }}
|
||||||
</div>
|
</p>
|
||||||
|
|
||||||
<div class="dashboard-scroller-infinite"
|
|
||||||
*ngIf="books"
|
|
||||||
infiniteScroll
|
|
||||||
[infiniteScrollDistance]="2"
|
|
||||||
[infiniteScrollThrottle]="50"
|
|
||||||
#scrollContainer
|
|
||||||
[horizontal]="true">
|
|
||||||
|
|
||||||
<div class="dashboard-scroller-card" *ngFor="let book of books">
|
|
||||||
<app-book-card [book]="book" [isCheckboxEnabled]="false"></app-book-card>
|
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
</div>
|
@if (books) {
|
||||||
|
<div class="dashboard-scroller-infinite"
|
||||||
|
infiniteScroll
|
||||||
|
[infiniteScrollDistance]="2"
|
||||||
|
[infiniteScrollThrottle]="50"
|
||||||
|
#scrollContainer
|
||||||
|
[horizontal]="true">
|
||||||
|
@for (book of books; track book) {
|
||||||
|
<div class="dashboard-scroller-card">
|
||||||
|
<app-book-card [book]="book" [isCheckboxEnabled]="false"></app-book-card>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
<div *ngIf=" books === null">
|
@if ( books === null) {
|
||||||
<p class="text-sm">Failed to load books! :(</p>
|
<div>
|
||||||
</div>
|
<p class="text-sm">Failed to load books! :(</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
+2
-4
@@ -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,11 +11,9 @@ 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
|
||||||
],
|
],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
export class DashboardScrollerComponent {
|
export class DashboardScrollerComponent {
|
||||||
|
|||||||
+45
-41
@@ -1,46 +1,50 @@
|
|||||||
<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>
|
||||||
<div>
|
}
|
||||||
<div class="dashboard-no-library" *ngIf="isLibrariesEmpty$ | async; else dashboardScroller">
|
@if ((bookState$ | async)?.loaded === true) {
|
||||||
<div *ngIf="(userService.userState$ | async)?.permissions as permissions">
|
<div class="dashboard">
|
||||||
<div *ngIf="permissions.admin || permissions.canManipulateLibrary">
|
<div>
|
||||||
<h1 class="no-library-header">Looks like you haven't added a library yet. Let's add one!</h1>
|
@if (isLibrariesEmpty$ | async) {
|
||||||
<p-button
|
<div class="dashboard-no-library">
|
||||||
label="Add a Library"
|
@if ((userService.userState$ | async)?.permissions; as permissions) {
|
||||||
icon="pi pi-plus"
|
<div>
|
||||||
styleClass="p-button-rounded p-button-outlined"
|
@if (permissions.admin || permissions.canManipulateLibrary) {
|
||||||
(click)="createNewLibrary()">
|
<div>
|
||||||
</p-button>
|
<h1 class="no-library-header">Looks like you haven't added a library yet. Let's add one!</h1>
|
||||||
|
<p-button
|
||||||
|
label="Add a Library"
|
||||||
|
icon="pi pi-plus"
|
||||||
|
styleClass="p-button-rounded p-button-outlined"
|
||||||
|
(click)="createNewLibrary()">
|
||||||
|
</p-button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
} @else {
|
||||||
|
<app-dashboard-scroller
|
||||||
|
[books]="lastReadBooks$ | async"
|
||||||
|
[bookListType]="'lastRead'"
|
||||||
|
[title]="'Last Read Books'">
|
||||||
|
</app-dashboard-scroller>
|
||||||
|
<div class="mb-6">
|
||||||
|
<p-divider></p-divider>
|
||||||
|
</div>
|
||||||
|
<app-dashboard-scroller
|
||||||
|
[books]="latestAddedBooks$ | async"
|
||||||
|
[title]="'Latest Added Books'">
|
||||||
|
</app-dashboard-scroller>
|
||||||
|
<div class="mb-6">
|
||||||
|
<p-divider></p-divider>
|
||||||
|
</div>
|
||||||
|
<app-dashboard-scroller
|
||||||
|
[books]="randomBooks$ | async"
|
||||||
|
[title]="'Discover Random Reads'">
|
||||||
|
</app-dashboard-scroller>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ng-template #dashboardScroller>
|
|
||||||
<app-dashboard-scroller
|
|
||||||
[books]="lastReadBooks$ | async"
|
|
||||||
[bookListType]="'lastRead'"
|
|
||||||
[title]="'Last Read Books'">
|
|
||||||
</app-dashboard-scroller>
|
|
||||||
|
|
||||||
<div class="mb-6">
|
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<app-dashboard-scroller
|
|
||||||
[books]="latestAddedBooks$ | async"
|
|
||||||
[title]="'Latest Added Books'">
|
|
||||||
</app-dashboard-scroller>
|
|
||||||
|
|
||||||
<div class="mb-6">
|
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<app-dashboard-scroller
|
|
||||||
[books]="randomBooks$ | async"
|
|
||||||
[title]="'Discover Random Reads'">
|
|
||||||
</app-dashboard-scroller>
|
|
||||||
</ng-template>
|
|
||||||
</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,12 +20,11 @@ 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,
|
||||||
ProgressSpinner
|
ProgressSpinner
|
||||||
],
|
],
|
||||||
providers: [DialogService],
|
providers: [DialogService],
|
||||||
standalone: true
|
standalone: true
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -36,18 +48,20 @@
|
|||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
class="hover:underline hover:text-gray-100 text-sm"
|
class="hover:underline hover:text-gray-100 text-sm"
|
||||||
>
|
>
|
||||||
{{ versionInfo.current }}
|
{{ versionInfo.current }}
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="versionInfo.latest && versionInfo.latest !== versionInfo.current">
|
@if (versionInfo.latest && versionInfo.latest !== versionInfo.current) {
|
||||||
<a
|
<div>
|
||||||
(click)="openChangelogDialog()"
|
<a
|
||||||
class="cursor-pointer text-orange-400 hover:underline hover:text-orange-300 text-xs"
|
(click)="openChangelogDialog()"
|
||||||
>
|
class="cursor-pointer text-orange-400 hover:underline hover:text-orange-300 text-xs"
|
||||||
(Update)
|
>
|
||||||
</a>
|
(Update)
|
||||||
</div>
|
</a>
|
||||||
|
</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,62 +1,76 @@
|
|||||||
<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) {
|
||||||
(click)="itemClick($event)"
|
<a [attr.href]="item.url"
|
||||||
[ngClass]="item.class" [attr.target]="item.target" tabindex="0" pRipple>
|
(click)="itemClick($event)"
|
||||||
<i [ngClass]="item.icon" class="layout-menuitem-icon"></i>
|
[ngClass]="item.class" [attr.target]="item.target" tabindex="0" pRipple>
|
||||||
<span class="layout-menuitem-text">
|
|
||||||
{{ item.label }}
|
|
||||||
</span>
|
|
||||||
<i class="pi pi-fw pi-angle-down layout-submenu-toggler" *ngIf="item.items"></i>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class="flex flex-row items-center justify-between">
|
|
||||||
<a *ngIf="(item.routerLink && !item.items) && item.visible !== false" (click)="itemClick($event)"
|
|
||||||
[ngClass]="item.class"
|
|
||||||
[routerLink]="item.routerLink" routerLinkActive="active-route"
|
|
||||||
[routerLinkActiveOptions]="item.routerLinkActiveOptions || { paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
|
|
||||||
[fragment]="item.fragment" [queryParamsHandling]="item.queryParamsHandling"
|
|
||||||
[preserveFragment]="item.preserveFragment"
|
|
||||||
[skipLocationChange]="item.skipLocationChange" [replaceUrl]="item.replaceUrl" [state]="item.state"
|
|
||||||
[queryParams]="item.queryParams"
|
|
||||||
[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 w-full">
|
<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>
|
||||||
<span *ngIf="(item.routerLink && !item.items) && item.visible !== false">
|
}
|
||||||
<ng-container *ngIf="item.type === 'Library' || item.type === 'Shelf'">
|
|
||||||
<p-button
|
|
||||||
*ngIf="(item.type !== 'Library' || (admin || canManipulateLibrary)) && item.label !== 'Unshelved'"
|
|
||||||
(click)="entitymenu.toggle($event)"
|
|
||||||
(mouseover)="hovered = true"
|
|
||||||
(mouseleave)="hovered = false"
|
|
||||||
[text]="true"
|
|
||||||
[outlined]="false"
|
|
||||||
[rounded]="true"
|
|
||||||
[label]="hovered ? '' : (item.bookCount$ | async)?.toString() || ''"
|
|
||||||
[icon]="hovered ? 'pi pi-ellipsis-v' : ''"
|
|
||||||
[style.width]="'30px'"
|
|
||||||
[style.height]="'30px'"
|
|
||||||
[style.display]="'flex'">
|
|
||||||
</p-button>
|
|
||||||
<p-menu #entitymenu [model]="item.menu" [popup]="true" appendTo="body"></p-menu>
|
|
||||||
</ng-container>
|
|
||||||
|
|
||||||
<ng-container *ngIf="item.type === 'Library' && (!admin && !canManipulateLibrary) || item.type === 'All Books' || item.label === 'Unshelved'">
|
<div class="flex flex-row items-center justify-between">
|
||||||
<p class="text-[var(--primary-color)] pr-1">
|
@if ((item.routerLink && !item.items) && item.visible !== false) {
|
||||||
{{ (item.bookCount$ | async)?.toString() || '0' }}
|
<a (click)="itemClick($event)"
|
||||||
</p>
|
[ngClass]="item.class"
|
||||||
</ng-container>
|
[routerLink]="item.routerLink" routerLinkActive="active-route"
|
||||||
</span>
|
[routerLinkActiveOptions]="item.routerLinkActiveOptions || { paths: 'exact', queryParams: 'ignored', matrixParams: 'ignored', fragment: 'ignored' }"
|
||||||
|
[fragment]="item.fragment" [queryParamsHandling]="item.queryParamsHandling"
|
||||||
|
[preserveFragment]="item.preserveFragment"
|
||||||
|
[skipLocationChange]="item.skipLocationChange" [replaceUrl]="item.replaceUrl" [state]="item.state"
|
||||||
|
[queryParams]="item.queryParams"
|
||||||
|
[attr.target]="item.target" tabindex="0" pRipple>
|
||||||
|
<i [ngClass]="item.icon" class="layout-menuitem-icon"></i>
|
||||||
|
<span class="layout-menuitem-text w-full">
|
||||||
|
{{ item.label }}
|
||||||
|
</span>
|
||||||
|
@if (item.items) {
|
||||||
|
<i class="pi pi-fw pi-angle-down layout-submenu-toggler"></i>
|
||||||
|
}
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
@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
|
||||||
|
(click)="entitymenu.toggle($event)"
|
||||||
|
(mouseover)="hovered = true"
|
||||||
|
(mouseleave)="hovered = false"
|
||||||
|
[text]="true"
|
||||||
|
[outlined]="false"
|
||||||
|
[rounded]="true"
|
||||||
|
[label]="hovered ? '' : (item.bookCount$ | async)?.toString() || ''"
|
||||||
|
[icon]="hovered ? 'pi pi-ellipsis-v' : ''"
|
||||||
|
[style.width]="'30px'"
|
||||||
|
[style.height]="'30px'"
|
||||||
|
[style.display]="'flex'">
|
||||||
|
</p-button>
|
||||||
|
}
|
||||||
|
<p-menu #entitymenu [model]="item.menu" [popup]="true" appendTo="body"></p-menu>
|
||||||
|
}
|
||||||
|
@if (item.type === 'Library' && (!admin && !canManipulateLibrary) || item.type === 'All Books' || item.label === 'Unshelved') {
|
||||||
|
<p class="text-[var(--primary-color)] pr-1">
|
||||||
|
{{ (item.bookCount$ | async)?.toString() || '0' }}
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
</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">
|
||||||
<li app-menuitem [item]="child" [index]="i" [parentKey]="key" [class]="child.badgeClass"></li>
|
@for (child of item.items; track child; let i = $index) {
|
||||||
</ng-template>
|
<li app-menuitem [item]="child" [index]="i" [parentKey]="key" [class]="child.badgeClass"></li>
|
||||||
</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,13 +19,11 @@ import {UserService} from '../../../settings/user-management/user.service';
|
|||||||
RouterLink,
|
RouterLink,
|
||||||
RouterLinkActive,
|
RouterLinkActive,
|
||||||
NgClass,
|
NgClass,
|
||||||
NgForOf,
|
|
||||||
Ripple,
|
Ripple,
|
||||||
NgIf,
|
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
Button,
|
Button,
|
||||||
Menu
|
Menu
|
||||||
],
|
],
|
||||||
animations: [
|
animations: [
|
||||||
trigger('children', [
|
trigger('children', [
|
||||||
state('collapsed', style({
|
state('collapsed', style({
|
||||||
|
|||||||
+25
-17
@@ -1,18 +1,26 @@
|
|||||||
<div *ngIf="loading" class="p-4 text-center text-gray-400">
|
@if (loading) {
|
||||||
Loading changelog...
|
<div class="p-4 text-center text-gray-400">
|
||||||
</div>
|
Loading changelog...
|
||||||
|
|
||||||
<div *ngIf="!loading && changelog.length === 0" class="p-4 text-center text-gray-400">
|
|
||||||
No updates available.
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="!loading && changelog.length > 0" class="space-y-6 p-4 max-h-[70vh] overflow-auto">
|
|
||||||
<div *ngFor="let release of changelog" class="border-b pb-4">
|
|
||||||
<p class="font-bold text-2xl pb-2">
|
|
||||||
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:underline">
|
|
||||||
{{ release.name }}
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
|
|
||||||
|
@if (!loading && changelog.length === 0) {
|
||||||
|
<div class="p-4 text-center text-gray-400">
|
||||||
|
No updates available.
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
@if (!loading && changelog.length > 0) {
|
||||||
|
<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">
|
||||||
|
<a [href]="release.url" target="_blank" rel="noopener noreferrer" class="text-blue-400 hover:underline">
|
||||||
|
{{ release.name }}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<div [innerHTML]="markdownToHtml(release.changelog)" class="prose prose-invert w-full max-w-full"></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'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -14,29 +14,37 @@
|
|||||||
[outlined]="true"
|
[outlined]="true"
|
||||||
(click)="toggleMenu()"
|
(click)="toggleMenu()"
|
||||||
[ngClass]="{ 'rotate-right': !isMenuVisible, 'rotate-left': isMenuVisible }"
|
[ngClass]="{ 'rotate-right': !isMenuVisible, 'rotate-left': isMenuVisible }"
|
||||||
>
|
>
|
||||||
</p-button>
|
</p-button>
|
||||||
|
|
||||||
<div class="topbar-right-items">
|
<div class="topbar-right-items">
|
||||||
<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>
|
||||||
<i class="pi pi-plus-circle text-surface-700 dark:text-surface-100" (click)="openLibraryCreatorDialog()"
|
@if (userData.permissions.canManipulateLibrary || userData.permissions.admin) {
|
||||||
pTooltip="Create New Library" tooltipPosition="top"></i>
|
<a class="topbar-item">
|
||||||
</a>
|
<i class="pi pi-plus-circle text-surface-700 dark:text-surface-100" (click)="openLibraryCreatorDialog()"
|
||||||
</li>
|
pTooltip="Create New Library" tooltipPosition="top"></i>
|
||||||
<li *ngIf="userService.userState$ | async as userData">
|
</a>
|
||||||
<a class="topbar-item" *ngIf="userData.permissions.canManipulateLibrary || userData.permissions.admin">
|
}
|
||||||
<i class="pi pi-upload text-surface-700 dark:text-surface-100" (click)="openFileUploadDialog()"
|
</li>
|
||||||
pTooltip="Upload Book" tooltipPosition="top"></i>
|
}
|
||||||
</a>
|
@if (userService.userState$ | async; as userData) {
|
||||||
</li>
|
<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()"
|
||||||
|
pTooltip="Upload Book" tooltipPosition="top"></i>
|
||||||
|
</a>
|
||||||
|
}
|
||||||
|
</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()"
|
||||||
pTooltip="Settings" tooltipPosition="top"></i>
|
pTooltip="Settings" tooltipPosition="top"></i>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</div>
|
</div>
|
||||||
@@ -44,15 +52,17 @@
|
|||||||
<p-divider layout="vertical"/>
|
<p-divider layout="vertical"/>
|
||||||
<li class="relative" (mouseenter)="onHover(true)" (mouseleave)="onHover(false)">
|
<li class="relative" (mouseenter)="onHover(true)" (mouseleave)="onHover(false)">
|
||||||
<button type="button" class="topbar-item"
|
<button type="button" class="topbar-item"
|
||||||
enterActiveClass="animate-scalein"
|
enterActiveClass="animate-scalein"
|
||||||
enterFromClass="hidden"
|
enterFromClass="hidden"
|
||||||
leaveActiveClass="animate-fadeout"
|
leaveActiveClass="animate-fadeout"
|
||||||
leaveToClass="hidden"
|
leaveToClass="hidden"
|
||||||
pStyleClass="@next"
|
pStyleClass="@next"
|
||||||
[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"/>
|
||||||
@@ -68,12 +78,12 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="relative">
|
<li class="relative">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="topbar-item config-item"
|
class="topbar-item config-item"
|
||||||
enterActiveClass="animate-scalein"
|
enterActiveClass="animate-scalein"
|
||||||
enterFromClass="hidden"
|
enterFromClass="hidden"
|
||||||
leaveActiveClass="animate-fadeout"
|
leaveActiveClass="animate-fadeout"
|
||||||
leaveToClass="hidden"
|
leaveToClass="hidden"
|
||||||
pStyleClass="@next" [hideOnOutsideClick]="true">
|
pStyleClass="@next" [hideOnOutsideClick]="true">
|
||||||
<i class="pi pi-palette"></i>
|
<i class="pi pi-palette"></i>
|
||||||
</button>
|
</button>
|
||||||
<app-theme-configurator></app-theme-configurator>
|
<app-theme-configurator></app-theme-configurator>
|
||||||
|
|||||||
@@ -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,9 +37,8 @@ import {GithubSupportDialog} from '../../../github-support-dialog/github-support
|
|||||||
NgClass,
|
NgClass,
|
||||||
Divider,
|
Divider,
|
||||||
LiveNotificationBoxComponent,
|
LiveNotificationBoxComponent,
|
||||||
NgIf,
|
|
||||||
AsyncPipe
|
AsyncPipe
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
export class AppTopBarComponent implements OnDestroy {
|
export class AppTopBarComponent implements OnDestroy {
|
||||||
items!: MenuItem[];
|
items!: MenuItem[];
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import {CommonModule, isPlatformBrowser} from '@angular/common';
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
||||||
import {Component, computed, inject, OnInit, PLATFORM_ID} from '@angular/core';
|
import {Component, computed, inject, OnInit, PLATFORM_ID} from '@angular/core';
|
||||||
import {FormsModule} from '@angular/forms';
|
import {FormsModule} from '@angular/forms';
|
||||||
import {$t, updatePreset, updateSurfacePalette} from '@primeng/themes';
|
import {$t, updatePreset, updateSurfacePalette} from '@primeng/themes';
|
||||||
|
|||||||
+15
-9
@@ -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)) {
|
||||||
Provider name is required.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Provider name is required.
|
||||||
|
</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)) {
|
||||||
Host is required.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Host is required.
|
||||||
|
</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)) {
|
||||||
Port is required and must be a number.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Port is required and must be a number.
|
||||||
|
</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>
|
||||||
|
|||||||
+2
-3
@@ -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,9 +14,8 @@ 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',
|
||||||
styleUrl: './create-email-provider-dialog.component.scss'
|
styleUrl: './create-email-provider-dialog.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
+10
-6
@@ -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)) {
|
||||||
Recipient name is required.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Recipient name is required.
|
||||||
|
</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)) {
|
||||||
Valid email is required.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Valid email is required.
|
||||||
|
</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>
|
||||||
|
|||||||
+3
-4
@@ -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,9 +14,8 @@ 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']
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<h2 class="text-lg flex items-center gap-2">
|
<h2 class="text-lg flex items-center gap-2">
|
||||||
Email Providers
|
Email Providers
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="Configure email-sending services like Gmail, Outlook, or custom SMTP servers for sending books via email. The default email provider will be used for 'Quick Book Send' located in the Book Card menu"
|
pTooltip="Configure email-sending services like Gmail, Outlook, or custom SMTP servers for sending books via email. The default email provider will be used for 'Quick Book Send' located in the Book Card menu"
|
||||||
tooltipPosition="right"
|
tooltipPosition="right"
|
||||||
style="cursor: pointer;"></i>
|
style="cursor: pointer;"></i>
|
||||||
</h2>
|
</h2>
|
||||||
<p-button outlined="true" icon="pi pi-plus" label="Create New Provider" (onClick)="openCreateProviderDialog()"></p-button>
|
<p-button outlined="true" icon="pi pi-plus" label="Create New Provider" (onClick)="openCreateProviderDialog()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -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,14 +17,13 @@ import {CreateEmailProviderDialogComponent} from '../create-email-provider-dialo
|
|||||||
imports: [
|
imports: [
|
||||||
Button,
|
Button,
|
||||||
Checkbox,
|
Checkbox,
|
||||||
NgIf,
|
|
||||||
PrimeTemplate,
|
PrimeTemplate,
|
||||||
RadioButton,
|
RadioButton,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
TableModule,
|
TableModule,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
FormsModule
|
FormsModule
|
||||||
],
|
],
|
||||||
templateUrl: './email-provider.component.html',
|
templateUrl: './email-provider.component.html',
|
||||||
styleUrl: './email-provider.component.scss'
|
styleUrl: './email-provider.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
<h2 class="text-lg flex items-center gap-2">
|
<h2 class="text-lg flex items-center gap-2">
|
||||||
Recipient Emails
|
Recipient Emails
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="Manage the list of recipients who will receive books via email. The 'Default' recipient will be used for 'Quick Book Send,' located in the Book Card menu."
|
pTooltip="Manage the list of recipients who will receive books via email. The 'Default' recipient will be used for 'Quick Book Send,' located in the Book Card menu."
|
||||||
tooltipPosition="right"
|
tooltipPosition="right"
|
||||||
style="cursor: pointer;"></i>
|
style="cursor: pointer;"></i>
|
||||||
</h2>
|
</h2>
|
||||||
<p-button outlined="true" icon="pi pi-plus" label="Add New Recipient" (onClick)="openAddRecipientDialog()"></p-button>
|
<p-button outlined="true" icon="pi pi-plus" label="Add New Recipient" (onClick)="openAddRecipientDialog()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -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,14 +18,13 @@ 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,
|
||||||
TableModule,
|
TableModule,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
FormsModule
|
FormsModule
|
||||||
],
|
],
|
||||||
templateUrl: './email-recipient.component.html',
|
templateUrl: './email-recipient.component.html',
|
||||||
styleUrl: './email-recipient.component.scss'
|
styleUrl: './email-recipient.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -137,14 +137,6 @@
|
|||||||
<p-divider></p-divider>
|
<p-divider></p-divider>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="p-4">
|
|
||||||
<app-metadata-provider-settings></app-metadata-provider-settings>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pt-2 pb-4">
|
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
<app-opds-settings></app-opds-settings>
|
<app-opds-settings></app-opds-settings>
|
||||||
</div>
|
</div>
|
||||||
@@ -157,24 +149,4 @@
|
|||||||
<app-file-upload-pattern></app-file-upload-pattern>
|
<app-file-upload-pattern></app-file-upload-pattern>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pt-2 pb-4">
|
|
||||||
<p-divider></p-divider>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="p-4">
|
|
||||||
<p class="text-lg ">
|
|
||||||
Quick Book Match Preferences
|
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
|
||||||
pTooltip="Choose how metadata fields (title, description, authors, categories, cover) are retrieved by setting priority providers. You can apply the same provider settings to all fields or customize them individually. Enable ‘Refresh Covers’ to update book covers, and ‘Merge Categories’ to consolidate categories/genres from all sources while preserving the existing categories/genres in the book."
|
|
||||||
tooltipPosition="right"
|
|
||||||
style="cursor: pointer;">
|
|
||||||
</i>
|
|
||||||
</p>
|
|
||||||
<app-metadata-advanced-fetch-options
|
|
||||||
(metadataOptionsSubmitted)="onMetadataSubmit($event)"
|
|
||||||
[currentMetadataOptions]="currentMetadataOptions"
|
|
||||||
[submitButtonLabel]="'Save'">
|
|
||||||
</app-metadata-advanced-fetch-options>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,13 +13,10 @@ import {MessageService} from 'primeng/api';
|
|||||||
import {AppSettingsService} from '../../core/service/app-settings.service';
|
import {AppSettingsService} from '../../core/service/app-settings.service';
|
||||||
import {BookService} from '../../book/service/book.service';
|
import {BookService} from '../../book/service/book.service';
|
||||||
import {AppSettingKey, AppSettings} from '../../core/model/app-settings.model';
|
import {AppSettingKey, AppSettings} from '../../core/model/app-settings.model';
|
||||||
import {MetadataRefreshOptions} from '../../book/metadata/model/request/metadata-refresh-options.model';
|
|
||||||
import {MetadataAdvancedFetchOptionsComponent} from '../../book/metadata/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component';
|
|
||||||
import {filter, take} from 'rxjs/operators';
|
import {filter, take} from 'rxjs/operators';
|
||||||
import {FileUploadPatternComponent} from './file-upload-pattern/file-upload-pattern.component';
|
import {FileUploadPatternComponent} from './file-upload-pattern/file-upload-pattern.component';
|
||||||
import {OpdsSettingsComponent} from './opds-settings/opds-settings.component';
|
import {OpdsSettingsComponent} from './opds-settings/opds-settings.component';
|
||||||
import {InputText} from 'primeng/inputtext';
|
import {InputText} from 'primeng/inputtext';
|
||||||
import {MetadataProviderSettingsComponent} from './metadata-provider-settings/metadata-provider-settings.component';
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-global-preferences',
|
selector: 'app-global-preferences',
|
||||||
@@ -32,11 +29,9 @@ import {MetadataProviderSettingsComponent} from './metadata-provider-settings/me
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
ToggleSwitch,
|
ToggleSwitch,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
MetadataAdvancedFetchOptionsComponent,
|
|
||||||
FileUploadPatternComponent,
|
FileUploadPatternComponent,
|
||||||
OpdsSettingsComponent,
|
OpdsSettingsComponent,
|
||||||
InputText,
|
InputText
|
||||||
MetadataProviderSettingsComponent
|
|
||||||
],
|
],
|
||||||
templateUrl: './global-preferences.component.html',
|
templateUrl: './global-preferences.component.html',
|
||||||
styleUrl: './global-preferences.component.scss'
|
styleUrl: './global-preferences.component.scss'
|
||||||
@@ -56,8 +51,6 @@ export class GlobalPreferencesComponent implements OnInit {
|
|||||||
similarBookRecommendation: false,
|
similarBookRecommendation: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
currentMetadataOptions!: MetadataRefreshOptions;
|
|
||||||
|
|
||||||
private appSettingsService = inject(AppSettingsService);
|
private appSettingsService = inject(AppSettingsService);
|
||||||
private bookService = inject(BookService);
|
private bookService = inject(BookService);
|
||||||
private messageService = inject(MessageService);
|
private messageService = inject(MessageService);
|
||||||
@@ -74,9 +67,6 @@ export class GlobalPreferencesComponent implements OnInit {
|
|||||||
if (settings?.coverResolution) {
|
if (settings?.coverResolution) {
|
||||||
this.selectedResolution = settings.coverResolution;
|
this.selectedResolution = settings.coverResolution;
|
||||||
}
|
}
|
||||||
if (settings?.metadataRefreshOptions) {
|
|
||||||
this.currentMetadataOptions = settings.metadataRefreshOptions;
|
|
||||||
}
|
|
||||||
if (settings?.cbxCacheSizeInMb) {
|
if (settings?.cbxCacheSizeInMb) {
|
||||||
this.cbxCacheValue = settings.cbxCacheSizeInMb;
|
this.cbxCacheValue = settings.cbxCacheSizeInMb;
|
||||||
}
|
}
|
||||||
@@ -106,10 +96,6 @@ export class GlobalPreferencesComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMetadataSubmit(metadataRefreshOptions: MetadataRefreshOptions): void {
|
|
||||||
this.saveSetting(AppSettingKey.QUICK_BOOK_MATCH, metadataRefreshOptions);
|
|
||||||
}
|
|
||||||
|
|
||||||
saveCacheSize(): void {
|
saveCacheSize(): void {
|
||||||
if (!this.cbxCacheValue || this.cbxCacheValue <= 0) {
|
if (!this.cbxCacheValue || this.cbxCacheValue <= 0) {
|
||||||
this.showMessage('error', 'Invalid Input', 'Please enter a valid cache size in MB.');
|
this.showMessage('error', 'Invalid Input', 'Please enter a valid cache size in MB.');
|
||||||
|
|||||||
+1
-1
@@ -62,6 +62,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="flex justify-start px-4 pb-4">
|
<div class="flex justify-start px-4">
|
||||||
<p-button label="Save" icon="pi pi-save" [outlined]="true" (click)="saveSettings()"></p-button>
|
<p-button label="Save" icon="pi pi-save" [outlined]="true" (click)="saveSettings()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+80
-79
@@ -17,88 +17,89 @@
|
|||||||
</p-toggleswitch>
|
</p-toggleswitch>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="opdsEnabled" class="flex items-center gap-2 mt-4">
|
@if (opdsEnabled) {
|
||||||
<p class="text-lg py-1">OPDS Endpoint:</p>
|
<div class="flex items-center gap-2 mt-4">
|
||||||
<div class="flex items-center gap-4">
|
<p class="text-lg py-1">OPDS Endpoint:</p>
|
||||||
<input
|
<div class="flex items-center gap-4">
|
||||||
class="min-w-[500px] max-w-[800px]"
|
<input
|
||||||
type="text"
|
class="min-w-[500px] max-w-[800px]"
|
||||||
pInputText
|
type="text"
|
||||||
[value]="opdsEndpoint"
|
pInputText
|
||||||
readonly/>
|
[value]="opdsEndpoint"
|
||||||
<p-button
|
readonly/>
|
||||||
icon="pi pi-copy"
|
<p-button
|
||||||
severity="info"
|
icon="pi pi-copy"
|
||||||
(onClick)="copyOpdsEndpoint()"
|
severity="info"
|
||||||
label="Copy"
|
(onClick)="copyOpdsEndpoint()"
|
||||||
outlined="true">
|
label="Copy"
|
||||||
</p-button>
|
outlined="true">
|
||||||
|
</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:
|
</h2>
|
||||||
</h2>
|
<p-button
|
||||||
<p-button
|
label="Create OPDS User"
|
||||||
label="Create OPDS User"
|
icon="pi pi-plus"
|
||||||
icon="pi pi-plus"
|
outlined="true"
|
||||||
outlined="true"
|
(onClick)="openCreateUserDialog()">
|
||||||
(onClick)="openCreateUserDialog()">
|
</p-button>
|
||||||
</p-button>
|
</div>
|
||||||
|
<div class="mt-3">
|
||||||
|
<p-table [value]="users" [responsiveLayout]="'scroll'">
|
||||||
|
<ng-template pTemplate="header">
|
||||||
|
<tr>
|
||||||
|
<th>Username</th>
|
||||||
|
<th>Password</th>
|
||||||
|
<th>Reset Password</th>
|
||||||
|
<th>Delete</th>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
|
<ng-template pTemplate="body" let-user>
|
||||||
|
<tr>
|
||||||
|
<td>{{ user.username }}</td>
|
||||||
|
<td class="flex items-center gap-2">
|
||||||
|
<p-password
|
||||||
|
[(ngModel)]="dummyPassword"
|
||||||
|
[disabled]="true">
|
||||||
|
</p-password>
|
||||||
|
<i
|
||||||
|
class="pi pi-info-circle text-sky-600"
|
||||||
|
pTooltip="The password is hidden for security reasons and is only visible once during creation. You can reset the password if needed."
|
||||||
|
tooltipPosition="right"
|
||||||
|
style="cursor: pointer;">
|
||||||
|
</i>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p-button
|
||||||
|
icon="pi pi-key"
|
||||||
|
severity="warn"
|
||||||
|
size="small"
|
||||||
|
outlined="true"
|
||||||
|
(onClick)="openResetPasswordDialog(user)">
|
||||||
|
</p-button>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p-button
|
||||||
|
icon="pi pi-trash"
|
||||||
|
severity="danger"
|
||||||
|
size="small"
|
||||||
|
outlined="true"
|
||||||
|
(onClick)="deleteUser(user.id)">
|
||||||
|
</p-button>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ng-template>
|
||||||
|
</p-table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
}
|
||||||
<div class="mt-3">
|
|
||||||
<p-table [value]="users" [responsiveLayout]="'scroll'">
|
|
||||||
<ng-template pTemplate="header">
|
|
||||||
<tr>
|
|
||||||
<th>Username</th>
|
|
||||||
<th>Password</th>
|
|
||||||
<th>Reset Password</th>
|
|
||||||
<th>Delete</th>
|
|
||||||
</tr>
|
|
||||||
</ng-template>
|
|
||||||
<ng-template pTemplate="body" let-user>
|
|
||||||
<tr>
|
|
||||||
<td>{{ user.username }}</td>
|
|
||||||
<td class="flex items-center gap-2">
|
|
||||||
<p-password
|
|
||||||
[(ngModel)]="dummyPassword"
|
|
||||||
[disabled]="true">
|
|
||||||
</p-password>
|
|
||||||
<i
|
|
||||||
class="pi pi-info-circle text-sky-600"
|
|
||||||
pTooltip="The password is hidden for security reasons and is only visible once during creation. You can reset the password if needed."
|
|
||||||
tooltipPosition="right"
|
|
||||||
style="cursor: pointer;">
|
|
||||||
</i>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<p-button
|
|
||||||
icon="pi pi-key"
|
|
||||||
severity="warn"
|
|
||||||
size="small"
|
|
||||||
outlined="true"
|
|
||||||
(onClick)="openResetPasswordDialog(user)">
|
|
||||||
</p-button>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<p-button
|
|
||||||
icon="pi pi-trash"
|
|
||||||
severity="danger"
|
|
||||||
size="small"
|
|
||||||
outlined="true"
|
|
||||||
(onClick)="deleteUser(user.id)">
|
|
||||||
</p-button>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</ng-template>
|
|
||||||
</p-table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p-dialog
|
<p-dialog
|
||||||
|
|||||||
+2
-3
@@ -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,
|
||||||
@@ -29,7 +28,7 @@ import {ToggleSwitch} from 'primeng/toggleswitch';
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
Password,
|
Password,
|
||||||
ToggleSwitch
|
ToggleSwitch
|
||||||
],
|
],
|
||||||
templateUrl: './opds-settings.component.html',
|
templateUrl: './opds-settings.component.html',
|
||||||
styleUrl: './opds-settings.component.scss'
|
styleUrl: './opds-settings.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
+43
-19
@@ -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) {
|
||||||
<p-button label="Edit" severity="info" icon="pi pi-pencil" (onClick)="toggleEdit()"></p-button>
|
<div>
|
||||||
</div>
|
<p-button label="Edit" severity="info" icon="pi pi-pencil" (onClick)="toggleEdit()"></p-button>
|
||||||
<div *ngIf="isEditing" class="flex gap-2">
|
</div>
|
||||||
<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>
|
@if (isEditing) {
|
||||||
</div>
|
<div class="flex gap-2">
|
||||||
|
<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>
|
||||||
|
</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) {
|
||||||
Loading user data...
|
<div class="flex items-center justify-center min-h-[50vh] text-lg">
|
||||||
</div>
|
Loading user data...
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
+2
-3
@@ -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,10 +18,9 @@ import {Message} from 'primeng/message';
|
|||||||
FormsModule,
|
FormsModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
InputText,
|
InputText,
|
||||||
NgIf,
|
|
||||||
Password,
|
Password,
|
||||||
Message
|
Message
|
||||||
],
|
],
|
||||||
templateUrl: './user-profile-dialog.component.html',
|
templateUrl: './user-profile-dialog.component.html',
|
||||||
styleUrls: ['./user-profile-dialog.component.scss']
|
styleUrls: ['./user-profile-dialog.component.scss']
|
||||||
})
|
})
|
||||||
|
|||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
<div class="w-full h-[calc(100vh-12.1rem)] overflow-y-auto border rounded-lg enclosing-container">
|
||||||
|
|
||||||
|
<div class="p-4 pt-8">
|
||||||
|
<app-metadata-provider-settings></app-metadata-provider-settings>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="pb-4">
|
||||||
|
<p-divider></p-divider>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="p-4">
|
||||||
|
<p class="text-lg ">
|
||||||
|
Quick Book Match Preferences
|
||||||
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
|
pTooltip="Choose how metadata fields (title, description, authors, categories, cover) are retrieved by setting priority providers. You can apply the same provider settings to all fields or customize them individually. Enable ‘Refresh Covers’ to update book covers, and ‘Merge Categories’ to consolidate categories/genres from all sources while preserving the existing categories/genres in the book."
|
||||||
|
tooltipPosition="right"
|
||||||
|
style="cursor: pointer;">
|
||||||
|
</i>
|
||||||
|
</p>
|
||||||
|
<app-metadata-advanced-fetch-options
|
||||||
|
(metadataOptionsSubmitted)="onMetadataSubmit($event)"
|
||||||
|
[currentMetadataOptions]="currentMetadataOptions"
|
||||||
|
[submitButtonLabel]="'Save'">
|
||||||
|
</app-metadata-advanced-fetch-options>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
.enclosing-container {
|
||||||
|
border-color: var(--p-content-border-color);
|
||||||
|
}
|
||||||
+63
@@ -0,0 +1,63 @@
|
|||||||
|
import {Component, inject, OnInit} from '@angular/core';
|
||||||
|
import {Divider} from 'primeng/divider';
|
||||||
|
import {MetadataAdvancedFetchOptionsComponent} from '../../book/metadata/metadata-options-dialog/metadata-advanced-fetch-options/metadata-advanced-fetch-options.component';
|
||||||
|
import {MetadataProviderSettingsComponent} from '../global-preferences/metadata-provider-settings/metadata-provider-settings.component';
|
||||||
|
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
|
||||||
|
import {Tooltip} from 'primeng/tooltip';
|
||||||
|
import {MetadataRefreshOptions} from '../../book/metadata/model/request/metadata-refresh-options.model';
|
||||||
|
import {AppSettingsService} from '../../core/service/app-settings.service';
|
||||||
|
import {MessageService} from 'primeng/api';
|
||||||
|
import {Observable} from 'rxjs';
|
||||||
|
import {AppSettingKey, AppSettings} from '../../core/model/app-settings.model';
|
||||||
|
import {filter, take} from 'rxjs/operators';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-metadata-settings-component',
|
||||||
|
imports: [
|
||||||
|
Divider,
|
||||||
|
MetadataAdvancedFetchOptionsComponent,
|
||||||
|
MetadataProviderSettingsComponent,
|
||||||
|
ReactiveFormsModule,
|
||||||
|
Tooltip,
|
||||||
|
FormsModule
|
||||||
|
],
|
||||||
|
templateUrl: './metadata-settings-component.html',
|
||||||
|
styleUrl: './metadata-settings-component.scss'
|
||||||
|
})
|
||||||
|
export class MetadataSettingsComponent implements OnInit {
|
||||||
|
|
||||||
|
currentMetadataOptions!: MetadataRefreshOptions;
|
||||||
|
|
||||||
|
private appSettingsService = inject(AppSettingsService);
|
||||||
|
private messageService = inject(MessageService);
|
||||||
|
|
||||||
|
appSettings$: Observable<AppSettings | null> = this.appSettingsService.appSettings$;
|
||||||
|
|
||||||
|
ngOnInit(): void {
|
||||||
|
this.appSettings$.pipe(
|
||||||
|
filter(settings => !!settings),
|
||||||
|
take(1)
|
||||||
|
).subscribe(settings => {
|
||||||
|
if (settings?.metadataRefreshOptions) {
|
||||||
|
this.currentMetadataOptions = settings.metadataRefreshOptions;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
onMetadataSubmit(metadataRefreshOptions: MetadataRefreshOptions): void {
|
||||||
|
this.saveSetting(AppSettingKey.QUICK_BOOK_MATCH, metadataRefreshOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
private saveSetting(key: string, value: unknown): void {
|
||||||
|
this.appSettingsService.saveSettings([{key, newValue: value}]).subscribe({
|
||||||
|
next: () =>
|
||||||
|
this.showMessage('success', 'Settings Saved', 'The settings were successfully saved!'),
|
||||||
|
error: () =>
|
||||||
|
this.showMessage('error', 'Error', 'There was an error saving the settings.')
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private showMessage(severity: 'success' | 'error', summary: string, detail: string): void {
|
||||||
|
this.messageService.add({severity, summary, detail});
|
||||||
|
}
|
||||||
|
}
|
||||||
+162
-148
@@ -5,52 +5,58 @@
|
|||||||
<p class="text-lg pb-4 pt-4 ">
|
<p class="text-lg pb-4 pt-4 ">
|
||||||
Book Reader Settings: Global or Per-Book
|
Book Reader Settings: Global or Per-Book
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="Select whether to apply the same reader settings (font, theme, spread, zoom, etc.) globally for all books or individually per book."
|
pTooltip="Select whether to apply the same reader settings (font, theme, spread, zoom, etc.) globally for all books or individually per book."
|
||||||
tooltipPosition="right"
|
tooltipPosition="right"
|
||||||
style="cursor: pointer;">
|
style="cursor: pointer;">
|
||||||
</i>
|
</i>
|
||||||
</p>
|
</p>
|
||||||
<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) {
|
||||||
<p-radiobutton
|
<div class="flex items-center gap-2">
|
||||||
[inputId]="item"
|
<p-radiobutton
|
||||||
name="spread"
|
[inputId]="item"
|
||||||
[value]="item"
|
name="spread"
|
||||||
[(ngModel)]="selectedPdfScope"
|
[value]="item"
|
||||||
(ngModelChange)="onPdfScopeChange()">
|
[(ngModel)]="selectedPdfScope"
|
||||||
</p-radiobutton>
|
(ngModelChange)="onPdfScopeChange()">
|
||||||
<label [for]="item">{{ item }}</label>
|
</p-radiobutton>
|
||||||
</div>
|
<label [for]="item">{{ item }}</label>
|
||||||
|
</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) {
|
||||||
<p-radiobutton
|
<div class="flex items-center gap-2">
|
||||||
[inputId]="item"
|
<p-radiobutton
|
||||||
name="spread"
|
[inputId]="item"
|
||||||
[value]="item"
|
name="spread"
|
||||||
[(ngModel)]="selectedEpubScope"
|
[value]="item"
|
||||||
(ngModelChange)="onEpubScopeChange()">
|
[(ngModel)]="selectedEpubScope"
|
||||||
</p-radiobutton>
|
(ngModelChange)="onEpubScopeChange()">
|
||||||
<label [for]="item">{{ item }}</label>
|
</p-radiobutton>
|
||||||
</div>
|
<label [for]="item">{{ item }}</label>
|
||||||
|
</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) {
|
||||||
<p-radiobutton
|
<div class="flex items-center gap-2">
|
||||||
[inputId]="item"
|
<p-radiobutton
|
||||||
name="spread"
|
[inputId]="item"
|
||||||
[value]="item"
|
name="spread"
|
||||||
[(ngModel)]="selectedCbxScope"
|
[value]="item"
|
||||||
(ngModelChange)="onCbxScopeChange()">
|
[(ngModel)]="selectedCbxScope"
|
||||||
</p-radiobutton>
|
(ngModelChange)="onCbxScopeChange()">
|
||||||
<label [for]="item">{{ item }}</label>
|
</p-radiobutton>
|
||||||
</div>
|
<label [for]="item">{{ item }}</label>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -61,38 +67,42 @@
|
|||||||
<p class="text-lg pb-6 pt-4 ">
|
<p class="text-lg pb-6 pt-4 ">
|
||||||
PDF Reader: Global Preferences
|
PDF Reader: Global Preferences
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="Configure global PDF reading options such as page spread, zoom level, and sidebar visibility that apply to all PDFs."
|
pTooltip="Configure global PDF reading options such as page spread, zoom level, and sidebar visibility that apply to all PDFs."
|
||||||
tooltipPosition="right"
|
tooltipPosition="right"
|
||||||
style="cursor: pointer;"></i>
|
style="cursor: pointer;"></i>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<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) {
|
||||||
<p-radiobutton
|
<div class="flex items-center gap-2">
|
||||||
[inputId]="spread.key"
|
<p-radiobutton
|
||||||
name="spread"
|
[inputId]="spread.key"
|
||||||
[value]="spread.key"
|
name="spread"
|
||||||
[(ngModel)]="selectedSpread"
|
[value]="spread.key"
|
||||||
(ngModelChange)="onSpreadChange()">
|
[(ngModel)]="selectedSpread"
|
||||||
</p-radiobutton>
|
(ngModelChange)="onSpreadChange()">
|
||||||
<label [for]="spread.key">{{ spread.name }}</label>
|
</p-radiobutton>
|
||||||
</div>
|
<label [for]="spread.key">{{ spread.name }}</label>
|
||||||
|
</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) {
|
||||||
<p-radiobutton
|
<div class="flex items-center gap-2">
|
||||||
[inputId]="zoom.key"
|
<p-radiobutton
|
||||||
name="zoom"
|
[inputId]="zoom.key"
|
||||||
[value]="zoom.key"
|
name="zoom"
|
||||||
[(ngModel)]="selectedZoom"
|
[value]="zoom.key"
|
||||||
(ngModelChange)="onZoomChange()">
|
[(ngModel)]="selectedZoom"
|
||||||
</p-radiobutton>
|
(ngModelChange)="onZoomChange()">
|
||||||
<label [for]="zoom.key">{{ zoom.name }}</label>
|
</p-radiobutton>
|
||||||
</div>
|
<label [for]="zoom.key">{{ zoom.name }}</label>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -103,102 +113,106 @@
|
|||||||
<p class="text-lg pb-6 pt-4 ">
|
<p class="text-lg pb-6 pt-4 ">
|
||||||
Epub Reader: Global Preferences
|
Epub Reader: Global Preferences
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="Set global EPUB reader options such as themes, font families, and font sizes applied to all EPUBs."
|
pTooltip="Set global EPUB reader options such as themes, font families, and font sizes applied to all EPUBs."
|
||||||
tooltipPosition="right"
|
tooltipPosition="right"
|
||||||
style="cursor: pointer;"></i></p>
|
style="cursor: pointer;"></i></p>
|
||||||
|
|
||||||
<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>Theme:</p>
|
<p>Theme:</p>
|
||||||
<div class="flex gap-4 justify-start">
|
<div class="flex gap-4 justify-start">
|
||||||
<p-select
|
<p-select
|
||||||
size="small"
|
size="small"
|
||||||
[options]="themes"
|
[options]="themes"
|
||||||
[(ngModel)]="selectedTheme"
|
[(ngModel)]="selectedTheme"
|
||||||
optionLabel="name"
|
optionLabel="name"
|
||||||
optionValue="key"
|
optionValue="key"
|
||||||
placeholder="Select a Theme"
|
placeholder="Select a Theme"
|
||||||
class="w-full md:w-32"
|
class="w-full md:w-32"
|
||||||
(ngModelChange)="onThemeChange()">
|
(ngModelChange)="onThemeChange()">
|
||||||
</p-select>
|
</p-select>
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>Font:</p>
|
|
||||||
<div class="flex gap-4 justify-start">
|
|
||||||
<p-select
|
|
||||||
size="small"
|
|
||||||
[options]="fonts"
|
|
||||||
[(ngModel)]="selectedFont"
|
|
||||||
optionLabel="name"
|
|
||||||
optionValue="key"
|
|
||||||
placeholder="Select a Font"
|
|
||||||
class="w-full md:w-32"
|
|
||||||
(ngModelChange)="onFontChange()">
|
|
||||||
</p-select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p>Flow:</p>
|
|
||||||
<div class="flex gap-4 justify-start">
|
|
||||||
<p-select
|
|
||||||
size="small"
|
|
||||||
[options]="flowOptions"
|
|
||||||
[(ngModel)]="selectedFlow"
|
|
||||||
optionLabel="name"
|
|
||||||
optionValue="key"
|
|
||||||
placeholder="Select a Flow"
|
|
||||||
class="w-full md:w-32"
|
|
||||||
(ngModelChange)="onFlowChange()">
|
|
||||||
</p-select>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="py-1">Font Size:</p>
|
|
||||||
<div class="flex gap-4 justify-start items-center">
|
|
||||||
<p-button icon="pi pi-minus" size="small" (click)="decreaseFontSize()"></p-button>
|
|
||||||
<p>{{ fontSize }}%</p>
|
|
||||||
<p-button icon="pi pi-plus" size="small" (click)="increaseFontSize()"></p-button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<p-divider></p-divider>
|
|
||||||
|
|
||||||
<div class="p-4">
|
|
||||||
<p class="text-lg pb-6 pt-4 ">
|
|
||||||
CBX Reader: Global Preferences
|
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
|
||||||
pTooltip="Configure global PDF reading options such as page spread, zoom level, and sidebar visibility that apply to all PDFs."
|
|
||||||
tooltipPosition="right"
|
|
||||||
style="cursor: pointer;"></i>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
|
||||||
<p class="py-1">Page Spread:</p>
|
|
||||||
<div class="flex gap-4 justify-start">
|
|
||||||
<div *ngFor="let spread of cbxSpreads" class="flex items-center gap-2">
|
|
||||||
<p-radiobutton
|
|
||||||
[inputId]="spread.key"
|
|
||||||
name="spread"
|
|
||||||
[value]="spread.key"
|
|
||||||
[(ngModel)]="selectedCbxSpread"
|
|
||||||
(ngModelChange)="onCbxSpreadChange()">
|
|
||||||
</p-radiobutton>
|
|
||||||
<label [for]="spread.key">{{ spread.name }}</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
<p class="py-1">Page Zoom:</p>
|
<p>Font:</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">
|
<p-select
|
||||||
<p-radiobutton
|
size="small"
|
||||||
[inputId]="mode.key"
|
[options]="fonts"
|
||||||
name="zoom"
|
[(ngModel)]="selectedFont"
|
||||||
[value]="mode.key"
|
optionLabel="name"
|
||||||
[(ngModel)]="selectedCbxViewMode"
|
optionValue="key"
|
||||||
(ngModelChange)="onCbxViewModeChange()">
|
placeholder="Select a Font"
|
||||||
</p-radiobutton>
|
class="w-full md:w-32"
|
||||||
<label [for]="mode.key">{{ mode.name }}</label>
|
(ngModelChange)="onFontChange()">
|
||||||
|
</p-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>Flow:</p>
|
||||||
|
<div class="flex gap-4 justify-start">
|
||||||
|
<p-select
|
||||||
|
size="small"
|
||||||
|
[options]="flowOptions"
|
||||||
|
[(ngModel)]="selectedFlow"
|
||||||
|
optionLabel="name"
|
||||||
|
optionValue="key"
|
||||||
|
placeholder="Select a Flow"
|
||||||
|
class="w-full md:w-32"
|
||||||
|
(ngModelChange)="onFlowChange()">
|
||||||
|
</p-select>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="py-1">Font Size:</p>
|
||||||
|
<div class="flex gap-4 justify-start items-center">
|
||||||
|
<p-button icon="pi pi-minus" size="small" (click)="decreaseFontSize()"></p-button>
|
||||||
|
<p>{{ fontSize }}%</p>
|
||||||
|
<p-button icon="pi pi-plus" size="small" (click)="increaseFontSize()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
<p-divider></p-divider>
|
||||||
|
|
||||||
|
<div class="p-4">
|
||||||
|
<p class="text-lg pb-6 pt-4 ">
|
||||||
|
CBX Reader: Global Preferences
|
||||||
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
|
pTooltip="Configure global PDF reading options such as page spread, zoom level, and sidebar visibility that apply to all PDFs."
|
||||||
|
tooltipPosition="right"
|
||||||
|
style="cursor: pointer;"></i>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center">
|
||||||
|
<p class="py-1">Page Spread:</p>
|
||||||
|
<div class="flex gap-4 justify-start">
|
||||||
|
@for (spread of cbxSpreads; track spread) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<p-radiobutton
|
||||||
|
[inputId]="spread.key"
|
||||||
|
name="spread"
|
||||||
|
[value]="spread.key"
|
||||||
|
[(ngModel)]="selectedCbxSpread"
|
||||||
|
(ngModelChange)="onCbxSpreadChange()">
|
||||||
|
</p-radiobutton>
|
||||||
|
<label [for]="spread.key">{{ spread.name }}</label>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="py-1">Page Zoom:</p>
|
||||||
|
<div class="flex gap-4 justify-start">
|
||||||
|
@for (mode of cbxViewModes; track mode) {
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<p-radiobutton
|
||||||
|
[inputId]="mode.key"
|
||||||
|
name="zoom"
|
||||||
|
[value]="mode.key"
|
||||||
|
[(ngModel)]="selectedCbxViewMode"
|
||||||
|
(ngModelChange)="onCbxViewModeChange()">
|
||||||
|
</p-radiobutton>
|
||||||
|
<label [for]="mode.key">{{ mode.name }}</label>
|
||||||
|
</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,39 +1,44 @@
|
|||||||
<div *ngIf="userService.userState$ | async as userData">
|
@if (userService.userState$ | async; as userData) {
|
||||||
<div class="rounded-xl overflow-hidden">
|
<div>
|
||||||
<p-tabs [(value)]="activeTab" scrollable>
|
<div class="rounded-xl overflow-hidden">
|
||||||
<p-tablist>
|
<p-tabs [(value)]="activeTab" scrollable>
|
||||||
<p-tab [value]="SettingsTab.ReaderSettings">Reader Preferences</p-tab>
|
<p-tablist>
|
||||||
<p-tab [value]="SettingsTab.ViewPreferences">View Preferences</p-tab>
|
<p-tab [value]="SettingsTab.ReaderSettings">Reader Preferences</p-tab>
|
||||||
<ng-container *ngIf="userData.permissions.admin">
|
<p-tab [value]="SettingsTab.ViewPreferences">View Preferences</p-tab>
|
||||||
<p-tab [value]="SettingsTab.AdminSettings">Admin Settings</p-tab>
|
@if (userData.permissions.admin) {
|
||||||
<p-tab [value]="SettingsTab.UserManagement">User Management</p-tab>
|
<p-tab [value]="SettingsTab.MetadataSettings">Metadata Settings</p-tab>
|
||||||
<p-tab [value]="SettingsTab.EmailSettings">Email Setting</p-tab>
|
<p-tab [value]="SettingsTab.ApplicationSettings">Application Settings</p-tab>
|
||||||
<p-tab [value]="SettingsTab.AuthenticationSettings">Authentication Settings</p-tab>
|
<p-tab [value]="SettingsTab.UserManagement">User Management</p-tab>
|
||||||
</ng-container>
|
<p-tab [value]="SettingsTab.EmailSettings">Email Settings</p-tab>
|
||||||
</p-tablist>
|
<p-tab [value]="SettingsTab.AuthenticationSettings">Authentication</p-tab>
|
||||||
|
}
|
||||||
<p-tabpanels>
|
</p-tablist>
|
||||||
<p-tabpanel [value]="SettingsTab.ReaderSettings">
|
<p-tabpanels>
|
||||||
<app-reader-preferences></app-reader-preferences>
|
<p-tabpanel [value]="SettingsTab.ReaderSettings">
|
||||||
</p-tabpanel>
|
<app-reader-preferences></app-reader-preferences>
|
||||||
<p-tabpanel [value]="SettingsTab.ViewPreferences">
|
|
||||||
<app-view-preferences-parent></app-view-preferences-parent>
|
|
||||||
</p-tabpanel>
|
|
||||||
<ng-container *ngIf="userData.permissions.admin">
|
|
||||||
<p-tabpanel [value]="SettingsTab.AdminSettings">
|
|
||||||
<app-global-preferences></app-global-preferences>
|
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
<p-tabpanel [value]="SettingsTab.UserManagement">
|
<p-tabpanel [value]="SettingsTab.ViewPreferences">
|
||||||
<app-user-management></app-user-management>
|
<app-view-preferences-parent></app-view-preferences-parent>
|
||||||
</p-tabpanel>
|
</p-tabpanel>
|
||||||
<p-tabpanel [value]="SettingsTab.EmailSettings">
|
@if (userData.permissions.admin) {
|
||||||
<app-email></app-email>
|
<p-tabpanel [value]="SettingsTab.MetadataSettings">
|
||||||
</p-tabpanel>
|
<app-metadata-settings-component></app-metadata-settings-component>
|
||||||
<p-tabpanel [value]="SettingsTab.AuthenticationSettings">
|
</p-tabpanel>
|
||||||
<app-authentication-settings></app-authentication-settings>
|
<p-tabpanel [value]="SettingsTab.ApplicationSettings">
|
||||||
</p-tabpanel>
|
<app-global-preferences></app-global-preferences>
|
||||||
</ng-container>
|
</p-tabpanel>
|
||||||
</p-tabpanels>
|
<p-tabpanel [value]="SettingsTab.UserManagement">
|
||||||
</p-tabs>
|
<app-user-management></app-user-management>
|
||||||
|
</p-tabpanel>
|
||||||
|
<p-tabpanel [value]="SettingsTab.EmailSettings">
|
||||||
|
<app-email></app-email>
|
||||||
|
</p-tabpanel>
|
||||||
|
<p-tabpanel [value]="SettingsTab.AuthenticationSettings">
|
||||||
|
<app-authentication-settings></app-authentication-settings>
|
||||||
|
</p-tabpanel>
|
||||||
|
}
|
||||||
|
</p-tabpanels>
|
||||||
|
</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';
|
||||||
@@ -10,13 +10,15 @@ import {UserManagementComponent} from './user-management/user-management.compone
|
|||||||
import {AuthenticationSettingsComponent} from '../core/security/oauth2-management/authentication-settings.component';
|
import {AuthenticationSettingsComponent} from '../core/security/oauth2-management/authentication-settings.component';
|
||||||
import {ViewPreferencesParentComponent} from './view-preferences-parent/view-preferences-parent.component';
|
import {ViewPreferencesParentComponent} from './view-preferences-parent/view-preferences-parent.component';
|
||||||
import {ReaderPreferences} from './reader-preferences/reader-preferences.component';
|
import {ReaderPreferences} from './reader-preferences/reader-preferences.component';
|
||||||
|
import {MetadataSettingsComponent} from './metadata-settings-component/metadata-settings-component';
|
||||||
|
|
||||||
export enum SettingsTab {
|
export enum SettingsTab {
|
||||||
ReaderSettings = 'reader-settings',
|
ReaderSettings = 'reader-settings',
|
||||||
ViewPreferences = 'view-settings',
|
ViewPreferences = 'view-settings',
|
||||||
UserManagement = 'user-management',
|
UserManagement = 'user-management',
|
||||||
EmailSettings = 'email-settings',
|
EmailSettings = 'email-settings',
|
||||||
AdminSettings = 'admin-settings',
|
MetadataSettings = 'metadata-settings',
|
||||||
|
ApplicationSettings = 'app-settings',
|
||||||
AuthenticationSettings = 'auth-settings'
|
AuthenticationSettings = 'auth-settings'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,15 +30,15 @@ export enum SettingsTab {
|
|||||||
Tab,
|
Tab,
|
||||||
TabPanels,
|
TabPanels,
|
||||||
TabPanel,
|
TabPanel,
|
||||||
NgIf,
|
|
||||||
AsyncPipe,
|
AsyncPipe,
|
||||||
EmailComponent,
|
EmailComponent,
|
||||||
GlobalPreferencesComponent,
|
GlobalPreferencesComponent,
|
||||||
UserManagementComponent,
|
UserManagementComponent,
|
||||||
AuthenticationSettingsComponent,
|
AuthenticationSettingsComponent,
|
||||||
ViewPreferencesParentComponent,
|
ViewPreferencesParentComponent,
|
||||||
ReaderPreferences
|
ReaderPreferences,
|
||||||
],
|
MetadataSettingsComponent
|
||||||
|
],
|
||||||
templateUrl: './settings.component.html',
|
templateUrl: './settings.component.html',
|
||||||
styleUrl: './settings.component.scss'
|
styleUrl: './settings.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
+25
-15
@@ -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)) {
|
||||||
Name is required and must be at least 3 characters.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Name is required and must be at least 3 characters.
|
||||||
|
</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)) {
|
||||||
Enter a valid email address.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Enter a valid email address.
|
||||||
|
</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)) {
|
||||||
Username is required.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Username is required.
|
||||||
|
</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)) {
|
||||||
Password must be at least 6 characters long.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
Password must be at least 6 characters long.
|
||||||
|
</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)) {
|
||||||
At least one library must be selected.
|
<small class="text-red-500 pl-44">
|
||||||
</small>
|
At least one library must be selected.
|
||||||
|
</small>
|
||||||
|
}
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<p class="text-right w-40 font-medium">Permissions:</p>
|
<p class="text-right w-40 font-medium">Permissions:</p>
|
||||||
|
|||||||
+3
-4
@@ -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,9 +20,8 @@ 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,56 +34,97 @@
|
|||||||
</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>
|
||||||
<p-multiSelect
|
@if (user.isEditing) {
|
||||||
*ngIf="user.isEditing"
|
<p-multiSelect
|
||||||
[options]="allLibraries"
|
[options]="allLibraries"
|
||||||
optionLabel="name"
|
optionLabel="name"
|
||||||
optionValue="id"
|
optionValue="id"
|
||||||
[(ngModel)]="editingLibraryIds"
|
[(ngModel)]="editingLibraryIds"
|
||||||
placeholder="Select Libraries"
|
placeholder="Select Libraries"
|
||||||
appendTo="body">
|
appendTo="body">
|
||||||
</p-multiSelect>
|
</p-multiSelect>
|
||||||
<span *ngIf="!user.isEditing">
|
}
|
||||||
{{ user.libraryNames }}
|
@if (!user.isEditing) {
|
||||||
</span>
|
<span>
|
||||||
|
{{ user.libraryNames }}
|
||||||
|
</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,
|
||||||
@@ -29,7 +28,7 @@ import {filter, take} from 'rxjs/operators';
|
|||||||
Password,
|
Password,
|
||||||
LowerCasePipe,
|
LowerCasePipe,
|
||||||
TitleCasePipe
|
TitleCasePipe
|
||||||
],
|
],
|
||||||
templateUrl: './user-management.component.html',
|
templateUrl: './user-management.component.html',
|
||||||
styleUrls: ['./user-management.component.scss'],
|
styleUrls: ['./user-management.component.scss'],
|
||||||
})
|
})
|
||||||
|
|||||||
+46
-51
@@ -2,75 +2,70 @@
|
|||||||
<p class="text-lg pb-6 pt-4">
|
<p class="text-lg pb-6 pt-4">
|
||||||
Library and Shelf View & Sort Preferences:
|
Library and Shelf View & Sort Preferences:
|
||||||
<i class="pi pi-info-circle text-sky-600"
|
<i class="pi pi-info-circle text-sky-600"
|
||||||
pTooltip="Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser."
|
pTooltip="Configure default and per-library/shelf preferences for sorting and view mode (grid or table) in the browser."
|
||||||
tooltipPosition="right"
|
tooltipPosition="right"
|
||||||
style="cursor: pointer;"></i>
|
style="cursor: pointer;"></i>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<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>Default:</p>
|
<p>Default:</p>
|
||||||
<div class="flex gap-4 pl-4">
|
<div class="flex gap-4 pl-4">
|
||||||
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
<p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
||||||
[(ngModel)]="selectedSort" placeholder="Sort" class="w-full md:w-72"></p-select>
|
[(ngModel)]="selectedSort" placeholder="Sort" class="w-full md:w-72"></p-select>
|
||||||
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="selectedSortDir"
|
<p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="selectedSortDir"
|
||||||
placeholder="Direction" class="w-full md:w-44"></p-select>
|
placeholder="Direction" class="w-full md:w-44"></p-select>
|
||||||
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="selectedView"
|
<p-select size="small" [options]="viewModeOptions" [(ngModel)]="selectedView"
|
||||||
placeholder="View" class="w-full md:w-44"></p-select>
|
placeholder="View" class="w-full md:w-44"></p-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center mt-10">
|
<div class="grid grid-cols-[auto,1fr] pl-6 gap-y-4 gap-x-4 items-center mt-10">
|
||||||
<p>Overrides:</p>
|
<p>Overrides:</p>
|
||||||
<div class="flex gap-4">
|
<div class="flex gap-4">
|
||||||
<p-button label="Add New Override" outlined size="small" (onClick)="addOverride()"
|
<p-button label="Add New Override" outlined size="small" (onClick)="addOverride()" severity="info" [disabled]="availableLibraries.length === 0"></p-button>
|
||||||
[disabled]="availableLibraries.length === 0"></p-button>
|
|
||||||
</div>
|
</div>
|
||||||
</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) {
|
||||||
<ng-template pTemplate="header">
|
<p-table [value]="overrides" class="relative z-0" [responsiveLayout]="'scroll'">
|
||||||
<tr>
|
<ng-template pTemplate="header">
|
||||||
<th class="min-w-[150px] max-w-[220px]">Type</th>
|
<tr>
|
||||||
<th class="min-w-[220px] max-w-[280px]">Name</th>
|
<th class="min-w-[150px] max-w-[220px]">Type</th>
|
||||||
<th class="min-w-[190px] max-w-[250px]">Sort By</th>
|
<th class="min-w-[220px] max-w-[280px]">Name</th>
|
||||||
<th class="min-w-[125px]">Sort Dir</th>
|
<th class="min-w-[190px] max-w-[250px]">Sort By</th>
|
||||||
<th class="min-w-[125px]">View</th>
|
<th class="min-w-[125px]">Sort Dir</th>
|
||||||
<th class="w-[75px] text-center"></th>
|
<th class="min-w-[125px]">View</th>
|
||||||
</tr>
|
<th class="w-[75px] text-center"></th>
|
||||||
</ng-template>
|
</tr>
|
||||||
|
</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>
|
@if (override.entityType) {
|
||||||
<ng-container *ngIf="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"
|
||||||
|
[(ngModel)]="override.sort" class="w-full" appendTo="body"></p-select></td>
|
||||||
<td><p-select size="small" [options]="sortOptions" optionLabel="label" optionValue="field"
|
<td><p-select size="small" [options]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
||||||
[(ngModel)]="override.sort" 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]="sortDirectionOptions" [(ngModel)]="override.sortDir"
|
class="w-full" appendTo="body"></p-select></td>
|
||||||
class="w-full" appendTo="body"></p-select></td>
|
<td class="text-center">
|
||||||
|
<p-button icon="pi pi-trash" severity="danger" class="p-button-sm" [outlined]="true"
|
||||||
<td><p-select size="small" [options]="viewModeOptions" [(ngModel)]="override.view"
|
(onClick)="removeOverride(rowIndex)"></p-button>
|
||||||
class="w-full" appendTo="body"></p-select></td>
|
</td>
|
||||||
|
</tr>
|
||||||
<td class="text-center">
|
</ng-template>
|
||||||
<p-button icon="pi pi-trash" severity="danger" class="p-button-sm" [outlined]="true"
|
</p-table>
|
||||||
(onClick)="removeOverride(rowIndex)"></p-button>
|
}
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</ng-template>
|
|
||||||
</p-table>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-start px-6 pt-4">
|
<div class="flex justify-start px-6 pt-4">
|
||||||
|
|||||||
+2
-3
@@ -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,10 +21,9 @@ import {filter, take} from 'rxjs/operators';
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
Button,
|
Button,
|
||||||
NgIf,
|
|
||||||
TableModule,
|
TableModule,
|
||||||
ToastModule
|
ToastModule
|
||||||
],
|
],
|
||||||
templateUrl: './view-preferences.component.html',
|
templateUrl: './view-preferences.component.html',
|
||||||
styleUrl: './view-preferences.component.scss'
|
styleUrl: './view-preferences.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
+5
-3
@@ -1,3 +1,5 @@
|
|||||||
<div *ngIf="loading" class="loading-overlay">
|
@if (loading) {
|
||||||
<p-progressSpinner></p-progressSpinner>
|
<div class="loading-overlay">
|
||||||
</div>
|
<p-progressSpinner></p-progressSpinner>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,15 +2,14 @@ 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']
|
||||||
})
|
})
|
||||||
|
|||||||
+105
-101
@@ -1,111 +1,115 @@
|
|||||||
<div
|
@if ((libraryState$ | async)?.libraries; as libraries) {
|
||||||
*ngIf="(libraryState$ | async)?.libraries as libraries"
|
<div
|
||||||
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"
|
placeholder="Select Upload Location"
|
||||||
placeholder="Select Upload Location"
|
[(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"
|
[multiple]="true" accept=".pdf,.epub,.cbz,.cbr,.cb7"
|
||||||
[multiple]="true" accept=".pdf,.epub,.cbz,.cbr,.cb7"
|
(onSelect)="onFilesSelect($event)"
|
||||||
(onSelect)="onFilesSelect($event)"
|
(uploadHandler)="uploadFiles($event)"
|
||||||
(uploadHandler)="uploadFiles($event)"
|
[disabled]="!selectedLibrary || !selectedPath">
|
||||||
[disabled]="!selectedLibrary || !selectedPath">
|
<ng-template #header let-files let-chooseCallback="chooseCallback" let-clearCallback="clearCallback" let-uploadCallback="uploadCallback">
|
||||||
<ng-template #header let-files let-chooseCallback="chooseCallback" let-clearCallback="clearCallback" let-uploadCallback="uploadCallback">
|
<div class="flex flex-wrap items-center justify-center flex-1 gap-4">
|
||||||
<div class="flex flex-wrap items-center justify-center flex-1 gap-4">
|
<div class="flex gap-4">
|
||||||
<div class="flex gap-4">
|
<p-button (onClick)="choose($event, chooseCallback)"
|
||||||
<p-button (onClick)="choose($event, chooseCallback)"
|
icon="pi pi-images"
|
||||||
icon="pi pi-images"
|
[rounded]="true"
|
||||||
[rounded]="true"
|
[outlined]="true"
|
||||||
[outlined]="true"
|
[disabled]="isChooseDisabled()"/>
|
||||||
[disabled]="isChooseDisabled()"/>
|
<p-button (onClick)="uploadEvent(uploadCallback)"
|
||||||
|
icon="pi pi-cloud-upload"
|
||||||
<p-button (onClick)="uploadEvent(uploadCallback)"
|
[rounded]="true"
|
||||||
icon="pi pi-cloud-upload"
|
[outlined]="true"
|
||||||
[rounded]="true"
|
severity="success"
|
||||||
[outlined]="true"
|
[disabled]="isUploadDisabled()"/>
|
||||||
severity="success"
|
<p-button (onClick)="onClear(clearCallback)"
|
||||||
[disabled]="isUploadDisabled()"/>
|
icon="pi pi-times"
|
||||||
|
[rounded]="true"
|
||||||
<p-button (onClick)="onClear(clearCallback)"
|
[outlined]="true"
|
||||||
icon="pi pi-times"
|
severity="danger"
|
||||||
[rounded]="true"
|
[disabled]="!filesPresent() || isUploading"/>
|
||||||
[outlined]="true"
|
</div>
|
||||||
severity="danger"
|
|
||||||
[disabled]="!filesPresent() || isUploading"/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-template>
|
||||||
</ng-template>
|
<ng-template #content let-files let-removeFileCallback="removeFileCallback">
|
||||||
|
<div class="flex flex-col gap-8 px-4">
|
||||||
<ng-template #content let-files let-removeFileCallback="removeFileCallback">
|
@if (files?.length > 0) {
|
||||||
<div class="flex flex-col gap-8 px-4">
|
<div>
|
||||||
<div *ngIf="files?.length > 0">
|
<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">
|
@for (uploadFile of this.files; track uploadFile; let i = $index) {
|
||||||
<div *ngFor="let uploadFile of this.files; let i = index" class="flex justify-between items-center w-full gap-4">
|
<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">
|
||||||
{{ uploadFile.file.name }}
|
{{ uploadFile.file.name }}
|
||||||
</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'"
|
}
|
||||||
class="pi pi-spin pi-spinner p-3"
|
@case ('Uploading') {
|
||||||
style="color: slateblue"
|
<i
|
||||||
pTooltip="Uploading"
|
class="pi pi-spin pi-spinner p-3"
|
||||||
tooltipPosition="top">
|
style="color: slateblue"
|
||||||
</i>
|
pTooltip="Uploading"
|
||||||
<i *ngSwitchCase="'Uploaded'"
|
tooltipPosition="top">
|
||||||
class="pi pi-check p-3"
|
</i>
|
||||||
style="color: green"
|
}
|
||||||
pTooltip="Uploaded"
|
@case ('Uploaded') {
|
||||||
tooltipPosition="top">
|
<i
|
||||||
</i>
|
class="pi pi-check p-3"
|
||||||
<i *ngSwitchCase="'Failed'"
|
style="color: green"
|
||||||
class="pi pi-exclamation-triangle p-3"
|
pTooltip="Uploaded"
|
||||||
style="color: darkred"
|
tooltipPosition="top">
|
||||||
pTooltip="{{ uploadFile.errorMessage || 'Upload failed' }}"
|
</i>
|
||||||
tooltipPosition="top">
|
}
|
||||||
</i>
|
@case ('Failed') {
|
||||||
</ng-container>
|
<i
|
||||||
|
class="pi pi-exclamation-triangle p-3"
|
||||||
|
style="color: darkred"
|
||||||
|
pTooltip="{{ uploadFile.errorMessage || 'Upload failed' }}"
|
||||||
|
tooltipPosition="top">
|
||||||
|
</i>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</ng-template>
|
||||||
</ng-template>
|
<ng-template #file></ng-template>
|
||||||
|
<ng-template #empty>
|
||||||
<ng-template #file></ng-template>
|
<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>
|
||||||
<ng-template #empty>
|
<p class="mt-6 mb-2">Drag and drop files here to upload.</p>
|
||||||
<div class="flex items-center justify-center flex-col text-center">
|
<p class="mt-2 mb-2">
|
||||||
<i class="pi pi-cloud-upload !border-2 !rounded-full !p-8 !text-4xl !text-muted-color"></i>
|
Only <strong>.pdf</strong>, <strong>.epub</strong>, <strong>.cbz</strong>, <strong>.cbr</strong>, and <strong>.cb7</strong> files are supported (max size: 100 MB per file).
|
||||||
<p class="mt-6 mb-2">Drag and drop files here to upload.</p>
|
</p>
|
||||||
<p class="mt-2 mb-2">
|
</div>
|
||||||
Only <strong>.pdf</strong>, <strong>.epub</strong>, <strong>.cbz</strong>, <strong>.cbr</strong>, and <strong>.cb7</strong> files are supported (max size: 100 MB per file).
|
</ng-template>
|
||||||
</p>
|
</p-fileupload>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
}
|
||||||
</p-fileupload>
|
|
||||||
|
|
||||||
</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,14 +32,10 @@ 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',
|
||||||
styleUrl: './book-uploader.component.scss'
|
styleUrl: './book-uploader.component.scss'
|
||||||
})
|
})
|
||||||
|
|||||||
+7
-3
@@ -7,7 +7,7 @@
|
|||||||
[value]="selectedProductName"
|
[value]="selectedProductName"
|
||||||
[disabled]="true"
|
[disabled]="true"
|
||||||
class="w-full p-2 text-base"
|
class="w-full p-2 text-base"
|
||||||
/>
|
/>
|
||||||
<p-button label="Select" severity="success" class="w-[100px]" (click)="onSelect()"></p-button>
|
<p-button label="Select" severity="success" class="w-[100px]" (click)="onSelect()"></p-button>
|
||||||
</div>
|
</div>
|
||||||
<p-table [value]="paths" [tableStyle]="{ 'min-width': '50rem' }" class="flex-grow overflow-y-auto">
|
<p-table [value]="paths" [tableStyle]="{ 'min-width': '50rem' }" class="flex-grow overflow-y-auto">
|
||||||
@@ -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>
|
||||||
|
|||||||
+3
-4
@@ -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,9 +13,8 @@ import {InputText} from 'primeng/inputtext';
|
|||||||
imports: [
|
imports: [
|
||||||
Button,
|
Button,
|
||||||
TableModule,
|
TableModule,
|
||||||
InputText,
|
InputText
|
||||||
NgIf
|
],
|
||||||
],
|
|
||||||
styleUrls: ['./directory-picker.component.scss']
|
styleUrls: ['./directory-picker.component.scss']
|
||||||
})
|
})
|
||||||
export class DirectoryPickerComponent implements OnInit {
|
export class DirectoryPickerComponent implements OnInit {
|
||||||
|
|||||||
@@ -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">
|
||||||
<div
|
@for (icon of filteredIcons(); track icon) {
|
||||||
*ngFor="let icon of filteredIcons()"
|
<div
|
||||||
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,9 +9,8 @@ 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
|
||||||
})
|
})
|
||||||
export class IconPickerComponent {
|
export class IconPickerComponent {
|
||||||
|
|||||||
Reference in New Issue
Block a user