- Frontend path: - rename the tracked Angular app tree from `booklore-ui/` to `frontend/` - preserve file contents during the move so this commit stays focused on the path change itself - Frontend docs: - update the moved frontend README and contribution guide where they refer to the renamed folder - keep those edits limited to path references introduced by the directory rename
383 lines
14 KiB
HTML
383 lines
14 KiB
HTML
<div class="bulk-update-container">
|
|
<div class="panel-header">
|
|
<div class="header-icon-wrapper">
|
|
<i class="pi pi-pencil header-icon"></i>
|
|
</div>
|
|
<div class="header-text">
|
|
<h2 class="panel-title">Bulk Edit Metadata</h2>
|
|
<p class="panel-description">{{ books.length }} book{{ books.length !== 1 ? 's' : '' }} selected</p>
|
|
</div>
|
|
<p-button
|
|
icon="pi pi-times"
|
|
[rounded]="true"
|
|
[text]="true"
|
|
severity="secondary"
|
|
(click)="ref.close()"
|
|
class="close-button">
|
|
</p-button>
|
|
</div>
|
|
|
|
<div class="dialog-content">
|
|
@if (loading) {
|
|
<div class="loading-overlay">
|
|
<p-progressSpinner></p-progressSpinner>
|
|
</div>
|
|
}
|
|
|
|
<div class="info-box">
|
|
<div class="info-header">
|
|
<p class="info-title">
|
|
Editing {{ books.length }} Book{{ books.length !== 1 ? 's' : '' }}
|
|
</p>
|
|
<button
|
|
type="button"
|
|
(click)="showBookList = !showBookList"
|
|
class="toggle-list-btn">
|
|
{{ showBookList ? 'Hide' : 'Show' }} Titles
|
|
</button>
|
|
</div>
|
|
|
|
@if (showBookList) {
|
|
<div class="book-list-panel">
|
|
<ul class="book-list">
|
|
@for (book of books; track book) {
|
|
<li>{{ book.metadata?.title || 'Untitled Book' }}</li>
|
|
}
|
|
</ul>
|
|
</div>
|
|
}
|
|
</div>
|
|
|
|
<div class="warning-text">
|
|
<i class="pi pi-exclamation-triangle warning-icon"></i>
|
|
Checking <strong>Clear</strong> will remove that field's metadata from <strong>all selected books</strong>.
|
|
</div>
|
|
|
|
<form [formGroup]="metadataForm" (ngSubmit)="onSubmit()" (keydown)="onFormKeydown($event)" class="bulk-form">
|
|
|
|
<div class="form-row">
|
|
<!-- Authors -->
|
|
<div class="field-group field-group--wide">
|
|
<label for="authors" class="field-label-row">
|
|
<span class="field-label-text">
|
|
Author(s)
|
|
<i class="pi pi-info-circle info-icon"
|
|
pTooltip="Enter multiple authors. Press Enter after typing each name."
|
|
tooltipPosition="right"
|
|
style="cursor: pointer"></i>
|
|
</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.authors" [ngModelOptions]="{standalone: true}" (onChange)="onFieldClearToggle('authors')" binary="true" inputId="clearAuthors"/>
|
|
<label for="clearAuthors" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<p-autoComplete
|
|
class="full-width"
|
|
id="authors"
|
|
formControlName="authors"
|
|
[disabled]="clearFields.authors"
|
|
[multiple]="true"
|
|
[dropdown]="false"
|
|
[forceSelection]="false"
|
|
[suggestions]="filteredAuthors"
|
|
(completeMethod)="filterAuthors($event)"
|
|
(onKeyUp)="onAutoCompleteKeyUp('authors', $event)"
|
|
(onSelect)="onAutoCompleteSelect('authors', $event)">
|
|
</p-autoComplete>
|
|
</div>
|
|
|
|
<!-- Language -->
|
|
<div class="field-group field-group--narrow">
|
|
<label for="language" class="field-label-row">
|
|
<span>Language</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.language" [ngModelOptions]="{standalone: true}"
|
|
(onChange)="onFieldClearToggle('language')" binary="true" inputId="clearLanguage"/>
|
|
<label for="clearLanguage" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<input pInputText id="language" formControlName="language" [disabled]="clearFields.language" class="full-width"/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<!-- Publisher -->
|
|
<div class="field-group field-group--wide">
|
|
<label for="publisher" class="field-label-row">
|
|
<span>Publisher</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.publisher" [ngModelOptions]="{standalone: true}"
|
|
(onChange)="onFieldClearToggle('publisher')" binary="true" inputId="clearPublisher"/>
|
|
<label for="clearPublisher" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<p-autoComplete
|
|
class="full-width"
|
|
inputStyleClass="full-width"
|
|
formControlName="publisher"
|
|
inputId="publisher"
|
|
[disabled]="clearFields.publisher"
|
|
[multiple]="false"
|
|
[dropdown]="false"
|
|
[showClear]="true"
|
|
[forceSelection]="false"
|
|
[suggestions]="filteredPublishers"
|
|
(completeMethod)="filterPublishers($event)">
|
|
</p-autoComplete>
|
|
</div>
|
|
|
|
<!-- Published Date -->
|
|
<div class="field-group field-group--narrow">
|
|
<label for="publishedDate" class="field-label-row">
|
|
<span>Published Date</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.publishedDate" [ngModelOptions]="{standalone: true}"
|
|
(onChange)="onFieldClearToggle('publishedDate')" binary="true" inputId="clearPublishedDate"/>
|
|
<label for="clearPublishedDate" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<p-datepicker
|
|
class="full-width datepicker-min-width"
|
|
formControlName="publishedDate"
|
|
inputId="publishedDate"
|
|
dataType="string"
|
|
dateFormat="yy-mm-dd"
|
|
[disabled]="clearFields.publishedDate"
|
|
[keepInvalid]="true"
|
|
[showIcon]="true"
|
|
[iconDisplay]="'input'"
|
|
fluid="true"
|
|
appendTo="body">
|
|
</p-datepicker>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-row">
|
|
<!-- Series Name -->
|
|
<div class="field-group field-group--wide">
|
|
<label for="seriesName" class="field-label-row">
|
|
<span>Series Name</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.seriesName" [ngModelOptions]="{standalone: true}"
|
|
(onChange)="onFieldClearToggle('seriesName')" binary="true" inputId="clearSeriesName"/>
|
|
<label for="clearSeriesName" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<p-autoComplete
|
|
class="full-width"
|
|
inputStyleClass="full-width"
|
|
formControlName="seriesName"
|
|
inputId="seriesName"
|
|
[disabled]="clearFields.seriesName"
|
|
[multiple]="false"
|
|
[dropdown]="false"
|
|
[showClear]="true"
|
|
[forceSelection]="false"
|
|
[suggestions]="filteredSeries"
|
|
(completeMethod)="filterSeries($event)">
|
|
</p-autoComplete>
|
|
</div>
|
|
|
|
<!-- Series Total -->
|
|
<div class="field-group field-group--narrow">
|
|
<label for="seriesTotal" class="field-label-row">
|
|
<span class="field-label-text">
|
|
Total Books
|
|
<i class="pi pi-info-circle info-icon"
|
|
pTooltip="Total number of books in the series."
|
|
tooltipPosition="right"
|
|
style="cursor: pointer"></i>
|
|
</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.seriesTotal" [ngModelOptions]="{standalone: true}"
|
|
(onChange)="onFieldClearToggle('seriesTotal')" binary="true" inputId="clearSeriesTotal"/>
|
|
<label for="clearSeriesTotal" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<input pInputText id="seriesTotal" type="number" min="1" formControlName="seriesTotal"
|
|
[disabled]="clearFields.seriesTotal" class="full-width"/>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Genres -->
|
|
<div class="field-group">
|
|
<label for="genres" class="field-label-row">
|
|
<span class="field-label-text">
|
|
Genre(s)
|
|
<i class="pi pi-info-circle info-icon"
|
|
pTooltip="Enter multiple genres. Press Enter after typing each genre."
|
|
tooltipPosition="right"
|
|
style="cursor: pointer"></i>
|
|
</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.genres" [ngModelOptions]="{standalone: true}"
|
|
(onChange)="onFieldClearToggle('genres')" binary="true" inputId="clearGenres"/>
|
|
<label for="clearGenres" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<p-autoComplete
|
|
class="full-width"
|
|
id="genres"
|
|
formControlName="genres"
|
|
[disabled]="clearFields.genres"
|
|
[multiple]="true"
|
|
[dropdown]="false"
|
|
[forceSelection]="false"
|
|
[suggestions]="filteredGenres"
|
|
(completeMethod)="filterGenres($event)"
|
|
(onKeyUp)="onAutoCompleteKeyUp('genres', $event)"
|
|
(onSelect)="onAutoCompleteSelect('genres', $event)">
|
|
</p-autoComplete>
|
|
|
|
<div class="merge-option">
|
|
<p-checkbox
|
|
inputId="mergeCategories"
|
|
name="mergeCategories"
|
|
[(ngModel)]="mergeCategories"
|
|
[ngModelOptions]="{ standalone: true }"
|
|
binary="true"
|
|
/>
|
|
<label for="mergeCategories" class="clear-label">
|
|
Keep existing genres and add new ones (uncheck to remove all existing genres)
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Moods -->
|
|
<div class="field-group">
|
|
<label for="moods" class="field-label-row">
|
|
<span class="field-label-text">
|
|
Mood(s)
|
|
<i class="pi pi-info-circle info-icon"
|
|
pTooltip="Enter multiple moods. Press Enter after typing each mood."
|
|
tooltipPosition="right"
|
|
style="cursor: pointer"></i>
|
|
</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.moods" [ngModelOptions]="{standalone: true}"
|
|
(onChange)="onFieldClearToggle('moods')" binary="true" inputId="clearMoods"/>
|
|
<label for="clearMoods" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<p-autoComplete
|
|
class="full-width"
|
|
id="moods"
|
|
formControlName="moods"
|
|
[disabled]="clearFields.moods"
|
|
[multiple]="true"
|
|
[dropdown]="false"
|
|
[forceSelection]="false"
|
|
[suggestions]="filteredMoods"
|
|
(completeMethod)="filterMoods($event)"
|
|
(onKeyUp)="onAutoCompleteKeyUp('moods', $event)"
|
|
(onSelect)="onAutoCompleteSelect('moods', $event)">
|
|
</p-autoComplete>
|
|
|
|
<div class="merge-option">
|
|
<p-checkbox
|
|
inputId="mergeMoods"
|
|
name="mergeMoods"
|
|
[(ngModel)]="mergeMoods"
|
|
[ngModelOptions]="{ standalone: true }"
|
|
binary="true"
|
|
/>
|
|
<label for="mergeMoods" class="clear-label">
|
|
Keep existing moods and add new ones (uncheck to remove all existing moods)
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tags -->
|
|
<div class="field-group">
|
|
<label for="tags" class="field-label-row">
|
|
<span class="field-label-text">
|
|
Tag(s)
|
|
<i class="pi pi-info-circle info-icon"
|
|
pTooltip="Enter multiple tags. Press Enter after typing each tag."
|
|
tooltipPosition="right"
|
|
style="cursor: pointer"></i>
|
|
</span>
|
|
<div class="clear-checkbox">
|
|
<p-checkbox [(ngModel)]="clearFields.tags" [ngModelOptions]="{standalone: true}"
|
|
(onChange)="onFieldClearToggle('tags')" binary="true" inputId="clearTags"/>
|
|
<label for="clearTags" class="clear-label">Clear</label>
|
|
</div>
|
|
</label>
|
|
<p-autoComplete
|
|
class="full-width"
|
|
id="tags"
|
|
formControlName="tags"
|
|
[disabled]="clearFields.tags"
|
|
[multiple]="true"
|
|
[dropdown]="false"
|
|
[forceSelection]="false"
|
|
[suggestions]="filteredTags"
|
|
(completeMethod)="filterTags($event)"
|
|
(onKeyUp)="onAutoCompleteKeyUp('tags', $event)"
|
|
(onSelect)="onAutoCompleteSelect('tags', $event)">
|
|
</p-autoComplete>
|
|
|
|
<div class="merge-option">
|
|
<p-checkbox
|
|
inputId="mergeTags"
|
|
name="mergeTags"
|
|
[(ngModel)]="mergeTags"
|
|
[ngModelOptions]="{ standalone: true }"
|
|
binary="true"
|
|
/>
|
|
<label for="mergeTags" class="clear-label">
|
|
Keep existing tags and add new ones (uncheck to remove all existing tags)
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Cover Image Upload Section -->
|
|
<div class="cover-section">
|
|
<label class="cover-label">
|
|
<i class="pi pi-image"></i>
|
|
Cover Image
|
|
</label>
|
|
<p class="cover-description">
|
|
Upload an image to set as the cover for all selected books.
|
|
</p>
|
|
<div class="cover-actions">
|
|
@if (selectedCoverFile) {
|
|
<div class="cover-file-info">
|
|
<i class="pi pi-file-image"></i>
|
|
<span>{{ selectedCoverFile.name }}</span>
|
|
<p-button
|
|
icon="pi pi-times"
|
|
[text]="true"
|
|
size="small"
|
|
severity="danger"
|
|
(onClick)="clearCoverFile()"
|
|
pTooltip="Remove file"
|
|
tooltipPosition="top">
|
|
</p-button>
|
|
</div>
|
|
} @else {
|
|
<input
|
|
type="file"
|
|
#coverFileInput
|
|
accept="image/jpeg,image/png,image/webp"
|
|
(change)="onCoverFileSelect($event)"
|
|
class="file-input-hidden">
|
|
<p-button
|
|
icon="pi pi-upload"
|
|
label="Select Image"
|
|
[outlined]="true"
|
|
size="small"
|
|
severity="info"
|
|
(onClick)="coverFileInput.click()">
|
|
</p-button>
|
|
}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-submit">
|
|
<p-button type="submit" label="Apply to Selected" [disabled]="loading"/>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|