diff --git a/src/webui/gallery-editor/index.html b/src/webui/gallery-editor/index.html index 6c3efd8..3960ad7 100644 --- a/src/webui/gallery-editor/index.html +++ b/src/webui/gallery-editor/index.html @@ -40,6 +40,16 @@ +
${galleryImages.length} photos
`; + galleryCount.innerHTML = `${imagesToShow.length} photos
`; } // Update gallery count (bottom) const galleryCountBottom = document.getElementById('gallery-count-bottom'); if (galleryCountBottom) { - galleryCountBottom.innerHTML = `${galleryImages.length} photos
`; + galleryCountBottom.innerHTML = `${imagesToShow.length} photos
`; } // Show/hide Remove All button (top) const removeAllBtn = document.getElementById('remove-all-gallery'); if (removeAllBtn) { - removeAllBtn.style.display = galleryImages.length > 0 ? 'inline-block' : 'none'; + removeAllBtn.style.display = imagesToShow.length > 0 ? 'inline-block' : 'none'; } // Show/hide bottom upload row const bottomGalleryUpload = document.getElementById('bottom-gallery-upload'); if (bottomGalleryUpload) { - bottomGalleryUpload.style.display = galleryImages.length > 0 ? 'flex' : 'none'; + bottomGalleryUpload.style.display = imagesToShow.length > 0 ? 'flex' : 'none'; } // Show/hide Remove All button (bottom) const removeAllBtnBottom = document.getElementById('remove-all-gallery-bottom'); if (removeAllBtnBottom) { - removeAllBtnBottom.style.display = galleryImages.length > 0 ? 'inline-block' : 'none'; + removeAllBtnBottom.style.display = imagesToShow.length > 0 ? 'inline-block' : 'none'; } } @@ -475,6 +484,25 @@ document.addEventListener('DOMContentLoaded', () => { document.getElementById('delete-modal-cancel').onclick = hideDeleteModal; document.getElementById('delete-modal-confirm').onclick = confirmDelete; + // --- Radio toggle for gallery filter --- + const showAllRadio = document.getElementById('show-all-radio'); + const showUntaggedRadio = document.getElementById('show-untagged-radio'); + + if (showAllRadio && showUntaggedRadio) { + showAllRadio.addEventListener('change', () => { + if (showAllRadio.checked) { + showOnlyUntagged = false; + renderGallery(); + } + }); + showUntaggedRadio.addEventListener('change', () => { + if (showUntaggedRadio.checked) { + showOnlyUntagged = true; + renderGallery(); + } + }); + } + // Bulk delete buttons const removeAllGalleryBtn = document.getElementById('remove-all-gallery'); const removeAllGalleryBtnBottom = document.getElementById('remove-all-gallery-bottom'); diff --git a/src/webui/style/style.css b/src/webui/style/style.css index 0c311aa..6e40580 100644 --- a/src/webui/style/style.css +++ b/src/webui/style/style.css @@ -236,6 +236,19 @@ h2 { cursor: pointer; } +/* --- Filter Row --- */ +.filter-row label { + display: inline-block; + margin-right: 16px; + font-weight: bold; + cursor: pointer; +} + +.filter-row input[type="radio"] { + accent-color: #55c3ec; + margin-right: 6px; +} + /* --- Gallery & Hero Grid --- */ #gallery, #hero { display: grid;