mirror of
https://github.com/sstent/foodplanner.git
synced 2026-01-25 11:11:36 +00:00
sync - added week menus
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user