mirror of
https://github.com/sstent/foodplanner.git
synced 2026-01-25 19:21:37 +00:00
working models
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Meal Planner</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.2/font/bootstrap-icons.css" rel="stylesheet">
|
||||
<style>
|
||||
.nav-tabs .nav-link.active {
|
||||
background-color: #0d6efd;
|
||||
@@ -28,6 +29,18 @@
|
||||
top: 10px;
|
||||
right: 20px;
|
||||
}
|
||||
.modal-lg {
|
||||
max-width: 800px;
|
||||
}
|
||||
.btn i {
|
||||
margin-right: 4px;
|
||||
}
|
||||
.table th, .table td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
.badge {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -39,20 +52,30 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<h1 class="mt-3 mb-4">Meal Planner</h1>
|
||||
<h1 class="mt-3 mb-4">
|
||||
<i class="bi bi-calendar-check"></i> Meal Planner
|
||||
</h1>
|
||||
|
||||
<ul class="nav nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" onclick="location.href='/foods'">Foods</button>
|
||||
<button class="nav-link" onclick="location.href='/foods'">
|
||||
<i class="bi bi-apple"></i> Foods
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" onclick="location.href='/meals'">Meals</button>
|
||||
<button class="nav-link" onclick="location.href='/meals'">
|
||||
<i class="bi bi-egg-fried"></i> Meals
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" onclick="location.href='/plan'">Plan A</button>
|
||||
<button class="nav-link" onclick="location.href='/plan'">
|
||||
<i class="bi bi-calendar-week"></i> Plan
|
||||
</button>
|
||||
</li>
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link" onclick="location.href='/detailed'">Detailed Planner</button>
|
||||
<button class="nav-link" onclick="location.href='/detailed'">
|
||||
<i class="bi bi-calendar-day"></i> Detailed
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -69,6 +92,21 @@
|
||||
currentUrl.searchParams.set('person', person);
|
||||
window.location.href = currentUrl.toString();
|
||||
}
|
||||
|
||||
// Set active tab based on current URL
|
||||
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 {
|
||||
tab.classList.remove('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
Reference in New Issue
Block a user