refactor: replace genre with tags in bookshelf UI
- Add Tags filter input with autocomplete support - Update datalist from "genre-datalist" to "tags-datalist" - Update Alpine.js handler from fetchGenreValues to fetchTagValues - Genre HTML preserved in template comments for future use - Regenerate template Go files with templ generate Updates the bookshelf UI to filter by tags instead of genre, matching the Calibre data model where genre is always NULL but tags are populated. Relates to IMPLEMENTATION_TAGS_FILTER.md Phase 5
This commit is contained in:
@@ -100,26 +100,44 @@ templ BookShelf(
|
||||
/>
|
||||
<datalist id="author-datalist"></datalist>
|
||||
</div>
|
||||
<!-- Genre Filter with Autocomplete -->
|
||||
<!-- Tags Filter with Autocomplete -->
|
||||
<div class="flex-1 min-w-[150px]">
|
||||
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">
|
||||
Genre
|
||||
</label>
|
||||
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">Tags</label>
|
||||
<input
|
||||
type="text"
|
||||
name="genre_filter"
|
||||
placeholder="Filter by genre"
|
||||
name="tags_filter"
|
||||
placeholder="Filter by tags"
|
||||
class="w-full px-3 py-2 border rounded-lg"
|
||||
style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);"
|
||||
hx-get="/api/media-items/search"
|
||||
hx-target="#books-grid"
|
||||
hx-trigger="keyup[key=='Enter'] from:#filter-form"
|
||||
hx-include="#filter-form"
|
||||
list="genre-datalist"
|
||||
@input.debounce.300ms="if($el.value.length >= 2) fetchGenreValues($el)"
|
||||
list="tags-datalist"
|
||||
@input.debounce.300ms="if($el.value.length >= 2) fetchTagValues($el)"
|
||||
/>
|
||||
<datalist id="genre-datalist"></datalist>
|
||||
<datalist id="tags-datalist"></datalist>
|
||||
</div>
|
||||
// <!-- Genre Filter with Autocomplete -->
|
||||
// <div class="flex-1 min-w-[150px]">
|
||||
// <label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">
|
||||
// Genre
|
||||
// </label>
|
||||
// <input
|
||||
// type="text"
|
||||
// name="genre_filter"
|
||||
// placeholder="Filter by genre"
|
||||
// class="w-full px-3 py-2 border rounded-lg"
|
||||
// style="background-color: var(--bg-primary); color: var(--text-primary); border-color: var(--border);"
|
||||
// hx-get="/api/media-items/search"
|
||||
// hx-target="#books-grid"
|
||||
// hx-trigger="keyup[key=='Enter'] from:#filter-form"
|
||||
// hx-include="#filter-form"
|
||||
// list="genre-datalist"
|
||||
// @input.debounce.300ms="if($el.value.length >= 2) fetchGenreValues($el)"
|
||||
// />
|
||||
// <datalist id="genre-datalist"></datalist>
|
||||
// </div>
|
||||
<!-- Series Filter with Autocomplete (NEW) -->
|
||||
<div class="flex-1 min-w-[150px]">
|
||||
<label class="block text-sm font-medium mb-2" style="color: var(--text-secondary)">
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user