diff options
| author | Ken D'Ambrosio <ken@jots.org> | 2026-05-09 15:39:34 +0000 |
|---|---|---|
| committer | Ken D'Ambrosio <ken@jots.org> | 2026-05-09 15:39:34 +0000 |
| commit | 21223ec9cc0dcd8c3a5d62478f9b12785f6790a9 (patch) | |
| tree | c9e7c7c7df94269e49b46ff53f5bc13f0d34500d /views/album.erb | |
| parent | 4bb72d5eac546c9e26af0c20169f9233e8364207 (diff) | |
Add live album filter search box
Typing in the search box instantly hides non-matching album cards.
Shown only when an album has more than 4 sub-albums (no point otherwise).
Pure client-side — no server round-trips.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'views/album.erb')
| -rw-r--r-- | views/album.erb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/views/album.erb b/views/album.erb index 077e119..03eb3bb 100644 --- a/views/album.erb +++ b/views/album.erb @@ -20,7 +20,10 @@ <% unless @albums.empty? %> <section class="grid-section"> <% if @entries.any? %><h2 class="section-label">Albums</h2><% end %> - <div class="grid"> + <% if @albums.length > 4 %> + <input type="search" id="album-search" placeholder="Filter albums…" autocomplete="off"> + <% end %> + <div class="grid" id="album-grid"> <% @albums.each do |a| %> <% href = @rel.empty? ? "/browse/#{a[:name]}" : "/browse/#{@rel}/#{a[:name]}" %> <a href="<%= href %>" class="card album-card"> |
