sync - added week menus

This commit is contained in:
2025-09-22 09:45:28 -07:00
parent b9ac37183a
commit 45779f1739
7 changed files with 1385 additions and 8 deletions

View File

@@ -83,6 +83,16 @@
<li class="nav-item">
<a class="nav-link" href="/templates">Templates</a>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" onclick="location.href='/weeklymenu'">
<i class="bi bi-calendar-week"></i> Weekly Menu
</button>
</li>
<li class="nav-item" role="presentation">
<button class="nav-link" onclick="location.href='/tracker'">
<i class="bi bi-calendar-check"></i> Tracker
</button>
</li>
</ul>
<div class="tab-content mt-3">
@@ -103,11 +113,17 @@
document.addEventListener('DOMContentLoaded', function() {
const currentPath = window.location.pathname;
const tabs = document.querySelectorAll('.nav-link');
tabs.forEach(tab => {
const href = tab.getAttribute('onclick');
if (href && href.includes(currentPath)) {
tab.classList.add('active');
} else if (currentPath === '/tracker' && href && href.includes('/tracker')) {
// Special case: ensure Tracker tab is active when on /tracker
tab.classList.add('active');
} else if (currentPath === '/weeklymenu' && href && href.includes('/weeklymenu')) {
// Special case: ensure Weekly Menu tab is active when on /weeklymenu
tab.classList.add('active');
} else {
tab.classList.remove('active');
}