diff --git a/internal/router/search.go b/internal/router/search.go
index 177b6f8..d3cd95e 100644
--- a/internal/router/search.go
+++ b/internal/router/search.go
@@ -114,9 +114,13 @@ func handleSearchHTML(c *echo.Context, cfg *Config) error {
}
// Stamp active conflict flags so cards route the play action correctly
bookInfoList = handlers.MarkActiveConflicts(c.Request().Context(), cfg.Queries, user.ID, bookInfoList)
- // Render using BooksGrid template
+ // Render using BooksGrid template (or BookPickerGrid for collection picker)
var buf bytes.Buffer
- err = templates.BooksGrid(bookInfoList, limit, offset, totalCount, libraryID).Render(c.Request().Context(), &buf)
+ if c.QueryParam("show_checkbox") == "true" {
+ err = templates.BookPickerGrid(bookInfoList).Render(c.Request().Context(), &buf)
+ } else {
+ err = templates.BooksGrid(bookInfoList, limit, offset, totalCount, libraryID).Render(c.Request().Context(), &buf)
+ }
if err != nil {
log.Printf("Template render error: %v", err)
return c.HTML(http.StatusInternalServerError, `
Render error
`)
diff --git a/templates/collections.templ b/templates/collections.templ
index 924f5d5..3cb50f7 100644
--- a/templates/collections.templ
+++ b/templates/collections.templ
@@ -137,9 +137,7 @@ templ CollectionDetail(user User, collection CollectionData, books []handlers.Bo
Books in this Collection
-
- 0 selected
-
+
@@ -147,13 +145,14 @@ templ CollectionDetail(user User, collection CollectionData, books []handlers.Bo
type="text"
id="collection-search"
placeholder="Search within collection..."
- onkeyup="filterCollectionBooks()"
+ @input="filterCollectionBooks()"
class="input"
/>