From 4bb35677777dee0491275bfeb030d99d5672a6f2 Mon Sep 17 00:00:00 2001 From: Admin9705 <9705@duck.com> Date: Wed, 11 Feb 2026 07:47:27 -0500 Subject: [PATCH] nav update --- frontend/static/js/modules/core/navigation.js | 2 +- frontend/templates/components/sidebar.html | 24 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/frontend/static/js/modules/core/navigation.js b/frontend/static/js/modules/core/navigation.js index 21af6b1d..08adbff1 100644 --- a/frontend/static/js/modules/core/navigation.js +++ b/frontend/static/js/modules/core/navigation.js @@ -460,7 +460,7 @@ window.HuntarrNavigation = { } var collectionSub = document.getElementById('movie-hunt-collection-sub'); if (collectionSub) { - var showCollectionSub = ['movie-hunt-home', 'movie-hunt-collection', 'settings-import-media'].indexOf(currentSection) !== -1; + var showCollectionSub = ['movie-hunt-home', 'movie-hunt-collection', 'settings-import-media', 'movie-hunt-calendar'].indexOf(currentSection) !== -1; collectionSub.classList.toggle('expanded', showCollectionSub); } var activitySub = document.getElementById('movie-hunt-activity-sub'); diff --git a/frontend/templates/components/sidebar.html b/frontend/templates/components/sidebar.html index 3b59abf1..5d0c996b 100644 --- a/frontend/templates/components/sidebar.html +++ b/frontend/templates/components/sidebar.html @@ -123,6 +123,10 @@ Movie Collection
- - - Calendar - Settings @@ -211,18 +211,18 @@ // Allow setActiveNavItem to control visibility via 'expanded' class // but force-hide if no instances exist subGroup.style.display = hasInstances ? '' : 'none'; + if (collectionSub) { + collectionSub.style.display = hasInstances ? '' : 'none'; + } if (hasInstances) { - // Check for root folders to show/hide Import Media + // Check for root folders to show/hide Import Media specifically fetch('./api/movie-hunt/root-folders') .then(function(r) { return r.json(); }) .then(function(rfData) { var rootFolders = rfData.root_folders || []; var hasRootFolders = rootFolders.length > 0; - if (collectionSub) { - collectionSub.style.display = hasRootFolders ? '' : 'none'; - } if (importMediaItem) { importMediaItem.style.display = hasRootFolders ? 'flex' : 'none'; } @@ -230,10 +230,8 @@ if (typeof setActiveNavItem === 'function') setActiveNavItem(); }) .catch(function() { - if (collectionSub) collectionSub.style.display = 'none'; + if (importMediaItem) importMediaItem.style.display = 'none'; }); - } else { - if (collectionSub) collectionSub.style.display = 'none'; } }) .catch(function() { @@ -563,7 +561,7 @@ else if (currentHash === '#settings-root-folders') { selector = '#movieHuntSettingsRootFoldersNav'; expandSub('movie-hunt-settings-sub'); } // Movie Hunt sections else if (currentHash === '#movie-hunt-home' || currentHash === '#movie-hunt-collection') { selector = '#movieHuntCollectionNav'; expandSub('movie-hunt-collection-sub'); } - else if (currentHash === '#movie-hunt-calendar') { selector = '#movieHuntCalendarNav'; } + else if (currentHash === '#movie-hunt-calendar') { selector = '#movieHuntCalendarNav'; expandSub('movie-hunt-collection-sub'); } else if (currentHash === '#activity-queue') { selector = '#movieHuntActivityQueueNav'; expandSub('movie-hunt-activity-sub'); } else if (currentHash === '#activity-history') { selector = '#movieHuntActivityHistoryNav'; expandSub('movie-hunt-activity-sub'); } else if (currentHash === '#activity-blocklist') { selector = '#movieHuntActivityBlocklistNav'; expandSub('movie-hunt-activity-sub'); } @@ -595,7 +593,7 @@ var mhActivityHashes = ['#activity-queue', '#activity-history', '#activity-blocklist', '#activity-logs', '#logs-movie-hunt']; if (mhActivityHashes.indexOf(currentHash) === -1) collapseSub('movie-hunt-activity-sub'); - var mhCollectionHashes = ['#movie-hunt-home', '#movie-hunt-collection', '#settings-import-media']; + var mhCollectionHashes = ['#movie-hunt-home', '#movie-hunt-collection', '#settings-import-media', '#movie-hunt-calendar']; if (mhCollectionHashes.indexOf(currentHash) === -1) collapseSub('movie-hunt-collection-sub'); }